Preface to the Second Edition

Welcome to the Second Edition of Foundations of Software Testing. Thanks to the many instructors, students, and professionals, the wide adoption of the first edition, and comments and suggestions from the readers, have led to this thoroughly revised version of the first edition. Changes and additions to the text are summarized next.

Reorganization

The second edition is divided into four parts. Part I, titled “Preliminaries,” contains two chapters. Chapter 1 introduces the basics of software testing and Chapter 2 some mathematical preliminaries. Part II, titled “Test Generation,” contains four chapters. Chapter 3 introduces test generation methods based on partitioning the input and output domains of the program under test. Chapter 4 contains test generation methods based on an analysis of the predicates extracted from the requirements or found in the code. Chapter 5 introduces techniques for generating tests from finite state models of a program. Such models are usually derived from the requirements and constitute an element of the overall program design. Chapter 6 introduces techniques for generating tests using various combinatorial designs. Part III, titled “Test Adequacy and Enhancement,” contains two chapters. Chapter 7 introduces control and data flow-based criteria for the measurement of test adequacy. Chapter 8 is a comprehensive introduction to program mutation also as a method for assessing test adequacy. Finally, Part IV, titled “Phases of Testing,” contains three chapters. Chapter 9 introduces fundamentals of regression testing. Chapter 10 introduces techniques and tools for unit testing. And lastly, Chapter 11 introduces various techniques useful during integration testing.

New Material

Readers used to the first edition will find a significant amount of new material in the second edition. Selection of new topics was based on requests from the readers. Unfortunately not all requests for additional material could be entertained in order to keep the size and cost of the book from exploding to an unacceptable level.

 

Tools: All chapters starting at Chapter 5 and onwards include a section titled “Tools.” This section lists tools available that employ some of the techniques discussed in the corresponding chapter. In Chapter 10, a few tools are also described in some detail. Indeed, this is not a book on tools and hence these sections are kept relatively small. The purpose of these sections is to list certain tools to the readers from which one or more could be selected. Of course, software testing tools undergo change and some become obsolete. An attempt has been made to include only those tools that were available either freely or commercially at the time of writing this edition.

 

Part I: A new subsection, titled “Principles of Testing,” has been added to Chapter 1. While the literature in software testing contains a well-known and well-written paper by Bertrand Meyers, the material in this section is solely that of the author. The principles enumerated here are based on the author’s experience with, and his knowledge of, software testing. Also, there is new material on basis paths in Chapter 2.

 

Part II: Chapter 2 from the first edition has now been split into two shorter chapters. Domain testing using the notion of ON-OFF points is added to Chapter 4. Test generation using basis paths introduced in Chapter 2 has also been included in Chapter 4.

 

Part III: Removal of errors is the only change in this part of the book.

 

Part IV: This part contains three chapters corresponding one each to the three phases of the software development cycle, namely, regression testing, unit testing, and integration testing. Chapter 9 remains unchanged from the first edition. Chapter 10 introduces unit testing and the commonly used tools such as JUnit. The topic of stubs and mocks is covered here. Chapter 11 introduces some problems that arise in integration testing and methods to solve them. Finding a near-optimal test order is a well-known problem in integration testing. Three algorithms to solve this problem are described in detail. These are compared using randomly generated Object Relation Diagrams (ORD). Each algorithm was coded in Java and the code is freely available at the Web site maintained by the author—http://www.cs.purdue.edu/homes/apm/foundationsBook/.

Solutions to Exercises

Professor Vahid Garousi at the University of Calgary maintains a list of solutions to selected exercises found at the end of the chapters in the first edition. It is my hope that using “reader sourcing,” we will be able to obtain solutions to all exercises in the second edition.

Errors

Several readers pointed to errors in the first edition. Some of these are technical and some editorial. All errors reported have been corrected in the second edition. A complete list of errors removed is available at http://www.cs.purdue.edu/homes/apm/foundationsBook/errata.html. Errors reported in the second edition will also be available at this site.

Suggestions to instructors

Instructors who are satisfied with the first edition will find that the material they used is available in the second edition. Hence, they need not make any changes in their curriculum. However, some instructors might wish to add the new material to their classes. Given the importance of unit testing, it might be best to introduce this subject towards the beginning of a course based on this book. Similarly, the material on domain testing can be introduced when the basic techniques for test generation are covered. The material on integration testing might be better suited for a graduate course in software testing.

Table 1 lists a sample weekly program for an undergraduate course in software testing. This sample is different from that given in Table 1 in the first edition of this book. However, it is important that students be exposed to a variety of testing tools. Experience indicates that most students learn best when working in small groups. Hence, it is perhaps best to create several small teams of students and assign them the task of learning to use a small set of, say, five freely available testing tools. Each team can demonstrate to the entire class the tools they have been assigned. This enables the entire class to be exposed to a variety of testing tools.

 

Table 1 Sample weekly program for a 17-week undergraduate course in software testing.

Week

Chapter

Comments

1

1: Preliminaries

Form groups of 3 to 5 and assign each group a set of about 5 software testing tools to study on their own. Each group should be asked to make a presentation of one tool starting week 3. The actual presentation schedule will depend on the number of student groups.

2

2: Mathematical preliminaries

Give one short quiz during each week starting in week 2.

3

10: Unit testing

Assign exercises using JUnit or a similar unit testing tool.

4

3: Domain partitioning

 

5

3: Domain partitioning

 

6

4: Predicate analysis

 

7

4: Predicate analysis

 

8

5: Test generation: FSM models; review

Midterm exam

9

5: Test generation: FSM models

 

10

5: Test generation: FSM models

 

11

6: Combinatorial designs

 

12

6: Combinatorial designs

Introduce at least one tool for test generation using combinatorial designs.

13

7: Control and data flow

 

14

7: Control and data flow

 
15

7: Control and data flow

 
16

9: Regression testing

 

17

Review

Final exam

In addition to the testing tools, it is also important that teams of students engage in term projects. Such projects could be sponsored by commercial firms or by the instructor. Experience indicates that students enjoy working on company-sponsored projects and learn a lot about the challenges of software testing.

Cash awards have been given in the past to those who found and reported errors. This offer will continue for the second edition. Please visit the book’s Web site for details.

 

Aditya P. Mathur

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.63.95