Test Driven Development
I’d like to address an unpopular topic Test Driven Development. For some reason most developers don’t like Test Driven Development. One of the main pillars of TDD is the fact that a developer has to develop the test before he even begins to code. I see that many programmers still use a nice client form to test their code, because it is much easier. But you can image that fact that if you don’t have an automated unit test you are not going to test every scenario available every time you alter your code.
Another problem I sometimes encounter is the fact that there is no update of the unit test if a bug is found in the code. First thing you must do is reproduce the bug in a unit test and then fix the bug in the code, and not the other way around. This is because we programmers most of the time assume that our change in the in code fixed the bug. If we change code first and then try to write an unit test you might wrongfully assume that the bug is fixed.
I’m not saying I like developing unit tests, but I write this item as a reminder to at least myself to why I’m writing these boring test J.