this post was submitted on 30 Sep 2025
1089 points (98.7% liked)
Technology
75682 readers
3207 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related news or articles.
- Be excellent to each other!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
- Check for duplicates before posting, duplicates may be removed
- Accounts 7 days and younger will have their posts automatically removed.
Approved Bots
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I really disagree here. If someone else is writing your unit tests, that means one of the following is true:
Devs should write their tests, and reviewers should ensure the tests do a good job covering the logic. At the end of the day, the dev is responsible for the correctness of their code, so this makes the most sense to me.
I don't really see how this follows. Why do the second one necessary have to be lazy, and what stops the first one from being lazy as well.
The reason I like it to be different people is so there are two sets of eyes looking at the same problem without the need for doing a job twice. If you miss something while implementing, it's easier for you to miss it during test writing. It's very hard to switch to testing the concept and not the specific implementation, but if you weren't the one implementing it, you're not "married" to the code and it's easier for you to spot the gaps.
Devs are more invested in code they wrote themselves. When I'm writing tests for something I didn't write, I'm less personally invested in it. Looking at PRs by other devs when we do pushes for improving coverage, I'm not alone here. That's just human psychology, you care more about things you built than things you didn't.
I think testing should be an integral part of the dev process. I don't think any code should be merged until there are tests proving its correctness. Having someone else write the tests encourages handing tests to jr devs since they're "lower priority."