In-Class Exercise
Chapter 7 Interprocedural Coupling Exercise

Introduction to Software Testing, Edition 2
Ammann & Offutt

This is an in-class group exercise Form groups of 2 to 4. Solve the following problem as a group. Write down your answers and be prepared to share with the class. You have about 10 minutes.

These questions pertain to the Quadratic example in the slides.

  1. Write down all variables that are shared or passed between main() and Root().


  2. Find all the last-defs and first-uses. Write them down in as pairs: (Variable name : Line number)


  3. Find all the coupling DU-pairs. Write them down as pairs of triplets. Each triplet is a method name, variable name, and line number. The pair has the last-def on the left and a first-use on the right. For example: (M1(), X, 14) — (M2(), Y, 33)