Tutorial 5, Q1.
Tutorial 5, Q1. Briefly describe the purpose and principles of program slicing. Tutorial 5, Q2. Consider the program below. a. By inspection give the dataflow slice wrt (10,{sqs}) b What is the smallest possible slice of the program? What criterion would give this slice?. count := 0;
Tutorial 5, Q1.
E N D
Presentation Transcript
Tutorial 5, Q1. • Briefly describe the purpose and principles of program slicing.
Tutorial 5, Q2 • Consider the program below. a. By inspection give the dataflow slice wrt (10,{sqs}) b What is the smallest possible slice of the program? What criterion would give this slice? • count := 0; • sum := 0; • sqs := 0; • read(x); • while( x >= 0) do • count := count + 1; • sum := sum + x; • sqs := sqs + (x*x); • read(x); • write(count,sum,sqs)