Test of Object-oriented Programs
- slide 34 : 35
Unit Test Recommendation
Test case independence
Each test should examine a single program aspect - in isolation from other aspects
Test simplicity
Test code should be simple
Each test should only activate a single assertion
Contrary to most examples that have been shown earlier in this lecture
Because the first assertion that fails prevents execution of additional assertions
Testing of test code is
simply too much
Test coverage
Each public operation in a class should have at least one associated test
Typically a number of tests per operations
Indeed a very loose meaning of coverage!
Regression test
For each modification - at a reasonable grain size - re-execute all tests