Introduction
This book describes techniques for implementing the Extreme Programming practices of automated testing
and continuous integration using open source tools.
Let's unpack that statement. Automated testing and continuous integration are 2 of the 12 core practices of the
Extreme Programming (XP) software development methodology. Extreme Programming is a lightweight
software development process that focuses on feedback, communication, simplicity, and courage. The full XP
process is summarized in Chapter 1; suffice it to say for now that it consists of common-sense development
practices practiced religiously and in concert.
Two of these common-sense practices are testing and frequent integration. Almost no software development
shop would consider leaving these steps out of its process entirely—after all, a system has to be integrated to
ship, and it must be tested to ensure that the customers accept the shipment. Thanks to the dot-com
shakeout, most of the shops that did skip these practices are now out of business. Still, many software
companies either struggle with implementing these processes, or acknowledge that they should be done but
claim that "things are just too busy right now" to do them. This book explains and demonstrates the use of
software tools to help put these valuable practices into place.
Why Spend So Much Time on the Tools?
We focus on tools, ironically enough, because XP is a human-centric development philosophy. It recognizes
that the key challenges of writing software are human challenges—such as getting people to work together,
helping programmers learn, and managing emotions. Its four core values (communication, feedback,
simplicity, and courage) are human values. Most books published on XP so far have focused on the human
issues: outlining the philosophy, spreading the ideology (Extreme Programming Explained was described by
Kent Beck as a manifesto), and talking about the feeling of writing software. By doing so, Kent Beck and the
originators of XP have followed their own philosophy: Solve the most pressing problems first. However, the
current books do not cover the technical details of implementing some of their practices. That's where books
like this one come in.
We will explain how to set up continuous integration and automated testing in a Java environment (specifically
J2EE, although most of the tools apply generally). Technical detail will be addressed, and we will offer loads of
examples to show the tools in action. Specifically, we will cover how to use JUnit, Cactus, HttpUnit, JUnitPerf,
and JMeter to write automated tests and how to use Ant (along with the aforementioned tests) to achieve
continuous integration.
Who Should Read this Book
Although this book speaks from an XP perspective, you need not practice XP to benefit from it. Anyone who
needs help automating testing and integration can benefit from the tools and practices outlined herein. If you
know nothing about Extreme Programming, you should probably read the rest of this Introduction, along with
Chapter 1 to get a sense of the practices covered in this book, both alone and in their XP context. In particular,
the Introduction touches on the value of automated testing and continuous integration for all developers.
This book assumes you are at least a moderately experienced Java developer. Because it covers the
application of testing and integration tools to the J2EE platform, this book also expects familiarity with J2EE
technologies and development practices. Those who are not interested in J2EE applications will still find
plenty of worthwhile material, because most of these tools can be applied to almost any Java (or, in the case
of JMeter and HttpUnit, even non-Java) software project. Developers who aren't familiar with J2EE but who
want to apply these tools and techniques to a J2EE application may also want to pick up a comprehensive
J2EE book like Developing Java Enterprise Applications, 2nd edition, by Stephen Asbury and Scott Weiner.
点击下载 Java极限编程