Professional Documents
Culture Documents
Software Quality Assurance & Testing: Assignment: 02 Submitted by Kanok Chanpa Saha Bhowmik ID-201120
Software Quality Assurance & Testing: Assignment: 02 Submitted by Kanok Chanpa Saha Bhowmik ID-201120
Software Quality Assurance & Testing: Assignment: 02 Submitted by Kanok Chanpa Saha Bhowmik ID-201120
Assignment: 02
Submitted by
Kanok Chanpa Saha Bhowmik
ID-201120
Calculator Test Case for two variable
Mutation Testing
Test case a b Initial program Mutation Result
Number result
9 2 2 4 0 (Line#2: return a-b)
10 4 3 7 12 (Line#2: return a*b)
11 3 2 5 4 (Line#2: return a+1)
12 5 2 7 3 (Line#2: return b+1)
Mutation Testing
Test case a b Initial program Mutation Result
Number result
45 2 2 4 4 (Line#2: return a+b)
46 4 3 7 1 (Line#2: return a-b)
47 3 2 5 4 (Line#2: return a+1)
48 5 2 7 3 (Line#2: return b+1)
Mutation Testing
Test case a b c Initial program Mutation Result
Number result
61 2 2 4 8 0 (Line#2: return
a+b-c)
62 4 3 7 14 84 (Line#2: return
a*b*c)
63 3 2 5 10 4 (Line#2:return
a+1)
64 5 2 7 14 3 (Line#2:return
b+1)
65 7 3 5 15 6 (Line#2:return
c+1)
CFG Table
Line Number Program CFG
1. public String getGrade(int mid, int ct, int A
finalExam, int attendance) { 1,2,3,4
2. Int total=mid+ct+finalExam+attendance;
3. String grade = "";
B 5
4. if(total >= 80) {
5. grade = "A+";
6. } C 6
7. if(total >=70) {
8. grade = "A"; 7
D
9. }
10. if (total >= 60) { 8
E
11. grade = "B";
12. } 9
F
13. if (total >= 50) {
14. grade = "C"; 10
G
15. }
16. if (total <= 50) { H 11
14
K
15
L
M 16
N 17
O 18
19,20
P
Mutation Testing
Test Mid CT Final Attendance Initial Expected Result
case Exam Program
Number Result
107 10 10 10 10 C (80) A+ (80)[Line#5:
return “A+”]
108 10 10 5 5 C (75) A (75) )[Line#8:
return “A”]
109 5 5 5 5 C (65) B (65) )[Line#11:
return “B”]
110 0 0 5 5 C (55) C (55) )[Line#14:
return “C”]
111 20 20 5 5 F (45) F (45) )[Line#17:
return “F”]
CFG Table
Line Number Program CFG
1. public double getGPA(String grade) { A
2. double gpa = 0.0; 1,2,3
3. if(grade == "A+") {
4. gpa = 4.00; B 4
5. }
6. if(grade == "A") { C 5
7. gpa = 3.50;
8. } 6
D
9. if(grade == "B") {
10. gpa = 3.00; 7
E
11. }
12. if(grade == "C") { 8
F
13. return 2.00;
9
14. } else { G
J
I 12
K 13 N
16
14
L
17,18
M 15
O
Multiple Condition Coverage
Test case grade Expected Result Explanation
Number
112 A+ 4.00 Normal Case, Allowed
113 A 3.50 Normal Case, Allowed
114 B 3.00 Normal Case, Allowed
115 C 2.00 Normal Case, Allowed
116 F 0.00 Normal Case, Allowed
117 G Invalid Input Invalid Input
Mutation Testing
Test case grade Initial Program Result Mutant Result
Number
129 A+ 0.00 4.00 (return 4.00)
130 A 0.00 3.50 (return 3.50)
131 B 0.00 3.00 (return 3.00)
132 C 2.00 2.00 (return 2.00)
133 F 0.00 0.00 (return 0.00)