In my previous post on understanding TDD I discussed how to analyze existing code for creating unit tests. This was somewhat of “reverse TDD”, the idea being to look for what to needs to be tested- the relationship between what one class expects and what another class actually does. Unfortunately I stopped short of actually implementing those tests- which is the subject of this post.
Tag Archive for 'UnitTesting'
One of the biggest challenges in unleashing the power of unit testing is getting good code coverage. Most of the time, especially when teams are just starting out with Test Driven Development, unit testing usually gets in the way. A lot of people (I succumb to this syndrome sometimes) add tests after they develop code. The audacity! Some people just don’t unit test at all- especially when struggling with mocking a dependency, like a database or the HttpContext object. And forget about finding more than one unit test for functions- you already have one for a function which passes- so you’re done, right?