Searching for the Best Tests An Introduction to Automated Software - - PowerPoint PPT Presentation

searching for the best tests
SMART_READER_LITE
LIVE PREVIEW

Searching for the Best Tests An Introduction to Automated Software - - PowerPoint PPT Presentation

Searching for the Best Tests An Introduction to Automated Software Testing with Search-Based Techniques Gregory M. Kapfhammer Department of Computer Science Allegheny College March 31, 2015 Software is Everywhere Software is


slide-1
SLIDE 1

“Searching” for the Best Tests

An Introduction to Automated Software Testing with Search-Based Techniques

Gregory M. Kapfhammer

Department of Computer Science Allegheny College March 31, 2015

slide-2
SLIDE 2

Software is Everywhere

Software is pervasive — and so it must be thoroughly tested! Computer Server Program

slide-3
SLIDE 3

Software is Everywhere

Software is pervasive — and so it must be thoroughly tested! Computer Server Program Computer Server Program Desktop Computer Program

slide-4
SLIDE 4

Software is Everywhere

Software is pervasive — and so it must be thoroughly tested! Computer Server Program Computer Server Program Desktop Computer Program Desktop Computer Program Mobile Computer Program

slide-5
SLIDE 5

Software is Everywhere

Software is pervasive — and so it must be thoroughly tested! Computer Server Program Computer Server Program Desktop Computer Program Desktop Computer Program Mobile Computer Program Mobile Computer Program Household Appliance Program

slide-6
SLIDE 6

Software is Everywhere

Software is pervasive — and so it must be thoroughly tested! Computer Server Program Computer Server Program Desktop Computer Program Desktop Computer Program Mobile Computer Program Mobile Computer Program Household Appliance Program Scientific Device Program Household Appliance Program

slide-7
SLIDE 7

Software is Everywhere

Software is pervasive — and so it must be thoroughly tested! Computer Server Program Computer Server Program Desktop Computer Program Desktop Computer Program Mobile Computer Program Mobile Computer Program Household Appliance Program Scientific Device Program Household Appliance Program Network Router Program Scientific Device Program

slide-8
SLIDE 8

Software is Complex

Even simple programs are intricate — and difficult to test! Computer Software

slide-9
SLIDE 9

Software is Complex

Even simple programs are intricate — and difficult to test! Computer Software Lines of Code

slide-10
SLIDE 10

Software is Complex

Even simple programs are intricate — and difficult to test! Computer Software Lines of Code Numerous Features

slide-11
SLIDE 11

Software is Complex

Even simple programs are intricate — and difficult to test! Computer Software Lines of Code Numerous Features Feature Interactions

slide-12
SLIDE 12

Software is Complex

Even simple programs are intricate — and difficult to test! Computer Software Lines of Code Numerous Features Feature Interactions Runtime Environs

slide-13
SLIDE 13

Software is Complex

Even simple programs are intricate — and difficult to test! Computer Software Lines of Code Numerous Features Feature Interactions Runtime Environs “Software entities are more complex for their size than perhaps any other hu- man construct” — Frederick P. Brooks, Jr.

slide-14
SLIDE 14

Software is Evolving

Software is continuously updated — making testing critical! Execution Environment Program

slide-15
SLIDE 15

Software is Evolving

Software is continuously updated — making testing critical! Execution Environment Program Execution Environment Program

slide-16
SLIDE 16

Software is Evolving

Software is continuously updated — making testing critical! Execution Environment Program Execution Environment Program Program Changed because of the addition

  • f a new feature or the correction of a defect
slide-17
SLIDE 17

Software is Evolving

Software is continuously updated — making testing critical! Execution Environment Program Execution Environment Program

slide-18
SLIDE 18

Software is Evolving

Software is continuously updated — making testing critical! Execution Environment Program Execution Environment Program Execution Environment Program

slide-19
SLIDE 19

Software is Evolving

Software is continuously updated — making testing critical! Execution Environment Program Execution Environment Program Execution Environment Program Execution Environment Changed due to an up- grade in a kernel, device driver, or virtual machine

slide-20
SLIDE 20

Software is Evolving

Software is continuously updated — making testing critical! Execution Environment Program Execution Environment Program Execution Environment Program Execution Environment Changed due to an up- grade in a kernel, device driver, or virtual machine “Release early, release often” means that programs are regularly updated

slide-21
SLIDE 21

Motivating Example

The computation of an object’s velocity presents challenges!

K = 1 2 m × v2

slide-22
SLIDE 22

Motivating Example

The computation of an object’s velocity presents challenges!

K = 1 2 m × v2

slide-23
SLIDE 23

