690
Sounds great in theory (programming.dev)
you are viewing a single comment's thread
view the rest of the comments
[-] CoderKat@lemm.ee 10 points 11 months ago

Yeah, I'm constantly recommending junior devs to use TDD specifically for this. I don't recommend it for anything else. If they don't write the test first, it's possible that the test will end up testing the wrong thing and thus they can't be sure they really did fix the bug.

Sometimes it's hard to tell where to write the test ahead of time, so sometimes a slight variation I do is to write the test after (usually because it was such a struggle to figure out where the bug is), but when I'm testing it, I'll comment out the fix or whatever and make sure the test fails.

this post was submitted on 05 Aug 2023
690 points (97.9% liked)

Programmer Humor

31259 readers
830 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS