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 C# versions were contributed by Aresh Saharkhiz of Mapua Institute of Technology in the Philippines.
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 (Java) Program (C#) Location Last Update 1. Introduction numZero.java numZero.java.cs Section 1.2, page 12 28-Jan-2008 findLast.java findLast.java.cs Section 1.2, page 16 28-Aug-2008 lastZero.java lastZero.java.cs Section 1.2, page 16 28-Aug-2008 countPositive.java countPositive.java.cs Section 1.2, page 16 27-Jan-2008 oddOrPos.java oddOrPos.java.cs Section 1.2, page 16 28-Aug-2008 2. Graph Testing TestPat.java
TestPat.java.cs
Section 2.3, page 56 28-Jan-2008 TestPatInstrument.java TestPatInstrument.java.cs Section 2.3, page 61 3-Jun-2008 fmtRewrap.java fmtRewrap.java.cs Section 2.3, page 62 28-Jan-2008 printPrimes.java printPrimes.java.cs Section 2.3, page 63 28-Jan-2008 Quadratic.java Quadratic.java.cs Section 2.4, page 71 28-Jan-2008 trashAndTakeOut.java trashAndTakeOut.java.cs Section 2.4, page 74 28-Jan-2008 Stutter.java Stutter.java.cs Section 2.5, page 80 28-Jan-2008 Queue.java Queue.java.cs Section 2.5, page 86 28-Jan-2008 stats.java stats.java.cs Section 2.3, slides 27-Sept-2010 3. Logic Testing trityp.java trityp.java.cs Section 3.3, page 121 28-Jan-2008 checkIt.java checkIt.java.cs Section 3.3, page 130 28-Jan-2008 twoPred.java twoPred.java.cs Section 3.3, page 130 28-Jan-2008 TestPat.java
TestPat.java.cs
Section 3.3, page 131 11-Jun-2014 cal.java cal.java.cs Section 3.4, page 132 28-Jan-2008 4. Input Space Partitioning BoundedQueue.java BoundedQueue.java.cs Section 4.2, page 164 26-Mar-2008 5. Syntax-based Testing findVal.java findVal.java.cs Section 5.2, page 189 28-Jan-2008 sum.java sum.java.cs Section 5.2, page 189 28-Jan-2008 TestPatA.java
TestPatA.java.cs
Section 5.2, page 189 11-Jun-2014 TestPatB.java
TestPatB.java.cs
Section 5.2, page 189 11-Jun-2014 cal.java cal.java.cs Section 5.2, page 190 28-Jan-2008 power.java power.java.cs Section 5.2, page 191 28-Jan-2008 6. Practical Considerations 7. Engineering Criteria for Technologies f.java Section 7.1, page 242 28-Jan-2008 8. Building Testing Tools 9. Challenges in Testing Software
Thanks to Shuang Wang