Motivating Example

The computation of an object’s velocity presents challenges!

K = 1 2 m × v2

slide-24
SLIDE 24

Motivating Example

The computation of an object’s velocity presents challenges!

K = 1 2 m × v2

slide-25
SLIDE 25

Computing Velocity

public static String computeVelocity(int kinetic, int mass) { int velocitySquared = 0; int velocity = 0; StringBuffer finalVelocity = new StringBuffer(); if( mass != 0 ) { velocitySquared = 3 * (kinetic / mass); velocity = (int)Math.sqrt(velocitySquared); finalVelocity.append(velocity); } else { finalVelocity.append("Undefined"); } return finalVelocity.toString(); }

slide-26
SLIDE 26

Important Questions

Finding software defects is a challenging and rewarding task

Can you find the defect in this program?

slide-27
SLIDE 27

Important Questions

Finding software defects is a challenging and rewarding task

Are there general purpose strategies for defect isolation?

slide-28
SLIDE 28

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-29
SLIDE 29

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-30
SLIDE 30

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-31
SLIDE 31

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-32
SLIDE 32

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test

slide-33
SLIDE 33

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Input

slide-34
SLIDE 34

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Input Output

slide-35
SLIDE 35

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up

slide-36
SLIDE 36

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input

slide-37
SLIDE 37

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output

slide-38
SLIDE 38

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output Test Clean Up

slide-39
SLIDE 39

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output Test Clean Up Test Oracle

slide-40
SLIDE 40

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output Test Clean Up Test Oracle Expected Output

slide-41
SLIDE 41

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output Test Clean Up Test Oracle Expected Output Test Verdict

slide-42
SLIDE 42

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output Test Clean Up Test Oracle Expected Output Test Verdict Expected Output Output

slide-43
SLIDE 43

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output Test Clean Up Test Oracle Expected Output Test Verdict Expected Output Output Test Verdict The test case passes and the code is correct!

slide-44
SLIDE 44

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output Test Clean Up Test Oracle Expected Output Test Verdict Expected Output Output

slide-45
SLIDE 45

What is a Test Case?

A test case calls a method and checks its output with an oracle Method Un- der Test Test Set Up Input Output Test Clean Up Test Oracle Expected Output Test Verdict Expected Output Output Test Verdict The test case fails and a defect is found!

slide-46
SLIDE 46

What is a Test Suite?

A test suite is an organized collection of test cases T1

slide-47
SLIDE 47

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2

slide-48
SLIDE 48

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3

slide-49
SLIDE 49

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3 T4

slide-50
SLIDE 50

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3 T4 . . .

slide-51
SLIDE 51

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3 T4 . . . Tn

slide-52
SLIDE 52

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3 T4 . . . Tn Organize the Test Cases into a Test Suite

slide-53
SLIDE 53

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3 T4 . . . Tn Organize the Test Cases into a Test Suite Tool Support for Software Testing?

slide-54
SLIDE 54

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3 T4 . . . Tn Organize the Test Cases into a Test Suite Tool Support for Software Testing? JUnit

slide-55
SLIDE 55

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3 T4 . . . Tn Organize the Test Cases into a Test Suite Tool Support for Software Testing? JUnit Apache Ant

slide-56
SLIDE 56

What is a Test Suite?

A test suite is an organized collection of test cases T1 T2 T3 T4 . . . Tn Organize the Test Cases into a Test Suite Tool Support for Software Testing? JUnit Apache Ant Eclipse

slide-57
SLIDE 57

A JUnit Test Case

@Test public void testOne() { String expected = new String("Undefined"); String actual = Kinetic. computeVelocity(5,0); assertEquals(expected, actual); }

slide-58
SLIDE 58

Another JUnit Test

@Test public void testTwo() { String expected = new String("0"); String actual = Kinetic. computeVelocity(0,5); assertEquals(expected, actual); }

slide-59
SLIDE 59

Important Questions

Not all tests have the same fault detection effectiveness!

Will these test cases find the fault in the example program?

slide-60
SLIDE 60

Important Questions

Not all tests have the same fault detection effectiveness!

T1 assigns K = 5, m = 0 — Pass or fail?

slide-61
SLIDE 61

Important Questions

Not all tests have the same fault detection effectiveness!

T2 assigns K = 0, m = 5 — Pass or fail?

slide-62
SLIDE 62

Important Questions

Not all tests have the same fault detection effectiveness!

How do we study the effectiveness of different test cases?

slide-63
SLIDE 63

The PIE Model

There are necessary and sufficient conditions for fault detection

◮ Execute the faulty source code ◮ Infect the program’s data state ◮ Propagate to the program’s output

