10 Testing and Debugging

So far we have talked a bit about program design and quite a lot about program specification and implementation. We now turn to the related issues of ascertaining whether or not a program works as we hope it will and discovering why not when it does not.

We use the word validation to refer to a process designed to increase our confidence that a program will function as we intend it to. We do validation most commonly through a combination of testing and some form of reasoning about why we believe the program to be correct. We shall use the term debugging to refer to the process of ascertaining why a program is not functioning properly and defensive programming to refer to the practice of writing programs in a way designed ...

Get Program Development in Java: Abstraction, Specification, and Object-Oriented Design now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.