this post was submitted on 15 Jul 2025
459 points (94.9% liked)

Programmer Humor

37235 readers
9 users here now

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

Rules:

founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] FishFace@lemmy.world 2 points 2 days ago

Either way gets me to a passing test, but I prefer the latter because it enables me to write another failing test.

But you could just write that failing test up front. TDD encourages you to pretend to know less than you do (you know that testing evenness requires more than one test, and you know the implementation requires more than some if-statements), but no-one has ever made a convincing argument to me that you get anything out of this pretence.

Tests should make changing your system easier and safer, if they don’t it is typically a sign things are being tested at the wrong level

TDD is about writing (a lot of) unit tests, which are at a low-level. Because they are a low-level design-tool, they test the low-level design. Any non-trivial change affects the low-level design of a component, because changes tend to affect code at a certain level and most of those below it to some degree.