Bad code shouldn't be an option

Some people like to present unit testing as something optional in addition to the code they produce. They usually talk about two options: they can either create good code or good code that comes with tests.

I like to think about it a little bit different: it's either bad code or good code.

You can't write good code if you can't prove it with a test suite. Code without tests is as good as bad code, and it shouldn't be an option for people to settle for bad code.

The more you think about unit testing as indispensable, the closer you get to the developer everyone aspires to be.

Have something to say about this post? Get in touch!

Want to read more? Visit the archive.