All of these must occur before the fault manifests itself as a failure! Using PIE, will the test cases find the defect in the program?

slide-64
SLIDE 64

The PIE Model

There are necessary and sufficient conditions for fault detection

◮ Execute the faulty source code ◮ Infect the program’s data state ◮ Propagate to the program’s output

All of these must occur before the fault manifests itself as a failure! Using PIE, will the test cases find the defect in the program?

slide-65
SLIDE 65

The PIE Model

There are necessary and sufficient conditions for fault detection

◮ Execute the faulty source code ◮ Infect the program’s data state ◮ Propagate to the program’s output

All of these must occur before the fault manifests itself as a failure! Using PIE, will the test cases find the defect in the program?

slide-66
SLIDE 66

The PIE Model

There are necessary and sufficient conditions for fault detection

◮ Execute the faulty source code ◮ Infect the program’s data state ◮ Propagate to the program’s output

All of these must occur before the fault manifests itself as a failure! Using PIE, will the test cases find the defect in the program?

slide-67
SLIDE 67

The PIE Model

There are necessary and sufficient conditions for fault detection

◮ Execute the faulty source code ◮ Infect the program’s data state ◮ Propagate to the program’s output

All of these must occur before the fault manifests itself as a failure! Using PIE, will the test cases find the defect in the program?

slide-68
SLIDE 68

The PIE Model

There are necessary and sufficient conditions for fault detection

◮ Execute the faulty source code ◮ Infect the program’s data state ◮ Propagate to the program’s output

All of these must occur before the fault manifests itself as a failure! Using the PIE model, will the test cases find the defect in the program?

slide-69
SLIDE 69

A JUnit Test Case — T1

@Test public void testOne() { String expected = new String("Undefined"); String actual = Kinetic. computeVelocity(5,0); assertEquals(expected, actual); }

E I P ✗ ✗ ✗

slide-70
SLIDE 70

A JUnit Test Case — T1

@Test public void testOne() { String expected = new String("Undefined"); String actual = Kinetic. computeVelocity(5,0); assertEquals(expected, actual); }

E I P ✗ ✗ ✗

slide-71
SLIDE 71

A JUnit Test Case — T2

@Test public void testTwo() { String expected = new String("0"); String actual = Kinetic. computeVelocity(0,5); assertEquals(expected, actual); }

E I P ✓ ✗ ✗

slide-72
SLIDE 72

A JUnit Test Case — T2

@Test public void testTwo() { String expected = new String("0"); String actual = Kinetic. computeVelocity(0,5); assertEquals(expected, actual); }

E I P ✓ ✗ ✗

slide-73
SLIDE 73

A JUnit Test Case — T3

@Test public void testThree() { String expected = new String("4"); String actual = Kinetic. computeVelocity(8,1); assertEquals(expected, actual); }

E I P ✓ ✓ ✗

slide-74
SLIDE 74

A JUnit Test Case — T3

@Test public void testThree() { String expected = new String("4"); String actual = Kinetic. computeVelocity(8,1); assertEquals(expected, actual); }

E I P ✓ ✓ ✗

slide-75
SLIDE 75

A JUnit Test Case — T4

@Test public void testFour() { String expected = new String("20"); String actual = Kinetic. computeVelocity(1000,5); assertEquals(expected, actual); }

E I P ✓ ✓ ✗

slide-76
SLIDE 76

A JUnit Test Case — T4

@Test public void testFour() { String expected = new String("20"); String actual = Kinetic. computeVelocity(1000,5); assertEquals(expected, actual); }

E I P ✓ ✓ ✓

slide-77
SLIDE 77

Test Suite Summary

A test case must create specific inputs in order to cause failure!

Test Case Status T1 Pass T2 Pass T3 Pass T4 Fail

slide-78
SLIDE 78

Important Insights

Software testing is fundamentally challenging — is there help?

I shall not deny that the construction of these testing programs has been a major intellectual effort: to convince oneself that one has not overlooked “a relevant state” and to convince oneself that the testing programs generate them all is no simple matter. Edsger W. Dijkstra, Communications of the ACM, 1968

slide-79
SLIDE 79

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-80
SLIDE 80

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-81
SLIDE 81

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-82
SLIDE 82

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-83
SLIDE 83

Manual Testing

While it has benefits, this industry standard may be limited! Manual Testing

slide-84
SLIDE 84

Manual Testing

While it has benefits, this industry standard may be limited! Manual Testing Laborious

slide-85
SLIDE 85

Manual Testing

While it has benefits, this industry standard may be limited! Manual Testing Laborious Time Consuming

slide-86
SLIDE 86

