You might have heard about the term “Test Driven Development”. The idea is – as I understand it – that for every problem you find in a component of your apps you create a Unit Test that fails. Then you fix the bug. The Test now passes. This can be carried further by writing your test cases even before you write any implementation code.
Especially when encapsulating your frequently-used code in static libraries or frameworks those unit tests can help save you a lot of grief. Imagine adding some nifty new feature to inadvertenly introducing a bug that would break some other existing functionality. If you run the unit tests they would show you immediately that your change broke something.
In this blog post I’m summarizing a couple of things to help you get your own unit tests started.