Summary


Unit testing is without a doubt the best concept to come out of XP. If you retain one thing from XP, make it unit testing.

The following quote from Fred Brooks helps to explain where unit testing can be most valuable :

Systems program building is an entropy- decreasing process, hence inherently metastable. Program maintenance is an entropy-increasing process, and even its most skillful execution only delays the subsidence of the system into unfixable obsolescence. [13]

Unit testing is essentially a tool for regression testing. Add something to the system or make a change, and run the tests to make sure nothing s broken. As such, unit testing (as a part of the larger refactoring process) is a valuable innovation for the maintenance phase of a product life cycle, where it helps to keep entropy at bay. (Of course, XP puts a product into the maintenance phase very early in its life cycle, which increases its reliance on unit tests.)

However, the effectiveness of unit tests is entirely dependent on the development process in which they operate . Test-first design, for example, is no substitute for sufficient up-front design. Used together, on the other hand, up-front design modeling and test-first design can be a very powerful combination ”but then that just wouldn t be XP.

start example

Test-first design is fundamentally a part of emergent architecture and design. We cover this aspect of XP in Chapter 12.

end example
 

Another, vital element of test-first design is, of course, refactoring, which we cover in the next chapter.

[13] Frederick P. Brooks, Jr., The Mythical Man-Month, Twentieth Anniversary Edition (New York, NY: Addison-Wesley, 1995), p. 123.




Extreme Programming Refactored
Extreme Programming Refactored: The Case Against XP
ISBN: 1590590961
EAN: 2147483647
Year: 2003
Pages: 156

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