- Before writing new production code (TDD)
- Before fixing a bug (exposing the bug with the test)
- In order to get to know an API where the documenation doesn't help much
- When encountering untested yet critical code (e.g. using a coverage tool)
- In case you are bored and have nothing else to do ;-)
2009/04/18
When to write a unit test?
In my opinion the following are situations to implement another unit test.
Subscribe to:
Post Comments (Atom)
1 comment:
As a variation to "In order to get to know an API where the documenation doesn't help much":
"When I'm unsure about the behaviour of a component or a special/rarely used feature of a component, and I want to get a rough feeling about how to use it."
Post a Comment