Manual Testing

While it has benefits, this industry standard may be limited! Manual Testing Laborious Time Consuming Very Tedious

slide-87
SLIDE 87

Manual Testing

While it has benefits, this industry standard may be limited! Manual Testing Laborious Time Consuming Very Tedious Difficult

slide-88
SLIDE 88

Manual Testing

While it has benefits, this industry standard may be limited! Manual Testing Laborious Time Consuming Very Tedious Difficult Can we develop and employ methods that will automatically generate high- quality test cases for real-world software?

slide-89
SLIDE 89

Automated Testing

Automatically generating tests is amazing — but does it work? Automated Testing

slide-90
SLIDE 90

Automated Testing

Automatically generating tests is amazing — but does it work? Automated Testing Laborious

slide-91
SLIDE 91

Automated Testing

Automatically generating tests is amazing — but does it work? Automated Testing Laborious Time Consuming

slide-92
SLIDE 92

Automated Testing

Automatically generating tests is amazing — but does it work? Automated Testing Laborious Time Consuming Very Tedious

slide-93
SLIDE 93

Automated Testing

Automatically generating tests is amazing — but does it work? Automated Testing Laborious Time Consuming Very Tedious Difficult

slide-94
SLIDE 94

Automated Testing

Automatically generating tests is amazing — but does it work? Automated Testing Laborious Time Consuming Very Tedious Difficult Laborious Time Consuming Very Tedious Testing is less laborious and tedious because an algorithm generates the

  • tests. While computational time is

needed, a human can be less involved!

slide-95
SLIDE 95

Automated Testing

Automatically generating tests is amazing — but does it work? Automated Testing Laborious Time Consuming Very Tedious Difficult Laborious Time Consuming Very Tedious Laborious Time Consuming Very Tedious Difficult Automated testing is less difficult since a good fitness function can guide the algorithm to inputs that find the faults

slide-96
SLIDE 96

Random Testing

It is easy to randomly generate tests — but how good are they?

−6 −4 −2 2 4 6 −1 −0.5 0.5 1 2 4 6 8 10 12 14

slide-97
SLIDE 97

Search-Based Testing

Use a fitness function to guide the search to “good” values

0.2 0.4 0.6 0.8 1 0 0.5 1 0.5 1

slide-98
SLIDE 98

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2

slide-99
SLIDE 99

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4

slide-100
SLIDE 100

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6

slide-101
SLIDE 101

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8

slide-102
SLIDE 102

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10

slide-103
SLIDE 103

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10

slide-104
SLIDE 104

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2

slide-105
SLIDE 105

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4

slide-106
SLIDE 106

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6

slide-107
SLIDE 107

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8

slide-108
SLIDE 108

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10

slide-109
SLIDE 109

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12

slide-110
SLIDE 110

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Set of Program Methods M = {M1, M2, . . . , M11, M12}

slide-111
SLIDE 111

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Set of Program Methods M = {M1, M2, . . . , M11, M12} M12 M12 M12 M12

slide-112
SLIDE 112

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Set of Program Methods M = {M1, M2, . . . , M11, M12} M12 M12 M12 M12 M12 M12

slide-113
SLIDE 113

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Set of Program Methods M = {M1, M2, . . . , M11, M12} M12 M12 M12 M12 M12 M12 M12 M12 M12 M12

slide-114
SLIDE 114

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Set of Program Methods M = {M1, M2, . . . , M11, M12} M12 M12 M12 M12 M12 M12 M12 M12 M12 M12 M4

slide-115
SLIDE 115

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Set of Program Methods M = {M1, M2, . . . , M11, M12} M12 M12 M12 M12 M12 M12 M12 M12 M12 M12 M4 T1

slide-116
SLIDE 116

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Set of Program Methods M = {M1, M2, . . . , M11, M12} M12 M12 M12 M12 M12 M12 M12 M12 M12 M12 M4 T1

slide-117
SLIDE 117

Mutation Testing

Let’s purposefully insert faults into the program under test! T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Test Suite T = T1, T2, . . . , T9, T10 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 Set of Program Methods M = {M1, M2, . . . , M11, M12} M12 M12 M12 M12 M12 M12 M12 M12 M12 M12 M4 T1 M8

slide-118
SLIDE 118

Testing with EvoSuite

This prototype can automatically generate real JUnit test suites! Evolutionary Testing

slide-119
SLIDE 119

Testing with EvoSuite

This prototype can automatically generate real JUnit test suites! Evolutionary Testing Representation

slide-120
SLIDE 120

Testing with EvoSuite

This prototype can automatically generate real JUnit test suites! Evolutionary Testing Representation Fitness Function

