This page contains example Java programs for the book Introduction to Software Testing by Paul Ammann and Jeff Offutt, Cambridge University Press. These programs are available for instructors, students and readers of the book. The authors reserve the copyright on all programs, but grant permission for them to be used for educational purposes. The programs can be modified as long as the authorship and reference to the book remains intact.
Programs that are in the book in partial form have been augmented with a main() method so they can be run from the command line. All programs have been compiled with Java 1.5.
The authors welcome corrections, updates and additions. We will be glad to credit any contributors to these programs.
– Jeff Offutt & Paul Ammann
Back to the book website ...
Program .class file Location Last Update 1. Introduction numZero.java numZero.class Section 1.2, page 12 28-Jan-2008 findLast.java findLast.class Section 1.2, page 16 28-Aug-2008 lastZero.java lastZero.class Section 1.2, page 16 28-Aug-2008 countPositive.java countPositive.class Section 1.2, page 16 27-Jan-2008 oddOrPos.java oddOrPos.class Section 1.2, page 16 28-Aug-2008 2. Graph Testing TestPat.java TestPat.class Section 2.3, page 56 28-Jan-2008 TestPatInstrument.java TestPatInstrument.class Section 2.3, page 61 3-Jun-2008 fmtRewrap.java fmtRewrap.class Section 2.3, page 62 28-Jan-2008 printPrimes.java printPrimes.class Section 2.3, page 63 28-Jan-2008 Quadratic.java Quadratic.class Section 2.4, page 71 28-Jan-2008 trashAndTakeOut.java trashAndTakeOut.class Section 2.4, page 74 28-Jan-2008 Stutter.java Stutter.class Section 2.5, page 80 28-Jan-2008 Queue.java Queue.class Section 2.5, page 86 28-Jan-2008 3. Logic Testing trityp.java trityp.class Section 3.3, page 121 28-Jan-2008 checkIt.java checkIt.class Section 3.3, page 130 28-Jan-2008 twoPred.java twoPred.class Section 3.3, page 130 28-Jan-2008 cal.java cal.class Section 3.4, page 132 28-Jan-2008 4. Input Space Partitioning BoundedQueue.java BoundedQueue.class Section 4.2, page 164 26-Mar-2008 5. Syntax-based Testing findVal.java findVal.class Section 5.2, page 189 28-Jan-2008 sum.java sum.class Section 5.2, page 189 28-Jan-2008 cal.java cal.class Section 5.2, page 190 28-Jan-2008 power.java power.class Section 5.2, page 191 28-Jan-2008 6. Practical Considerations 7. Engineering Criteria for Technologies f.java f.class Section 7.1, page 242 28-Jan-2008 8. Building Testing Tools 9. Challenges in Testing Software
Thanks to Shuang Wang