Chapter 3

Basic Steps of the Test-First Approach

Remember our introduction? It explained that the approach discussed in this book is based mainly on the technique of writing a test before the actual program code to test this very code. Are we really serious about this? How should I test something that I don’t know yet?

Let us go back to the programming problem of Chapter 1, Section 1.3 once again. We repeat the following requirements specification so you don’t have to look back:

We want to program a dictionary to translate a German text into a language of our choice, say English. This dictionary, in the form of a class, Dictionary, is initialized with a word file and allows us to query the translation of a German word. The program should allow ...

Get Unit Testing in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.