Structural Testing - leortyz/softwareEngineeringResources GitHub Wiki
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.
- Draw the data flow graph (DFG) for the bres function.
- 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-).
- 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.
- Draw the Control Flow Graph (CFG) for the BestInterest program.
- Annotate the graph showing the basic node types that occur in it.
- Give a definition of the DD-path. Draw the DD-path graph for the CFG of the BestInterest program.
- Estimate the maximum number of tests necessary for the 100% Path Coverage of the BestInterest program. Explain how you have arrived at this number.
- 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 ║
╚═════════════╩══════════════╩═════════════════╝