Hacker News new | ask | show | jobs
by jcoffland 3487 days ago
There's no such thing as painless testing.
4 comments

But it hurts so good.

As opposed to the alternative, which is dealing with technical dept, spaghetti, legacy code, etc...

Testing and technical debt/spaghetti code/legacy code are not mutually exclusive.
you're right. But testing bad code is really really hard. So usually tested code is somewhat better overall, just because it's the easiest way to do it.
If it ain't hurting, you ain't doing it right.
If you develop the tests along with the main code, it's usually less painful, except if there's a hunk of legacy code to integrate your new one with. Ok, this is probably the case for most developers...
Maintaining disorganised code hurts a lot more than writing tests.