ABSTRACT

This chapter describes the importance of testing, what should be tested, and how to write code that is easily tested. It describes the use of the JUnit test framework to make writing and running tests fast and easy. Annotations, assertions, and assumptions are covered, along with the technique necessary to test exception handling. A complete test example is included.