Adding Unit Tests

Just a funny anecdote today. I overheard a developer mention that writing code for OneNote was easy, but adding unit tests was taking too much time.

I had to disagree - the benefit of the unit tests is the long term stability they add to the project. This is echoed in the page I linked above:

"The investment of developer time in this activity sometimes results in demoting unit testing to a lower level of priority and that is almost always a mistake."

It is not obvious from the text I am typing here, but the voice of the developer made it obvious that he really understood the value and necessity of unit tests and was just exaggerating for effect. But I agree with him in several ways. Whether it is writing production code or test automation code, the easiest step often seems to be to just write the needed code. All the other collateral - unit tests for developers, source depot for everyone, running test changes in the lab for testers - always seems to make the process go slow. It does in fact slow us down in the short term, but long term we are much better off.

No matter how long you work with software, this conversation keeps coming up and the end result is always the same.

I just thought it was a bit amusing to hear this sentiment repeated in the OneNote hallway.

Questions, comments, concerns and criticisms always welcome,