Chapter 3: Basic Steps of the Test-First Approach


Overview

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 several translation alternatives.

Let's assume that we were really serious about the test-first claim. What would that approach look like in this example?




Unit Testing in Java. How Tests Drive the Code
Unit Testing in Java: How Tests Drive the Code (The Morgan Kaufmann Series in Software Engineering and Programming)
ISBN: 1558608680
EAN: 2147483647
Year: 2003
Pages: 144
Authors: Johannes Link

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net