Structural Testing - leortyz/softwareEngineeringResources GitHub Wiki

Download spec file


Objectives

  • Specify a set of test cases to ensure the right operation of a software system

Student Outcome

  • Apply computer science theory and software development fundamentals to produce computing-based solutions.

Section A

Function bres shown below implements a Bresenham line drawing algorithm.

Install new software

  1. Draw the data flow graph (DFG) for the bres function.
  2. Give the definition of the du-pair. Identify all the du-pairs for variables “x1”, “x2” and “y” in the bres function and specify their use (p- or c-).
  3. To achieve 100% All-definitions data flow coverage at least one sub-path from each variable definition to some use of that definition (either c- or p- use) must be executed. Using this definition, specify the test cases for variable p.

Section B

Program BestInterest in figure below computes balance on an account.

  1. Draw the Control Flow Graph (CFG) for the BestInterest program.
  2. Annotate the graph showing the basic node types that occur in it.
  3. Give a definition of the DD-path. Draw the DD-path graph for the CFG of the BestInterest program.
  4. Estimate the maximum number of tests necessary for the 100% Path Coverage of the BestInterest program. Explain how you have arrived at this number.
  5. Specify the test cases which ensure the 100% Statement Coverage of the BestInterest program. Explain what is meant by the Statement Coverage. Explain in detail what principles you have used to generate your test cases. Use a simple form of test case specification, i.e., a table with the following headings:
╔═════════════╦══════════════╦═════════════════╗
║ Test caseID ║ Input values ║ Expected result ║
╚═════════════╩══════════════╩═════════════════╝

Install new software