Software Testing Week 4 Assignment Answers

1. Which of the following best describes a test driver?

  • It is a special purpose implementation of a software module, used to develop or test a component that calls it.
  • It is a software component that replaces another component that takes care of the control and/or the calling of a software component.
Answer : b

2. If method A uses a variable v shared with method B, where A writes to v and B reads from v, then, it is an example of which kind of coupling interface listed below?

  • Parameter coupling.
  • Interface coupling.
  • External coupling.
  • Shared data coupling.
Answer : d

3. To test sequencing constraints that occur as requirements specification, which of the following tests are used?

  • Tests are inputs to sequencing constraints that violate the constraints.
  • Tests are inputs to sequencing constraints that satisfy the constraints.
  • Tests are sequences of method calls, as they occur in the specification.
  • Tests are randomly generated sequencing constraints.
Answer : c

4. A simple path from the last definition to the first use of a coupling variable is called as . . . . . . . . ..

  • A du-path.
  • A coupling du-path.
Answer : b

5. State Yes or No: Are control flow graphs representing code the same as finite state machines that represent the same code?

  • Yes
  • No
Answer : b

Consider the graph below that depicts the calls to file handler methods open(), close(),read() and write(). Any procedure/method that uses these methods has to satisfy the following sequencing constraints: (1) An open(f) must be executed before every write(t), (2) An open(f) must be executed before every close(), (3) A write(f) may not be executed after a close() unless there is an open(f) in between, (4) A write(t) should be executed before every close().

Answer the following questions with reference to the sequencing constraints and the graph a method that uses these constraints.

6. Which of the following is true with reference to the graph satisfying the sequencing constraints?

  • All the sequencing constraints are satisfied.
  • Constraints (1) and (2) are satisfied but (3) and (4) are not.
  • Constraints (1), (2) and (3) are satisfied but (4) is not.
  • All constraints are violated.
Answer : c

7. State true or false: The path (1,4,5,7) satisfies constraint (4).

  • True.
  • False.
Answer : b

8. State true or false: The path (1,2,3,7) satisfies all the constraints.

  • True.
  • False.
Answer : a

9. State yes or no: Does the path (1,4,6,7) violate any of the constraints?

  • Yes.
  • No.
Answer : b

10. State true or false: The path (1,4,6,4,6,7) satisfies all the constraints.

  • Yes.
  • No.
Answer :  a