Module 8: Testing
Testing is an essential part of any software development process, but it is often poorly understood. In this module, we take a simple approach and look at two key approaches to testing. Unit testing is done at the class level, and is designed with the aid of method pre- and post-conditions. System testing is done at the program level, and is designed based on documented use cases. We look at how your approach to object-oriented design is influenced by the need to design and execute tests, and close with some other issues in testing.Lecture material
- Testing :: Powerpoint :: PDF
Tutorial
The first exercise in the self-study module can be used in a tutorial class setting. Students learn how to design unit test cases based on a class specification within a contract programming approach.Self-study module
This module introduces the technique of functional (blackbox) unit testing to verify the correctness of classes. It shows how to design unit test cases based on a class specification within a contract programming approach. The laboratory exercises then guide students through creating and running tester classes in Java from a test case design, utilising the JUnit unit test framework. It also contains a worked example on how to unit test GUI and event handling classes.
- Testing :: pdf
Resources
- Unit test, Wikipedia
http://en.wikipedia.org/wiki/Unit_test - Test case, Wikipedia
http://en.wikipedia.org/wiki/Test_case - John McGregor and David Sykes: A Practical Guide to Testing Object-Oriented Software, Addison-Wesley, 2001
This is an excellent text offering practical advice and techniques for judiciously planning the testing of object-oriented software.