Experiment 1 Test Case
Experiment 1 Test Case
Test case
Test
Case a b c Expected Output Actual Output Error
1 50 50 0 Real Roots Real Roots -
2 50 50 1 Real Roots Real Roots -
3 50 50 50 Imaginary Roots Imaginary Roots -
4 50 50 99 Imaginary Roots Imaginary Roots -
5 50 50 100 Imaginary Roots Imaginary Roots -
6 50 0 50 Imaginary Roots Imaginary Roots -
7 50 1 50 Imaginary Roots Imaginary Roots -
8 50 99 50 Imaginary Roots Imaginary Roots -
9 50 100 50 Equal Roots Equal Roots -
10 0 50 50 Not a Quadratic Eqn Not a Quadratic Eqn -
11 1 50 50 Real Roots Real Roots -
12 99 50 50 Imaginary Roots Imaginary Roots -
13 100 50 50 Imaginary Roots Imaginary Roots -
Output
Experiment 2
Test cases
Test Input Variable Expected Actual Output Error
Case Output
1 50 50 1 Isosceles Isosceles -
2 50 50 2 Isosceles Isosceles -
3 50 50 50 Equilateral Equilateral -
4 50 50 90 Isosceles Isosceles -
5 50 50 100 Not a triangle Not a triangle -
6 50 1 50 Isosceles Isosceles -
7 50 2 50 Isosceles Isosceles -
8 50 99 50 Isosceles Isosceles -
9 50 100 50 Not a triangle Not a triangle -
10 1 50 50 Isosceles Isosceles -
11 2 50 50 Isosceles Isosceles -
12 99 50 50 Isosceles Isosceles -
13 100 50 50 Not a triangle Not a triangle -
Output
Experiment 3
Output
Test cases
Experiment 4
Output
Test case table
2 50 50 1 Isosceles Isosceles -
3 50 50 2 Isosceles Isosceles -
4 50 50 50 Equilateral Equilateral -
5 50 50 99 Isosceles Isosceles -
9 50 1 50 Isosceles Isosceles -
10 50 2 50 Isosceles Isosceles -
11 50 99 50 Isosceles Isosceles -
15 1 50 50 Isosceles Isosceles -
16 21 50 50 Isosceles Isosceles -
17 99 50 50 Isosceles Isosceles -
20 50 55 59 Scalene Scalene -
Experiment 5
Output
A) Test Cases for Triangle
Test Case Input (h) Input (b) Expected Actual Error
Output Output
1 0 100 Invalid Invalid -
input input
2 100 100 5000 5000 -
3 201 100 Invalid Invalid -
input input
4 100 201 Invalid Invalid -
input input
5 100 0 Invalid Invalid -
input input
Input domain:
I1 ={h:h<=0}
I2 ={h:h>=200}
I3 ={h:1<=h<=200}
I4 ={b:b<=0}
I5 ={b:b>200}
I6 ={b:1<=b<=200}
Output Domain:
O1 ={<h,b>:triangle if h>0, b>0}
O2 ={<h,b>:triangle if h<=0, b<=0}
Output Domain:
O1 ={<l,b>:triangle is l>0, b>0}
O2 ={<l,b>:triangle is l<=0, b<=0}
Input domain:
I1 ={S:<=0}
I2 ={S:>200}
I3 ={S:1<S<=200}
Output Domain:
O1 ={<S>: square if S>0}
O2 ={<S>: not square if S<=0}
Output Domain:
O1 ={<r>: circle if r>0}
O2 ={<S>: not circle if r<=0}
Experiment 6
Test cases
Output
Experiment 7
Test Cases
Condition
C1 a=0, b=0 T
C2 a= -ve, b= +ve T
C3 a= +ve, b= -ve T
C4 a= -ve, b= -ve T
C5 a= +ve, b= +ve T
C6 a= 0, b= Integer T
C7 b= 0, a= Integer T
C8 a= +ve, b= -ve T
Action
A1 Domain Error X
A2 –ve Output X
A3 Output = 1 X
A4 +ve Output X X X X
A5 Output = 0 X
Output
Experiment 8
Test cases
C2: x=y - Y Y Y Y N N N N
C3: x=z - Y Y N N Y Y N N
C4: y=z - Y N Y N Y N Y N
a1: Not a x
triangle
a2: Scalene x
a3: Isosceles x x x
a4: Equilateral x x
a5: Impossible X x
Output
Experiment 9
Output
Test case
c1:x<y+z 0 1 1 1 1 1 1 1 1 1 1
c2:y<x+z X 0 1 1 1 1 1 1 1 1 1
c3:z<x+y X X 0 1 1 1 1 1 1 1 1
c4:x=y X X X 1 1 1 1 0 0 0 0
c5:x=z X X X 1 1 0 0 1 1 0 0
c6:y=z X X X 1 0 1 0 1 0 1 0
c1:Not a triangle 1 1 1
c2:Scalene 1
c3:Isosceles 1 1 1
c4:Equilateral 1
c5:Impossible 1 1 1
Cause Effect Graph of Triangle Problem
Experiment 10
DD Path Graph:
1 to 6 n1 Sequential Flow
7 n2 Intermediate node
16 n4 Decision node
17 n5 gotonode
Experiment 11
Output
Experiment 12
Output
Experiment 13
Graph Matrix
A B C D E F G H I J K L
A a i M
B b C
C h
D d e
E o
F f g
G j
H i h
I
J k
K L
L
Experiment 14
Output
(Draw Step 1 and Step 2 from PDF and for step 3 and 4 write the headings)
Experiment 15
Experiment 16
OUTPUT
(A) Statement Coverage
Test cases are:
T1: num=6, ch=’n’
This test case covers all the statements except <10>
Statement coverage= (Total statements exercised/ total executable statements) *100
= 20/2! *100
= 95.32 %
(B) Path Coverage
Paths: <A,B,C,D,E,F,C,D,E,G,H> , <A,B,C,D,E,G,H> , <I,J,K,LM,N> , <I,J,KM,N>
Test cases are: T1: num=7, ch=’y’ T3: num=0, ch=’y’
T2: num=7, ch=’n’ T4: num=0, ch=’n’
Path coverage= (total paths exercised/total executable paths) *100
= 4/4 *100
= 100%
(C) Condition Coverage
There is only one condition statement <9>
Now there are are two conditions A=’y’ and B=’Y’
Then test cases T1: A=True, B=True
T2: A=True, B=False
T3: A=False, B=True
T4: A=False, B=False
Thus, there are three test cases i.e.,
(1) T1: ch=’y’ (2) T2: ch=’Y’ (3) T3: ch=’n’
Condition coverage= (total decisions exercised/total no. of decisions) *100
=1/1 *100
= 100%
(D) Function Coverage
All values of num ensure the execution of the function factorial, hence there is only one test case.
T1: num=6, ch=’n’
Function coverage= (Total functions exercised/ total no. of functions) *100
= 1/1 *100
= 100%