0% found this document useful (0 votes)
99 views1 page

M1: at Line 4, Replace Index W by Atweight (Index) W M3: at Line 5, Replace Atweight (Index) W by Atweight (Index) Abs (W)

This document provides details for a software testing techniques exam, including 3 questions. Question 1 asks to find test cases to distinguish between 3 mutants of a given code segment or prove they are equivalent. Question 2 asks to generate a control flow graph for a code segment, obtain execution traces for 2 test cases, and generate syntax trees for functions in the code. Question 3 asks to draw a state diagram for traffic lights, encode the model in SMV language, write trap properties for non-conformance and equivalence checking, and identify which are safety and liveness properties. The exam is closed book and notes and requires attempting all questions in 90 minutes.

Uploaded by

Malikijazriaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views1 page

M1: at Line 4, Replace Index W by Atweight (Index) W M3: at Line 5, Replace Atweight (Index) W by Atweight (Index) Abs (W)

This document provides details for a software testing techniques exam, including 3 questions. Question 1 asks to find test cases to distinguish between 3 mutants of a given code segment or prove they are equivalent. Question 2 asks to generate a control flow graph for a code segment, obtain execution traces for 2 test cases, and generate syntax trees for functions in the code. Question 3 asks to draw a state diagram for traffic lights, encode the model in SMV language, write trap properties for non-conformance and equivalence checking, and identify which are safety and liveness properties. The exam is closed book and notes and requires attempting all questions in 90 minutes.

Uploaded by

Malikijazriaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CS 455: Software Testing Techniques

Sessional Test 3 (Maximum Points: 30) Time Allowed: 90 Minutes

Note: This test is closed books and closed neighbours. You are required to attempt all questions.

Que#: 1 Consider the following segment:


1 String findElement (name, atWeight, int size float w){
2 String name[maxSize]; float atWeight[maxSize], w;//maxSize is a
//global variable
3 int index = 0;
4 while(index < size){
5 if (atWeight[index] > w)
6 return (name[index]);
7 index++;
8 }
9 return (“None”);
10 }

Now consider the following mutants for the above code:


M1: At line 4, replace index < size by index < size - 1
M2: At line 5, replace atWeight[index] > w by atWeight[index] >= w
M3: At line 5, replace atWeight[index] > w by atWeight[index] > abs(w)

For each of the above mutants find a test set that distinguishes it from the parent mutant or prove that it
is an equivalent mutant. (3+3+4)

Que#: 2 Consider the following code segment:


1 input (x, y);
2 w = 1;
3 z = 1;
4 while (x < y){
5 if(f1(x) == 0) //f1(int x){return x % 5;}
6 z = f2(x);// f2(int x){return 2*x;}
7 x = f4(x);//f4(int x){return x*x*x;}
8 w = f5(z) //f5(int x){return 5*x-2*x;}
}
9 output(x, w);
Obtain a CFG for the above code. Then for T = {t1:=<x = 5, y = -7>, t2:=<x = 3, y =3>} obtain the
execution trace of function input(). Finally obtain syntax tree(s) for for input(), f1(), f2(), f4() and f5().
(2 + 3+ 5)

Que#: 3 A major square of the city has traffic signal lights for both pedestrians and the vehicles. The
lights for the pedestrians and vehicles can not be both red or green at the same time. They can however
be amber at the same time. You are required to draw a state diagram of these lights. Then encode this
model in SMV language and finally write the trap properties for NC and EC of this model. Also state
which of these are safety properties and which of them are liveness properties. (3+3+4)
Good Luck :)

You might also like