this post was submitted on 24 Dec 2023
178 points (96.8% liked)

Fediverse

26832 readers
86 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, KBin, etc).

If you wanted to get help with moderating your own community then head over to !moderators@lemmy.world!

Rules

Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration), Search Lemmy

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] ExLisper@linux.community 1 points 6 months ago (1 children)

Personally I dislike writing useless tests. I use test as a development tool (it's easier to implement some DB operations for example by writing tests than performing some actions manually) and to test logic that can actually fail because of changes in other part of the code withouts me noticing. Testing thinks like "button calls click() method when clicked" is IMHO pointless. If someone can change this code and push to prod without testings manually or doing code review they can also disable the test without anyone noticing.

[โ€“] thisisawayoflife@lemmy.world 2 points 6 months ago

I agree, writing meaningless tests helps nobody and just creates extra work everyone. Unit tests should prove functionality and integration tests act as a vise. Much like you said, if a test breaks in that scenario, then you know something in another class has violated that contract. Good tests will have meaningful names and prove functionality, especially in the backend where it is especially important..

You mention (what I would consider) a bad practice of allowing merges without review. While that should be possible on personal projects with only one dev, strict review guidelines should exist so that nobody can just "push to prod". CICD is your friend - use it so that staging and prod never break. Again, I'm used to working on systems used by scores of millions of users so I appreciate forced automated validation. Nobody likes dumb breaks on a Friday before vacation.