Rules for designing Unit TestUnit Test is code to implement White Box Test — i.e. test only the developer himself can write.
It is written with the intention to be run during the build process already so that people doing Black Box Test can always be sure that a certain minimum of testing was already done and did not reveal errors.
Unit test drivers may also be seen as documenting the developer's understanding of how the system was meant to work behind published interfaces. The should always be implemented to the effect that, when run, the highest possible trace level is activated at least for themselves.
Before we go into details, please read:
Unit test must not:
- talk to the application's database
- rely on test-specific environment settings
- or interfere with tests activated by processes that run in parallel.
Software test neither detecting bugs nur telling us about test coverage achieved is telling the quality manager NOTHING AT ALL (which is unacceptable).
This is why even Unit test — relying on a suitable logging level that can be turned on also by black box testers — should create a list of all the class methods it activated at least once.
tags: Mistakes1gegreit Benefits1gegreit Testing1gegreit