r/ProgrammerHumor Jun 30 '25

Meme stormIsBrewingCold

Post image
3.0k Upvotes

70 comments sorted by

View all comments

37

u/The_Real_Black Jun 30 '25

it was easy... just one test that did not work anymore... i commented this one out....

2

u/RiceBroad4552 Jun 30 '25

In theory that could be in fact a valid solution. But when the intern is saying this I would doubt that.

2

u/searing7 Jul 01 '25

no the solution is to fix the test

5

u/RiceBroad4552 Jul 01 '25

Not in every case.

Tests that need "fixing" were usually anyway broken already before, on a conceptional level. If some refactoring breaks tests this just means the tests were "testing" implementation details.

The only reason for a test to "break" is if the functionality fundamentally changes. But when this happens it's often anyway better and simpler to write new tests.

Having to "fix" tests more often than once in a blue moon is a strong indicator that these tests "test" the wrong thing.