3.4 Summary


3.4 Summary

In this chapter, we discussed the typical approach taken in test-driven development and its numerous small micro-iterations, using the dictionary programming example from Chapter 1. More specifically, we demonstrated both the development of a single class and how this class can be separated into a parser and the actual dictionary.

The result of our test-first development clearly looks different from the previous solution designed in Chapter 1, Section 1.3. This means that the test-driven approach is not only a means to reduce program errors, but it also directs the system design towards as few internal and external dependencies as possible. The answer to the question How should I test something I don't know yet? is, therefore: I test it because I don't know it yet! But despite the designing by testing approach, a rough preliminary design is helpful to generate ideas if you are prepared to deviate from it when the implementation leads you somewhere else.

Finally, we focused on issues that come up when using JUnit for increasingly larger applications:

  • If and how to separate test code from application code.

  • How to organize individual test cases into suites and suites of suites.

  • When to run which (sub) set of our tests.




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