Fault-based testing. Automated testing and verification. J.P. Galeotti - Alessandra Gorla. slides by Gordon Fraser. Thursday, January 17, 13

Size: px
Start display at page:

Download "Fault-based testing. Automated testing and verification. J.P. Galeotti - Alessandra Gorla. slides by Gordon Fraser. Thursday, January 17, 13"

Transcription

1 Fault-based testing Automated testing and verification J.P. Galeotti - Alessandra Gorla slides by Gordon Fraser

2 How good are my tests?

3 How good are my tests? Path testing Boundary interior testing LCSAJ testing Branch testing subsumes Compound condition testing MCDC testing Branch and condition testing Practical Criteria Theoretical Criteria All-c-some-p All-c uses Path testing All-DU paths All uses All-defs All-p-some-c All-p uses Branch testing Loop boundary testing Statement testing Basic condition testing Statement testing

4 /** * Make sure Double.NaN is returned iff n = 0 * */ public void testnan() { StandardDeviation std = new StandardDeviation(); asserttrue(double.isnan(std.getresult())); std.increment(1d); assertequals(0d, std.getresult(), 0);

5 /** * Make sure Double.NaN is returned iff n = 0 * */ public void testnan() { StandardDeviation std = new StandardDeviation(); Double.isNaN(std.getResult()); std.increment(1d); std.getresult();

6 /** * Make sure Double.NaN is returned iff n = 0 * */ public void testnan() { StandardDeviation std = new StandardDeviation(); Double.isNaN(std.getResult()); std.increment(1d); std.getresult(); Coverage is not changed!

7 The Oracle Problem Executing all the code is not enough We need to check the functional behavior Does this thing actually do what we want?

8 Test Oracles Formal specifications Code assertions Test assertions Code contracts Manual oracles

9 How good are my tests? Coverage = how much of the code is executed But how much of the code is checked? We don t know where the bugs are But we know the bugs we have made in the past!

10 Learning from Mistakes

11 Learning from Mistakes Key idea: Learning from earlier mistakes to prevent them from happening again

12 Learning from Mistakes Key idea: Learning from earlier mistakes to prevent them from happening again Key technique: Simulate earlier mistakes and see whether the resulting defects are found

13 Learning from Mistakes Key idea: Learning from earlier mistakes to prevent them from happening again Key technique: Simulate earlier mistakes and see whether the resulting defects are found Known as fault-based testing or mutation testing

14

15 Fish Tag We catch 100 fish and tag them

16 Fish Tag We catch 100 fish and tag them

17 Counting Tags

18 Counting Tags

19 Counting Tags

20 Counting Tags 80

21 Counting Tags 20 80

22 Estimate 100 untagged fish population = 20 80

23

24 Program

25 A Mutant We seed 100 mutations into the program

26 Counting Mutants

27 Counting Mutants

28 Counting Mutants

29 Counting Mutants 80

30 Counting Mutants 20 80

31 Estimate 100 remaining defects = 20 80

32 Basic Assumptions Judge effectiveness of a test suite in finding real faults, by measuring how well it finds seeded fake faults. Valid to the extent that the seeded bugs are representative of real bugs Not necessarily identical (e.g., tagged fish not identical to non tagged fish); but the differences should not affect the selection

33 int do_something(int x, int y) { if(x < y) return x+y; else return x*y; Program

34 int do_something(int x, int y) { if(x < y) return x+y; else return x*y; Program int a = do_something(5, 10); assertequals(a, 15); Test

35 int do_something(int x, int y) { if(x < y) return x+y; else return x*y; Program int a = do_something(5, 10); assertequals(a, 15); Test

36 int do_something(int x, int y) { if(x < y) return x+y; else return x*y; Program int a = do_something(5, 10); assertequals(a, 15); Test int do_something(int x, int y) { if(x < y) return x-y; else return x*y; Mutant

37 int do_something(int x, int y) { if(x < y) return x+y; else return x*y; int do_something(int x, int y) { if(x < y) return x-y; else return x*y; Program Mutant int a = do_something(5, 10); assertequals(a, 15); int a = do_something(5, 10); assertequals(a, 15); Test Test

38 int do_something(int x, int y) { if(x < y) return x+y; else return x*y; int do_something(int x, int y) { if(x < y) return x-y; else return x*y; Program Mutant int a = do_something(5, 10); assertequals(a, 15); int a = do_something(5, 10); assertequals(a, 15); Test Test

39 Mutants Mutant Slightly changed version of original program Syntactic change Valid (compilable code) Simple Programming glitch Based on faults Fault hierarchy

40 Generating Mutants Mutation operator Rule to derive mutants from a program Mutations based on real faults Mutation operators represent typical errors Dedicated mutation operators have been defined for most languages For example, > 100 operators for C language

41 ABS - Absolute Value Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return x;

42 ABS - Absolute Value Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = abs(y); y = tmp; return x;

43 ABS - Absolute Value Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = abs(y); y = tmp; return x;

44 ABS - Absolute Value Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return -abs(x);

45 ABS - Absolute Value Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return -abs(x);

46 ABS - Absolute Value Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return 0;

47 ABS - Absolute Value Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return 0;

48 AOR - Arithmetic Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return x;

49 AOR - Arithmetic Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x * y; x = y; y = tmp; return x;

50 AOR - Arithmetic Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x * y; x = y; y = tmp; return x;

51 AOR - Arithmetic Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x * y; x = y; y = tmp; return x; +, -, *, /, %, **, x, y

52 ROR - Relational Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return x;

53 ROR - Relational Operator Replacement int gcd(int x, int y) { int tmp; while(y > 0) { tmp = x % y; x = y; y = tmp; return x;

54 ROR - Relational Operator Replacement int gcd(int x, int y) { int tmp; while(y > 0) { tmp = x % y; x = y; y = tmp; return x;

55 ROR - Relational Operator Replacement int gcd(int x, int y) { int tmp; while(y > 0) { tmp = x % y; x = y; y = tmp; return x; <, >, <=, >=, =,!=, false, true

56 COR - Conditional Operator Replacement if(a && b)

57 COR - Conditional Operator Replacement if(a && b) if(a b)

58 COR - Conditional Operator Replacement if(a && b) if(a b) if(a & b)

59 COR - Conditional Operator Replacement if(a && b) if(a b) if(a & b) if(a b)

60 COR - Conditional Operator Replacement if(a && b) if(a b) if(a & b) if(a b) if(a ^ b)

61 COR - Conditional Operator Replacement if(a && b) if(a b) if(a & b) if(a b) if(a ^ b) if(false)

62 COR - Conditional Operator Replacement if(a && b) if(a b) if(a & b) if(a b) if(a ^ b) if(false) if(true)

63 COR - Conditional Operator Replacement if(a && b) if(a b) if(a & b) if(a b) if(a ^ b) if(false) if(true) if(a)

64 COR - Conditional Operator Replacement if(a && b) if(a b) if(a & b) if(a b) if(a ^ b) if(false) if(true) if(a) if(b)

65 SOR - Shift Operator Replacement x = m << a

66 SOR - Shift Operator Replacement x = m << a x = m >> a

67 SOR - Shift Operator Replacement x = m << a x = m >> a x = m >>> a

68 SOR - Shift Operator Replacement x = m << a x = m >> a x = m >>> a x = m

69 LOR - Logical Operator Replacement x = m & n

70 LOR - Logical Operator Replacement x = m & n x = m n

71 LOR - Logical Operator Replacement x = m & n x = m n x = m ^ n

72 LOR - Logical Operator Replacement x = m & n x = m n x = m ^ n x = m

73 LOR - Logical Operator Replacement x = m & n x = m n x = m ^ n x = m x = n

74 ASR - Assignment Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return x;

75 ASR - Assignment Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x -= y; y = tmp; return x;

76 ASR - Assignment Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x -= y; y = tmp; return x;

77 ASR - Assignment Operator Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x -= y; y = tmp; return x; +=, -=, *=, /=, %=, &=,

78 UOI - Unary Operator Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return x;

79 UOI - Unary Operator Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % +y; x = y; y = tmp; return x;

80 UOI - Unary Operator Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % +y; x = y; y = tmp; return x;

81 UOI - Unary Operator Insertion int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % +y; x = y; y = tmp; return x; +, -,!, ~,++,--

82 UOD - Unary Operator Deletion if!(a > -b)

83 UOD - Unary Operator Deletion if!(a > -b) if (a > -b)

84 UOD - Unary Operator Deletion if!(a > -b) if (a > -b) if!(a > b)

85 SVR - Scalar Variable Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = y % y; x = y; y = tmp; return x;

86 SVR - Scalar Variable Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = y % y; x = y; y = tmp; return x;

87 SVR - Scalar Variable Replacement int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = y % y; x = y; y = tmp; return x; tmp = x % y tmp = x % x tmp = y % y x = x % y y = y % x tmp = tmp % y tmp = x % tmp

88 OO Mutation So far, operators only considered method bodies Class level elements can be mutated as well:

89 OO Mutation So far, operators only considered method bodies Class level elements can be mutated as well: public class test { //.. protected void do() { //...

90 OO Mutation So far, operators only considered method bodies Class level elements can be mutated as well: public class test { //.. protected void do() { //... public class test { //.. private void do() { //...

91 OO Mutation AMC - Access Modifier Change HVD - Hiding Variable Deletion HVI - Hiding Variable Insertion OMD - Overriding Method Deletion OMM - Overridden Method Moving OMR - Overridden Method Rename SKR - Super Keyword Deletion PCD - Parent Constructor Deletion ATC - Actual Type Change DTC - Declared Type Change PTC - Parameter Type Change RTC - Reference Type Change OMC - Overloading Method Change OMD - Overloading Method Deletion AOC - Argument Order Change ANC - Argument Number Change TKD - this Keyword Deletion SMV - Static Modifier Change VID - Variable Initialization Deletion DCD - Default Constructor 2

92 Interface Mutation Integration testing Change calling method by modifying the values that are sent to a called method Change a calling method by modifying the call Change a called method by modifying the values that enter/leave the method Change a called method by modifying statements that return from the method

93 Order of Mutants First order mutant (FOM) Exactly one mutation Each mutation operator yields a set of FOMs Number of FOMs ~ number of data references * number of data objects

94 Order of Mutants First order mutant (FOM) Exactly one mutation Each mutation operator yields a set of FOMs Number of FOMs ~ number of data references * number of data objects Higher order mutant (HOM) Mutant of mutant

95 Order of Mutants First order mutant (FOM) Exactly one mutation Each mutation operator yields a set of FOMs Number of FOMs ~ number of data references * number of data objects Higher order mutant (HOM) Mutant of mutant #HOM = 2 #FOM - 1

96 Competent Programmer Hypothesis A programmer writes a program that is in the general neighborhood of the set of correct programs

97 Coupling Effect Test data that distinguishes all programs differing from a correct one by only simple errors is so sensitive that it also implicitly distinguishes more complex errors.

98 Mutation testing focuses on First Order Mutants Competent Programmer Hypothesis Coupling Effect

99 Test 1 Test 2 Test 3 Tests Original Program

100 Operators Test 1 Test 2 Test 3 Tests Original Program

101 Operators Test 1 Test 2 Test 3 Tests Original Program

102 Operators Test 1 Test 2 Test 3 Tests Original Program

103 Operators Test 1 Test 2 Test 3 Tests Original Program

104 Operators Test 1 Test 2 Test 3 Tests Original Program

105 Operators Test 1 Test 2 Test 3 Tests Original Program

106 Operators Test 1 Test 2 Test 3 Tests Original Program

107 Operators Test 1 Test 2 Test 3 Tests Original Program

108 Operators Test 1 Test 2 Test 3 Tests Original Program

109 Live mutant - we need more tests Dead mutant - of no further use

110 Mutation Score: Killed Mutants Total Mutants

111 int cgi_decode(char *encoded, char *decoded) { char *eptr = encoded; char *dptr = decoded; int ok = 0; A while (*eptr) { B False True char c; c = *eptr; if (c == '+') { C False True elseif (c == '%') { D *dptr = ' '; E False True else *dptr = *eptr; F F int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 digit_low == -1) { G False else { *dptr = 16 * digit_high + digit_low; H True ok = 1; I *dptr = '\0'; return ok; M ++dptr; ++eptr; L L

112 int cgi_decode(char *encoded, char *decoded) { char *eptr = encoded; char *dptr = decoded; int ok = 0; A while (*eptr) { B False True char c; c = *eptr; if (c == '+') { C False True elseif (c == '%') { D *dptr = ' '; E False True else *dptr = *eptr; F F int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 digit_low == -1) { G False else { *dptr = 16 * digit_high + digit_low; H True ok = 1; I *dptr = '\0'; return ok; M ++dptr; ++eptr; L L

113 int cgi_decode(char *encoded, char *decoded) Input { char *eptr = encoded; char *dptr = decoded; int ok = 0; A while (*eptr) { B False True char c; c = *eptr; if (c == '+') { C False True elseif (c == '%') { D *dptr = ' '; E False True else *dptr = *eptr; F F int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 digit_low == -1) { G False else { *dptr = 16 * digit_high + digit_low; H True ok = 1; I *dptr = '\0'; return ok; M ++dptr; ++eptr; L L

114 int cgi_decode(char *encoded, char *decoded) Input { char *eptr = encoded; char *dptr = decoded; int ok = 0; A while (*eptr) { B False True char c; c = *eptr; if (c == '+') { C False True elseif (c == '%') { D *dptr = ' '; E False True else *dptr = *eptr; F F int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 digit_low == -1) { G False else { *dptr = 16 * digit_high + digit_low; H True ok = 1; I *dptr = '\0'; return ok; M ++dptr; ++eptr; L L

115 int cgi_decode(char *encoded, char *decoded) Input { char *eptr = encoded; char *dptr = decoded; int ok = 0; A while (*eptr) { B False True char c; c = *eptr; if (c == '+') { C False True elseif (c == '%') { D *dptr = ' '; E Reachability else *dptr = *eptr; False F F True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 digit_low == -1) { G False else { *dptr = 16 * digit_high + digit_low; H True ok = 1; I *dptr = '\0'; return ok; M ++dptr; ++eptr; L L

116 int cgi_decode(char *encoded, char *decoded) Input { char *eptr = encoded; char *dptr = decoded; int ok = 0; A while (*eptr) { B False True char c; c = *eptr; if (c == '+') { C False True elseif (c == '%') { D *dptr = ' '; E Reachability else *dptr = *eptr; False F F True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 digit_low == -1) { G False else { *dptr = 16 * digit_high + digit_low; H True ok = 1; I Infection *dptr = '\0'; return ok; M ++dptr; ++eptr; L L

117 int cgi_decode(char *encoded, char *decoded) Input { char *eptr = encoded; char *dptr = decoded; int ok = 0; A while (*eptr) { B False True char c; c = *eptr; if (c == '+') { C False True elseif (c == '%') { D *dptr = ' '; E Reachability else *dptr = *eptr; False F F True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 digit_low == -1) { G False else { *dptr = 16 * digit_high + digit_low; H True ok = 1; I Infection *dptr = '\0'; return ok; M ++dptr; ++eptr; L L

118 int cgi_decode(char *encoded, char *decoded) Input { char *eptr = encoded; char *dptr = decoded; int ok = 0; A while (*eptr) { B False True char c; c = *eptr; if (c == '+') { C False True elseif (c == '%') { D *dptr = ' '; E Reachability else *dptr = *eptr; False F F True int digit_high = Hex_Values[*(++eptr)]; int digit_low = Hex_Values[*(++eptr)]; if (digit_high == -1 digit_low == -1) { G Propagation False else { *dptr = 16 * digit_high + digit_low; H True ok = 1; I Infection *dptr = '\0'; return ok; M ++dptr; ++eptr; L L

119 Equivalent Mutants Mutation = syntactic change The change might leave the semantics unchanged Equivalent mutants are hard to detect (undecidable problem) Might be reached, but no infection Might infect, but no propagation

120 Example 1 int max(int[] values) { int r, i; r = 0; for(i = 1; i<values.length; i++) { if (values[i] > values[r]) r = i; return values[r];

121 Example 1 int max(int[] values) { int r, i; r = 0; for(i = 0; i<values.length; i++) { if (values[i] > values[r]) r = i; return values[r];

122 Example 1 int max(int[] values) { int r, i; r = 0; for(i = 0; i<values.length; i++) { if (values[i] > values[r]) r = i; return values[r];

123 Example 1 int max(int[] values) { int r, i; r = 0; for(i = 1; i<values.length; i++) { if (values[i] >= values[r]) r = i; return values[r];

124 Example 1 int max(int[] values) { int r, i; r = 0; for(i = 1; i<values.length; i++) { if (values[i] >= values[r]) r = i; return values[r];

125 Example 1 int max(int[] values) { int r, i; r = 0; for(i = 1; i<values.length; i++) { if (values[r] > values[r]) r = i; return values[r];

126 Example 1 int max(int[] values) { int r, i; r = 0; for(i = 1; i<values.length; i++) { if (values[r] > values[r]) r = i; return values[r];

127 Example 2 if(x > 0) { if(y > x) { //...

128 Example 2 if(x > 0) { if(y > abs(x)) { //...

129 Example 2 if(x > 0) { if(y > abs(x)) { //...

130 Example Classify triangle by the length of the sides Equilateral Isosceles ((((Equilateral((((((((Isosceles((((((((((Scalene(

131 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene

132 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene

133 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles (0, 0, 0) return 3; // scalene

134 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles (0, 0, 0) return 3; // scalene

135 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles (0, 0, 0) (1, 1, 3) return 3; // scalene

136 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles (0, 0, 0) (1, 1, 3) return 3; // scalene

137 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles (0, 0, 0) (1, 1, 3) (2, 2, 2) return 3; // scalene

138 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles (0, 0, 0) (1, 1, 3) (2, 2, 2) return 3; // scalene

139 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) return 3; // scalene

140 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) return 3; // scalene

141 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

142 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a - b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

143 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a - b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

144 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a - b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

145 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a - b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

146 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a - b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

147 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a - b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

148 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a - b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

149 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

150 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

151 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

152 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

153 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

154 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

155 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

156 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

157 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

158 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

159 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

160 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

161 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

162 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

163 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

164 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

165 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

166 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

167 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

168 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

169 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

170 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

171 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

172 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

173 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

174 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

175 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

176 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

177 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a++ == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

178 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a++ == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

179 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a++ == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

180 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a++ == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

181 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a++ == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

182 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a++ == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

183 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a++ == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

184 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

185 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

186 int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (0, 1, 1) (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

187 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles (0, 0, 0) return 3; // scalene (0, 1, 1) return 3; // scalene (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

188 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles (0, 0, 0) return 3; // scalene return 3; // scalene (0, 1, 1) (4, 3, 2) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

189 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles (0, 0, 0) return 3; // scalene return 3; // scalene (0, 1, 1) (4, 3, 2) (1, 1, 3) int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (2, 2, 2) (2, 2, 3) (2, 3, 4)

190 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles (0, 0, 0) return 3; // scalene return 3; // scalene (0, 1, 1) (4, 3, 2) (1, 1, 3) int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (1, 1, 1) (2, 2, 2) (2, 2, 3) (2, 3, 4)

191 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles (0, 0, 0) return 3; // scalene return 3; // scalene (0, 1, 1) (4, 3, 2) (1, 1, 3) int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (1, 1, 1) int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene (2, 2, 2) (2, 2, 3) (2, 3, 4)

192 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles (0, 0, 0) return 3; // scalene return 3; // scalene (0, 1, 1) (4, 3, 2) (1, 1, 3) int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene return 3; // scalene (1, 1, 1) (2, 3, 2) (2, 2, 2) (2, 2, 3) (2, 3, 4)

193 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles (0, 0, 0) return 3; // scalene return 3; // scalene (0, 1, 1) (4, 3, 2) (1, 1, 3) int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene return 3; // scalene (1, 1, 1) (2, 3, 2) (2, 2, 2) (2, 2, 3) (2, 3, 4)

194 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { return 3; // scalene return 3; // scalene if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (a == b b == c a++ == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { return 3; // scalene if (! (a * b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles int triangle(int a, int b, int c) { (0, 1, 1) (4, 3, 2) if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c++) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene return 3; // scalene (1, 1, 1) (2, 3, 2) (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

195 int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (b <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a >= c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { return 3; // scalene return 3; // scalene if (! (a + b > c && a + c > b && b + c > a)) { (0, 1, 1) (4, 3, 2) if (a == b && b == c) { return 1; // equilateral int triangle(int a, int b, int c) { int triangle(int a, int b, int c) { if (a == b b == c a++ == c) { return 2; // isosceles if (a <= 0 b <= 0 c <= 0) { if (b <= 0 b <= 0 c <= 0) { return 3; // scalene if (! (a * b > c && a + c > b && b + c > a)) { if (! (a + b > c && a + c > b && b + c > a)) { equivalent! if (a == b && b == c) { if (a == b && b == c++) { return 1; // equilateral return 1; // equilateral if (a == b b == c a == c) { if (a == b b == c a == c) { return 2; // isosceles return 2; // isosceles int triangle(int a, int b, int c) { return 3; // scalene return 3; // scalene (1, 1, 1) (2, 3, 2) (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4)

196 Performance

197 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! ( a + b > c&& a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene

198 a + b > c

199 a + b > c a - b > c a * b > c a / b > c a % b > c a > c b > c abs(a) - b > c a - abs(b) > c a - b > abs(c) abs(a - b) > c -abs(a) - b > c a - -abs(b) > c a - b > -abs(c) -abs(a - b) > c a - b >= c a - b < c a - b <= c a - b = c a - b!= c b - b > c a - a > c c - b > c a - c > c a - b > a a - b > b a - b > c 0 - b > c a - 0 > c a - b > 0 ++a - b > c a - ++b > c a - b > ++c --a - b > c a - --b > c a - b > --c ++(a - b) > c --(a - b) > c -a - b > c a - -b > c a - b > -c -(a - b) > c 0 > c

200 Performance Problems Many mutation operators possible Proteum Mutation Operators for C MuJava - Adds 24 Class level Mutation Operators Each mutation operator results in many mutants Depending on program under test Each mutant needs to be compiled Each test case needs to be executed against every mutant

201 Improvements Do fewer Do smarter Do faster Mutant sampling Selective mutation Parallelize Weak mutation Use coverage Impact Mutate bytecode Mutant schemata

202 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene Using Coverage (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4) (0, 1, 1) (4, 3, 2) (1, 1, 1) (2, 3, 2)

203 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene Using Coverage (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4) (0, 1, 1) (4, 3, 2) (1, 1, 1) (2, 3, 2)

204 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene Using Coverage (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4) (0, 1, 1) (4, 3, 2) (1, 1, 1) (2, 3, 2)

205 int triangle(int a, int b, int c) { if (a <= 0 b <= 0 c <= 0) { if (! (a + b > c && a + c > b && b + c > a)) { if (a == b && b == c) { return 1; // equilateral if (a == b b == c a == c) { return 2; // isosceles return 3; // scalene Using Coverage Only these tests execute mutants in this line! (0, 0, 0) (1, 1, 3) (2, 2, 2) (2, 2, 3) (2, 3, 4) (0, 1, 1) (4, 3, 2) (1, 1, 1) (2, 3, 2)

206 Strong vs. Weak Mutation Strong mutation Mutation has propagated to some observable behavior Weak mutation Mutation has affected state (infection) Compare internal state after mutation Does not guarantee propagation Reported to save 50% execution time

207 Strong vs. Weak Mutation int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x * y; x = y; y = tmp; return x; return x;

208 Strong vs. Weak Mutation int gcd(int x, int y) { int tmp; int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; while(y!= 0) { tmp = x * y; x = y; y = tmp; return x; Strong mutation return x;

209 Strong vs. Weak Mutation int gcd(int x, int y) { int tmp; int gcd(int x, int y) { int tmp; while(y!= 0) { tmp = x % y; x = y; y = tmp; return x; Weak mutation Strong mutation while(y!= 0) { tmp = x * y; x = y; y = tmp; return x;

210 Mutant Schemata

211 Mutant Schemata + <

212 Mutant Schemata + Mutant 1: Compile Execute <

213 Mutant Schemata + Mutant 1: Compile Execute Mutant 2: Compile Execute <

214 Mutant Schemata + Mutant 1: Compile Execute Mutant 2: Compile Execute < Mutant 3: Compile Execute

215 Mutant Schemata + Mutant 1: Compile Execute Mutant 2: Compile Execute < Mutant 3: Compile Execute

216 Mutant Schemata < + Mutant 1: Compile Execute Mutant 2: Compile Execute Mutant 3: Compile Execute < +

217 Mutant Schemata + < + < Mutant 1: Compile Execute Mutant 2: Compile Execute Mutant 3: Compile Execute Meta-Mutant: Compile Switch on Mutant 1 Execute Switch on Mutant 2 Execute Switch on Mutant 3 Execute

218 Mutant Schemata a + b > c arithop(a, b, 42) > c

219 Mutant Schemata a + b > c arithop(a, b, 42) > c

220 Mutant Schemata a + b > c arithop(a, b, 42) > c int arithop(int op1, int op2, int location) { switch(variant(location)) { case aoadd: return op1 + op2; case aosub: return op1 - op2; case aomult: return op1 * op2; case aodiv: case aomod: return op1 / op2; return op1 % op2; case aoleft: return op1; case aoright: return op2;

221 Mutant Schemata a + b > c arithop(a, b, 42) > c int arithop(int op1, int op2, int location) { switch(variant(location)) { case aoadd: return op1 + op2; case aosub: return op1 - op2; case aomult: return op1 * op2; case aodiv: case aomod: return op1 / op2; return op1 % op2; case aoleft: return op1; case aoright: return op2; Select active

222 Selective Mutation

223 Selective Mutation Full Set: Test cases that kill all mutants

224 Selective Mutation Full Set: Test cases that kill all mutants Sufficient Subset: Test cases that kill these mutants will kill all mutants

225 Selective Mutation Use only a subset of mutation operators instead of all operators Subset is sufficient Detecting mutants of sufficient subset will detect >99% of all mutants ABS, AOR, COR, ROR, UOI

226 Do Smarter/Faster

227 Do Smarter/Faster Mutation testing is inherently parallelizable

228 Do Smarter/Faster Mutation testing is inherently parallelizable 6: iload_1 // a 7: ifeq 14 10: iload_2 // b 11: ifne 23 14: iload_3 // c 15: ifeq 34 //... 23: invokevirtual #4; //... 34: invokevirtual #5; Mutating bytecode avoids recompilation

229 Do Smarter/Faster Mutation testing is inherently parallelizable 6: iload_1 // a 7: ifeq 14 10: iload_2 // b 11: ifne 23 14: iload_3 // c 15: ifeq 34 //... 23: invokevirtual #4; //... 34: invokevirtual #5; Sample subset of mutants Mutating bytecode avoids recompilation

COMP 3705 Advanced Software Engineering: Software Testing

COMP 3705 Advanced Software Engineering: Software Testing COMP 3705 Advanced Software Engineering: Software Testing Prof. Matt Rutherford Class 09-2009-03-02 (c) 2009 Matthew J. Rutherford For Next Week Readings Chapters 7 and 9 Homework #8 See website Class

More information

AN EVALUATION OF MUTATION OPERATORS FOR EQUIVALENT MUTANTS. Maryam Umar

AN EVALUATION OF MUTATION OPERATORS FOR EQUIVALENT MUTANTS. Maryam Umar AN EVALUATION OF MUTATION OPERATORS FOR EQUIVALENT MUTANTS By Maryam Umar Supervised By Mark Harman A project submitted to the Department of Computer Science. King s College, London. In partial fulfilment

More information

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M.

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M. F. Tip and M. Weintraub STRUCTURAL TESTING AKA White Box Testing Thanks go to Andreas Zeller for allowing incorporation of his materials STRUCTURAL TESTING Testing based on the structure of the code Test

More information

Structural Testing. (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1

Structural Testing. (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1 Structural Testing (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1 Learning objectives Understand rationale for structural testing How structural (code-based or glass-box) testing complements functional

More information

What is software testing? Software testing is designing, executing and evaluating test cases in order to detect faults.

What is software testing? Software testing is designing, executing and evaluating test cases in order to detect faults. ϖοιδ τεσταδδανδχουντ() { ασσερ τεθυαλσ(1, ο.αδδανδχουντ(νεω ΑρραψΛιστ()); ϖοιδ τεσταδδανδχουντ() { ασσερ τεθυαλσ(1, ο.αδδανδχουντ(νεω ΑρραψΛιστ()); ιντ αδδανδχουντ(λιστ λιστ) { ρετυρν λιστ.σιζε(); ιντ

More information

What is Mutation Testing? Mutation Testing. Test Case Adequacy. Mutation Testing. Mutant Programs. Example Mutation

What is Mutation Testing? Mutation Testing. Test Case Adequacy. Mutation Testing. Mutant Programs. Example Mutation What is Mutation Testing? Mutation Testing Breaking the application to test it n Mutation Testing is a testing technique that focuses on measuring the adequacy of test cases n Mutation Testing is NOT a

More information

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M.

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M. F. Tip and M. Weintraub STRUCTURAL TESTING AKA White Box Testing Thanks go to Andreas Zeller for allowing incorporation of his materials STRUCTURAL TESTING Testing based on the structure of the code Test

More information

Part I: Preliminaries 24

Part I: Preliminaries 24 Contents Preface......................................... 15 Acknowledgements................................... 22 Part I: Preliminaries 24 1. Basics of Software Testing 25 1.1. Humans, errors, and testing.............................

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 03: White-Box Testing (Textbook Ch. 5) Spring 2013 Dietmar Pfahl email: dietmar.pfahl@ut.ee Lecture Chapter 5 White-box testing techniques (Lab 3) Structure of Lecture

More information

Program-based Mutation Testing

Program-based Mutation Testing Program-based Mutation Testing CS 4501 / 6501 Software Testing [Ammann and Offutt, Introduction to Software Testing, Ch. 9.2] 1 Applying Syntax-Based Testing to Programs Test requirements are derived from

More information

DRAFT: Prepublication draft, Fall 2014, George Mason University Redistribution is forbidden without the express permission of the authors

DRAFT: Prepublication draft, Fall 2014, George Mason University Redistribution is forbidden without the express permission of the authors Chapter 9 Syntax-based Testing Date last generated: September 29, 2014. DRAFT: Prepublication draft, Fall 2014, George Mason University Redistribution is forbidden without the express permission of the

More information

Subject Software Testing Structural Testing

Subject Software Testing Structural Testing Subject Software Testing Structural Testing Objective: 1. Understand Concept of structural testing 2. How structural (code-based or glass-box) testing complements functional (black-box) testing 3. Recognize

More information

Lecture 7. Advanced Topics in Tes3ng

Lecture 7. Advanced Topics in Tes3ng Lecture 7 Advanced Topics in Tes3ng Muta3on Tes3ng Muta3on tes3ng concerns evalua3ng test suites for their inherent quality, i.e. ability to reveal errors. Need an objec3ve method to determine quality

More information

Software Testing. 1. Testing is the process of demonstrating that errors are not present.

Software Testing. 1. Testing is the process of demonstrating that errors are not present. What is Testing? Software Testing Many people understand many definitions of testing :. Testing is the process of demonstrating that errors are not present.. The purpose of testing is to show that a program

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 04: White-Box Testing (advanced) Part1 Dietmar Pfahl Spring 2018 email: dietmar.pfahl@ut.ee White-Box Testing Techniques Control-Flow Testing Data-Flow Testing Mutation

More information

Test Oracles and Mutation Testing. CSCE Lecture 23-11/18/2015

Test Oracles and Mutation Testing. CSCE Lecture 23-11/18/2015 Test Oracles and Mutation Testing CSCE 740 - Lecture 23-11/18/2015 Software Testing - Back to the Basics Tests are sequences of stimuli and observations. We care about input and output. (I 1 O 1 ) (I 2

More information

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box From Pressman, Software Engineering a practitioner s approach, Chapter 14 and Pezze + Young, Software Testing and Analysis, Chapters 12-13 Structural Testing Software Engineering Andreas Zeller Saarland

More information

Testing Tactics. Structural Testing. Why Structural? Why Structural? Functional black box. Structural white box. Functional black box

Testing Tactics. Structural Testing. Why Structural? Why Structural? Functional black box. Structural white box. Functional black box ing Tactics Structural ing Functional black box Structural white box Software Engineering Andreas Zeller Saarland University s based on spec covers as much specified behavior as possible s based on code

More information

Coverage-Guided Fuzzing

Coverage-Guided Fuzzing Coverage-Guided Fuzzing Dynamic Coverage Static Structure Security Testing Andreas Zeller, Saarland University Smart Algorithms Our Goal We want to cause the program to fail We have seen random (unstructured)

More information

Mutation-based Generation of Tests and Oracles. Gordon Fraser and Andreas Zeller Saarland University, Germany

Mutation-based Generation of Tests and Oracles. Gordon Fraser and Andreas Zeller Saarland University, Germany Mutation-based Generation of Tests and Oracles Gordon Fraser and Andreas Zeller Saarland University, Germany LocalDate date = new LocalDate(2010, 7, 15); date.plusyears(1); assertequals(date.getyear(),

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Investigating Faults Missed by Test Suites Achieving High Code Coverage

Investigating Faults Missed by Test Suites Achieving High Code Coverage Investigating Faults Missed by Test Suites Achieving High Code Coverage Amanda Schwartz, Daniel Puckett University of South Carolina Upstate aschwar2@uscupstate.edu,dpuckett@email.uscupstate.edu Ying Meng,

More information

https://www.lri.fr/ linaye/gl.html

https://www.lri.fr/ linaye/gl.html Software Engineering https://www.lri.fr/ linaye/gl.html lina.ye@centralesupelec.fr Sequence 3, 2017-2018 1/61 Software Engineering Plan 1 2 3 4 5 2/61 Software Engineering Software Testing 3/61 Software

More information

Mutation Testing. Tacoma Narrows Bridge also known as Galloping Gertie. Learning from Mistakes

Mutation Testing. Tacoma Narrows Bridge also known as Galloping Gertie. Learning from Mistakes Mutation Testing Andreas Zeller 1 Tacoma Narrows Bridge also known as Galloping Gertie 2 The Tacoma Narrows Bridge is a pair of mile-long (1600 meter) suspension bridges with main spans of 2800 feet (850

More information

Introduction to Software Testing Chapter 5.1 Syntax-based Testing

Introduction to Software Testing Chapter 5.1 Syntax-based Testing Introduction to Software Testing Chapter 5.1 Syntax-based Testing Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/ softwaretest/ Ch. 5 : Syntax Coverage Four Structures for Modeling Software Graphs

More information

How to give a good research talk. Andreas Zeller

How to give a good research talk. Andreas Zeller How to give a good research talk Andreas Zeller Goals of the Seminar Find your way into scientific cha!enges! Structure and present scientific material" Train your social and communication skills The Purpose

More information

What is Mutation Testing?

What is Mutation Testing? What is Mutation Testing? The premise in mutation testing is that small changes are made in a module and then the original and mutant modules are compared. Similar idea to error seeding: introduce defects

More information

MAJOR: An Efficient and Extensible Tool for Mutation Analysis in a Java Compiler

MAJOR: An Efficient and Extensible Tool for Mutation Analysis in a Java Compiler MAJOR: An Efficient and Extensible Tool for Mutation Analysis in a Java Compiler René Just 1, Franz Schweiggert 1, and Gregory M. Kapfhammer 2 1 Ulm University, Germany 2 Allegheny College, USA 26th International

More information

Testing & Symbolic Execution

Testing & Symbolic Execution Testing & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed Behavior

More information

Object Oriented Mutation Applied in Java Application programming Interface and C++ Classes

Object Oriented Mutation Applied in Java Application programming Interface and C++ Classes Object Oriented Mutation Applied in Java Application programming Interface and C++ Classes Titu Singh Arora 1, Ravindra Gupta 2 M.Tech Scholar, Department of Computer Science, SSSIST Sehore, India 1 Professor

More information

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING 1 CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING Outline 2 Quiz Black-Box Testing Equivalence Class Testing (Equivalence Partitioning) Boundary value analysis Decision Table Testing 1 3 Quiz - 1

More information

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

More information

Quality Assurance in Software Development

Quality Assurance in Software Development Quality Assurance in Software Development Qualitätssicherung in der Softwareentwicklung A.o.Univ.-Prof. Dipl.-Ing. Dr. Bernhard Aichernig Graz University of Technology Austria Summer Term 2017 1 / 47 Agenda

More information

Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt

Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt www.introsoftwaretesting.com OO Software and Designs Emphasis on modularity and reuse puts complexity

More information

Introduction. Easy to get started, based on description of the inputs

Introduction. Easy to get started, based on description of the inputs Introduction Testing is about choosing elements from input domain. The input domain of a program consists of all possible inputs that could be taken by the program. Easy to get started, based on description

More information

Introduction to Dynamic Analysis

Introduction to Dynamic Analysis Introduction to Dynamic Analysis Reading assignment Gary T. Leavens, Yoonsik Cheon, "Design by Contract with JML," draft paper, http://www.eecs.ucf.edu/~leavens/jml//jmldbc.pdf G. Kudrjavets, N. Nagappan,

More information

Software Quality Assurance Dynamic Test

Software Quality Assurance Dynamic Test Software Quality Assurance Dynamic Test Contents Properties and goals Structural testing Control flow testing Data flow testing Functional test Diversified test 2 Properties and Goals Properties of dynamic

More information

Introduction to Software Testing Chapter 3, Sec# 3.3 Logic Coverage for Source Code

Introduction to Software Testing Chapter 3, Sec# 3.3 Logic Coverage for Source Code Introduction to Software Testing Chapter 3, Sec# 3.3 Logic Coverage for Source Code Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/soft waretest/ Logic Expressions from Source Predicates are derived

More information

CMPSCI 521/621 Homework 2 Solutions

CMPSCI 521/621 Homework 2 Solutions CMPSCI 521/621 Homework 2 Solutions Problem 1 Direct data dependencies: 3 is directly data dependent on 1 and 5 5 is directly data dependent on 1,3, and 5 7 is directly data dependent on 1,3, and 5 Note,

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

11 Using JUnit with jgrasp

11 Using JUnit with jgrasp 11 Using JUnit with jgrasp jgrasp includes an easy to use plug-in for the JUnit testing framework. JUnit provides automated support for unit testing of Java source code, and its utility has made it a de

More information

Inheritance and Encapsulation. Amit Gupta

Inheritance and Encapsulation. Amit Gupta Inheritance and Encapsulation Amit Gupta Project 1 How did it go? What did you like about it? What did you not like? What can we do to help? Suggestions Ask questions if you don t understand a concept

More information

Question Bank. Unit 1: Perspective on Testing, Examples. Chapter 1 & 2 from Dr. Paul C. Jorgensen

Question Bank. Unit 1: Perspective on Testing, Examples. Chapter 1 & 2 from Dr. Paul C. Jorgensen Unit 1: Perspective on Testing, Examples Chapter 1 & 2 from Dr. Paul C. Jorgensen Sl no Question Description 1. Make a Venn Diagram that reflects a part of the following statement: we have left undone

More information

An Introduction to Systematic Software Testing. Robert France CSU

An Introduction to Systematic Software Testing. Robert France CSU An Introduction to Systematic Software Testing Robert France CSU Why do we need to systematically test software? Poor quality products can Inconvenience direct and indirect users Result in severe financial

More information

Testing, Fuzzing, & Symbolic Execution

Testing, Fuzzing, & Symbolic Execution Testing, Fuzzing, & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed

More information

CS 520 Theory and Practice of Software Engineering Fall 2018

CS 520 Theory and Practice of Software Engineering Fall 2018 Today CS 52 Theory and Practice of Software Engineering Fall 218 Software testing October 11, 218 Introduction to software testing Blackbox vs. whitebox testing Unit testing (vs. integration vs. system

More information

Software Testing and Analysis Process, Principles, and Techniques

Software Testing and Analysis Process, Principles, and Techniques Summary Software Testing and Analysis Process, Principles, and Techniques JUNBEOM YOO Dependable Software Laboratory KONKUK University http://dslab.konkuk.ac.kr Ver. 1.0 (2012.11) This lecture note is

More information

Computer Science II (20073) Week 1: Review and Inheritance

Computer Science II (20073) Week 1: Review and Inheritance Computer Science II 4003-232-01 (20073) Week 1: Review and Inheritance Richard Zanibbi Rochester Institute of Technology Review of CS-I Hardware and Software Hardware Physical devices in a computer system

More information

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development Reveal faults Goals of testing Correctness Reliability Usability Robustness Performance Top-down/Bottom-up Bottom-up Lowest level modules tested first Don t depend on any other modules Driver Auxiliary

More information

Induction and Semantics in Dafny

Induction and Semantics in Dafny 15-414 Lecture 11 1 Instructor: Matt Fredrikson Induction and Semantics in Dafny TA: Ryan Wagner Encoding the syntax of Imp Recall the abstract syntax of Imp: a AExp ::= n Z x Var a 1 + a 2 b BExp ::=

More information

Static Semantics. Winter /3/ Hal Perkins & UW CSE I-1

Static Semantics. Winter /3/ Hal Perkins & UW CSE I-1 CSE 401 Compilers Static Semantics Hal Perkins Winter 2009 2/3/2009 2002-09 Hal Perkins & UW CSE I-1 Agenda Static semantics Types Symbol tables General ideas for now; details later for MiniJava project

More information

Structural Testing & Mutation

Structural Testing & Mutation Structural Testing & Mutation Filippo Ricca DISI, Università di Genova, Italy ricca@disi.unige.it 1 White vs. Black box testing A white box testing is based upon explicit knowledge of the SUT and its structure

More information

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan heory Lecture Plan 2 esting heory Lecture 8 Software Engineering DDC88/DDC93 autumn 28 Department of Computer and Information Science Linköping University, Sweden L - Course Introduction and Overview L2

More information

PESIT Bangalore South Campus SOLUTION

PESIT Bangalore South Campus SOLUTION USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Information Science & Engineering INTERNAL ASSESSMENT TEST 2 Date : 02/04/2018 Max Marks: 40

More information

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Yan Shi SE 2730 Lecture Notes Verification and Validation Verification: Are

More information

Software Quality Assurance. David Janzen

Software Quality Assurance. David Janzen Software Quality Assurance David Janzen What is quality? Crosby: Conformance to requirements Issues: who establishes requirements? implicit requirements Juran: Fitness for intended use Issues: Who defines

More information

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany Softwaretechnik Lecture 08: Testing and Debugging Overview Peter Thiemann University of Freiburg, Germany SS 2012 Literature Essential Reading Why Programs Fail: A Guide to Systematic Debugging, A Zeller

More information

Lecture 18: Structure-based Testing

Lecture 18: Structure-based Testing Test Case First Strategy White box testing: Statement Coverage Branch Coverage Condition Coverage Data Path Coverage Lecture 18: Structure-based Testing Testing with good and bad data Testing Object Oriented

More information

On Guiding the Augmentation of an Automated Test Suite via Mutation Analysis

On Guiding the Augmentation of an Automated Test Suite via Mutation Analysis On Guiding the Augmentation of an Automated Test Suite via Mutation Analysis Abstract Mutation testing has traditionally been used as a defect injection technique to assess the effectiveness of a test

More information

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box From Pressman, Software Engineering a practitioner s approach, Chapter 14 and Pezze + Young, Software Testing and Analysis, Chapters 12-13 Structural Testing Software Engineering Andreas Zeller Saarland

More information

CS260 Intro to Java & Android 03.Java Language Basics

CS260 Intro to Java & Android 03.Java Language Basics 03.Java Language Basics http://www.tutorialspoint.com/java/index.htm CS260 - Intro to Java & Android 1 What is the distinction between fields and variables? Java has the following kinds of variables: Instance

More information

3. Design by Contract

3. Design by Contract 3. Design by Contract Oscar Nierstrasz Design by Contract Bertrand Meyer, Touch of Class Learning to Program Well with Objects and Contracts, Springer, 2009. 2 Roadmap > Contracts > Stacks > Design by

More information

Name Return type Argument list. Then the new method is said to override the old one. So, what is the objective of subclass?

Name Return type Argument list. Then the new method is said to override the old one. So, what is the objective of subclass? 1. Overriding Methods A subclass can modify behavior inherited from a parent class. A subclass can create a method with different functionality than the parent s method but with the same: Name Return type

More information

Logic Coverage from Source Code

Logic Coverage from Source Code Logic Coverage from Source Code Moonzoo Kim School of Computing KAIST The original slides are taken from Chap. 8 of Intro. to SW Testing 2 nd ed by Ammann and Offutt Logic Expressions from Source Predicates

More information

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Lecture 8 Overview of software testing Wednesday Feb 8, 2012 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/53 Lecture outline Testing in general Unit testing

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Combining Complementary Formal Verification Strategies to Improve Performance and Accuracy

Combining Complementary Formal Verification Strategies to Improve Performance and Accuracy Combining Complementary Formal Verification Strategies to Improve Performance and Accuracy David Owen June 15, 2007 2 Overview Four Key Ideas A Typical Formal Verification Strategy Complementary Verification

More information

Leveraging Program Equivalence for Adaptive Program Repair: Models and First Results. Westley Weimer, UVA Zachary P. Fry, UVA Stephanie Forrest, UNM

Leveraging Program Equivalence for Adaptive Program Repair: Models and First Results. Westley Weimer, UVA Zachary P. Fry, UVA Stephanie Forrest, UNM Leveraging Program Equivalence for Adaptive Program Repair: Models and First Results Westley Weimer, UVA Zachary P. Fry, UVA Stephanie Forrest, UNM Automated Program Repair Given a program, a notion of

More information

Introduction to Programming (Java) 2/12

Introduction to Programming (Java) 2/12 Introduction to Programming (Java) 2/12 Michal Krátký Department of Computer Science Technical University of Ostrava Introduction to Programming (Java) 2008/2009 c 2006 2008 Michal Krátký Introduction

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 20, 2014 Abstract

More information

On Guiding the Augmentation of an Automated Test Suite via Mutation Analysis

On Guiding the Augmentation of an Automated Test Suite via Mutation Analysis On Guiding the Augmentation of an Automated Test Suite via Mutation Analysis Abstract Mutation testing has traditionally been used as a defect injection technique to assess the effectiveness of a test

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Introduction History, Characteristics of Java language Java Language Basics Data types, Variables, Operators and Expressions Anatomy of a Java Program

More information

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs.

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs. Local Variable Initialization Unlike instance vars, local vars must be initialized before they can be used. Eg. void mymethod() { int foo = 42; int bar; bar = bar + 1; //compile error bar = 99; bar = bar

More information

Prasanth Kumar K(Head-Dept of Computers)

Prasanth Kumar K(Head-Dept of Computers) B.Sc (Computer Science) Object Oriented Programming with Java and Data Structures Unit-II 1 1. Define operator. Explain the various operators in Java. (Mar 2010) (Oct 2011) Java supports a rich set of

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 21, 2013 Abstract

More information

Introduction to Software Testing Chapter 4 Input Space Partition Testing

Introduction to Software Testing Chapter 4 Input Space Partition Testing Introduction to Software Testing Chapter 4 Input Space Partition Testing Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/ softwaretest/ Ch. 4 : Input Space Coverage Four Structures for Modeling

More information

Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of

Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of Coverage/Model Based Testing Will Not Cover Statistical Methods Partition

More information

Programming Language Concepts: Lecture 2

Programming Language Concepts: Lecture 2 Programming Language Concepts: Lecture 2 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 2, 19 January 2009 Classes and

More information

CS304 Object Oriented Programming Final Term

CS304 Object Oriented Programming Final Term 1. Which of the following is the way to extract common behaviour and attributes from the given classes and make a separate class of those common behaviours and attributes? Generalization (pg 29) Sub-typing

More information

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ Unit Testing. Emina Torlak

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ Unit Testing. Emina Torlak CSE 403: Software Engineering, Fall 2016 courses.cs.washington.edu/courses/cse403/16au/ Unit Testing Emina Torlak emina@cs.washington.edu Outline Software quality control Effective unit testing Coverage

More information

SOQUA Automated Generation and Evaluation of Dataflow-based Test Data for Object-Oriented Software. Norbert Oster

SOQUA Automated Generation and Evaluation of Dataflow-based Test Data for Object-Oriented Software. Norbert Oster Automated Generation and Evaluation of Dataflow-based Test Data for Object-Oriented Software (Germany) (Informatik 11) SOQUA 2005 page 1 page 2 Agenda Motivation and goal Introduction to dataflow based

More information

Overview Graph Coverage Criteria

Overview Graph Coverage Criteria Overview Graph Coverage Criteria Graph Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Applied to Applied to Source FSMs Applied to Specs DNF Source Specs Source Models Design

More information

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany Softwaretechnik Lecture 08: Testing and Debugging Overview Peter Thiemann University of Freiburg, Germany SS 2012 Literature Essential Reading Why Programs Fail: A Guide to Systematic Debugging, A Zeller

More information

CS 376b Computer Vision

CS 376b Computer Vision CS 376b Computer Vision 09 / 25 / 2014 Instructor: Michael Eckmann Today s Topics Questions? / Comments? Enhancing images / masks Cross correlation Convolution C++ Cross-correlation Cross-correlation involves

More information

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner.

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner. HAS-A Relationship Association is a relationship where all objects have their own lifecycle and there is no owner. For example, teacher student Aggregation is a specialized form of association where all

More information

Data Flow Testing. CSCE Lecture 10-02/09/2017

Data Flow Testing. CSCE Lecture 10-02/09/2017 Data Flow Testing CSCE 747 - Lecture 10-02/09/2017 Control Flow Capture dependencies in terms of how control passes between parts of a program. We care about the effect of a statement when it affects the

More information

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1 Agenda CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Summer 2004 Java virtual machine architecture.class files Class loading Execution engines Interpreters & JITs various strategies

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

The Major Mutation Framework

The Major Mutation Framework The Major Mutation Framework Version 1.3.2 May 31, 2017 Contents 1 Overview 3 1.1 Installation.................................... 3 1.2 How to get started................................ 4 2 Step by Step

More information

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe OBJECT ORIENTED PROGRAMMING USING C++ CSCI 5448- Object Oriented Analysis and Design By Manali Torpe Fundamentals of OOP Class Object Encapsulation Abstraction Inheritance Polymorphism Reusability C++

More information

1,000 Testers in a Shoe Box Advances in Automated Test Generation Andreas Zeller Saarland University, Saarbrücken, Germany

1,000 Testers in a Shoe Box Advances in Automated Test Generation Andreas Zeller Saarland University, Saarbrücken, Germany 1,000 Testers in a Shoe Box Advances in Automated Test Generation Andreas Zeller Saarland University, Saarbrücken, Germany Visual Computing Institute Center for Information Security, Privacy and Accountability

More information

Bacterio 3.0: a Mutation Tool for Multi-Class Java Systems

Bacterio 3.0: a Mutation Tool for Multi-Class Java Systems Bacterio 3.0: a Mutation Tool for Multi-Class Java Systems Pedro Reales Mateo, Macario Polo Usaola Alarcos Research Group Department of Information Systems and Technologies University of Castilla-La Mancha

More information

Model Counting with Applications to CodeHunt

Model Counting with Applications to CodeHunt Model Counting with Applications to CodeHunt Willem Visser Stellenbosch University South Africa CodeHunt is built on Model Counting SAT or UNSAT? And Some solutions # SAT solutions? Can we use this for

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

White Box Testing III

White Box Testing III White Box Testing III Outline Today we continue our look at white box testing methods, with mutation testing We will look at : definition and role of mutation testing what is a mutation? how is mutation

More information

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides 1B1b Inheritance Agenda Introduction to inheritance. How Java supports inheritance. Inheritance is a key feature of object-oriented oriented programming. 1 2 Inheritance Models the kind-of or specialisation-of

More information

CMPT 115. C tutorial for students who took 111 in Java. University of Saskatchewan. Mark G. Eramian, Ian McQuillan CMPT 115 1/32

CMPT 115. C tutorial for students who took 111 in Java. University of Saskatchewan. Mark G. Eramian, Ian McQuillan CMPT 115 1/32 CMPT 115 C tutorial for students who took 111 in Java Mark G. Eramian Ian McQuillan University of Saskatchewan Mark G. Eramian, Ian McQuillan CMPT 115 1/32 Part I Starting out Mark G. Eramian, Ian McQuillan

More information