Lecture overview -- Keyboard shortcut: 'u'  Previous page: Test Driven Development -- Keyboard shortcut: 'p'  Next page: Test Recommendations in your Project -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 34 : 35
Object-oriented Programming in C#
Test of Object-oriented Programs
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