slide-121
SLIDE 121

Testing with EvoSuite

This prototype can automatically generate real JUnit test suites! Evolutionary Testing Representation Fitness Function Modify Program

slide-122
SLIDE 122

Testing with EvoSuite

This prototype can automatically generate real JUnit test suites! Evolutionary Testing Representation Fitness Function Modify Program Operators

slide-123
SLIDE 123

Testing with EvoSuite

This prototype can automatically generate real JUnit test suites! Evolutionary Testing Representation Fitness Function Modify Program Operators “1600 Faults in 100 Projects: Automatically Finding Faults While Achieving High Coverage with EvoSuite”, Empirical Software Engineering

slide-124
SLIDE 124

Configuring EvoSuite

This tool has many unique configurations — which are best? EvoSuite’s Configurations

slide-125
SLIDE 125

Configuring EvoSuite

This tool has many unique configurations — which are best? EvoSuite’s Configurations Random

slide-126
SLIDE 126

Configuring EvoSuite

This tool has many unique configurations — which are best? EvoSuite’s Configurations Random Fixed-Random

slide-127
SLIDE 127

Configuring EvoSuite

This tool has many unique configurations — which are best? EvoSuite’s Configurations Random Fixed-Random Genetic

slide-128
SLIDE 128

Configuring EvoSuite

This tool has many unique configurations — which are best? EvoSuite’s Configurations Random Fixed-Random Genetic Regression

slide-129
SLIDE 129

Configuring EvoSuite

This tool has many unique configurations — which are best? EvoSuite’s Configurations Random Fixed-Random Genetic Regression The fitness function computes branch coverage, weak mutation score,

  • r strong mutation score to guide

the search to the “best” test cases

slide-130
SLIDE 130

A Test from EvoSuite

@Test public void test001() throws Throwable { int int0 = 0; String string0 = Kinetic.computeVelocity(int0, int0); assertEquals("Undefined", string0); assertNotNull(string0); int int1 = 1262; String string1 = Kinetic.computeVelocity(int0, int0); int int2 = 5349; String string2 = Kinetic.computeVelocity(int1, int2); int int3 = 0; int int4 = 3; String string3 = Kinetic.computeVelocity(int3, int4); Kinetic kinetic0 = new Kinetic(); }

slide-131
SLIDE 131

Important Questions

EvoSuite is an advanced, yet sometimes limited, testing tool

Will EvoSuite’s test cases find the fault in the example program?

slide-132
SLIDE 132

Important Questions

EvoSuite is an advanced, yet sometimes limited, testing tool

What is missing from the test cases that EvoSuite generates?

slide-133
SLIDE 133

Important Questions

EvoSuite is an advanced, yet sometimes limited, testing tool

How does the oracle problem influence the effectiveness of EvoSuite?

slide-134
SLIDE 134

Important Questions

EvoSuite is an advanced, yet sometimes limited, testing tool

What are the fundamental limitations of automated testing?

slide-135
SLIDE 135

No Silver Bullet

Software tools are fundamentally limited — what is our hope?

There is no single development, in either technology or management technique, which by itself promises even one

  • rder-of-magnitude improvement

within a decade in productivity, in reliability, in simplicity. Frederick P. Brooks, Jr., Proceedings of the IFIP Tenth World Computing Conference, 1986

slide-136
SLIDE 136

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-137
SLIDE 137

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-138
SLIDE 138

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-139
SLIDE 139

The Challenges of Software Development Pervasiveness of Software Complexity of Software Evolving Nature of Software Motivating Example Important Questions Benefits of Software Testing Test Cases Test Suites Examples of Tests The PIE Model Test Case Effectiveness Search-Based Software Testing Testing Methods Random Testing Testing with EvoSuite Conclusion

slide-140
SLIDE 140

The Software Crisis

Solutions are available — but not always obvious or popular

What are the solutions to the software crisis?

slide-141
SLIDE 141

The Software Crisis

Solutions are available — but not always obvious or popular

Great Designers

slide-142
SLIDE 142

The Software Crisis

Solutions are available — but not always obvious or popular

Unremitting Care

slide-143
SLIDE 143

The Software Crisis

Solutions are available — but not always obvious or popular

Incremental Advances

slide-144
SLIDE 144

Final Admonishment

An epilogue called “Fifty Years of Wonder, Excitement, and Joy”

Too many interests, too many exciting

  • pportunities for learning, research, and
  • thought. What a marvelous

predicament! Not only is the end not in sight, but the pace is not slackening. We have many future joys. Frederick P. Brooks, Jr., The Mythical Man-Month, 1995