Data Flow and Sliced-Based Testing
Directions
Complete
Parts 1 and 2, and submit them as a single Microsoft Word document.
Part 1
The
following program calculates a grade based on the number of correct answers
obtained by a student.
Procedure: Compute_Grade(answer, key in array [1 .. 100] of Integer;
grade: out Character);
Var i, score: Integer;
Begin
Score
:= 0;
For i := 1 to 100 do
If answer[i] = key[i], ;then score := score + 1;
If score > 90 then grade := ‘A’
Else
If score >= 80, then grade
:= ‘B’
Else
If score >= 70, then grade
:= ‘C’
Else
If score >= 60, then grade
:= ‘D’
Else grade := ‘F’;
Writeln(‘Grade: ‘, grade)
End
Draw a DD-path graph of the
Compute_Grade procedure.
Construct a Define/User
information table for all variables in the Compute_Grade procedure.
Write paths according to the
following coverage criteria:
All
Du-Paths
All-Uses
All-P-Uses/Some-C-Uses
All-C-Uses/Some-P-Uses
All-Def
All-P-Uses
All-C-Uses
Part 2
Compare
and contrast slice-based testing with du-paths.
Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount