136
Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

  • View
    216

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Introduction toSearch Based Software Engineering

SSS SEBASE Summer School, Birmingham University, July 2007

Mark Harman

King’s College London

Page 2: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Introduction toSearch Based Software Engineering

SSSS Second SEBASE Summer School, Birmingham University, July 2008

Mark Harman

King’s College London

Page 3: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Introduction toSearch Based Software Engineering

How on earth can software engineers do what John says they claim do

Mark Harman

King’s College London

Page 4: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

How on earth can software engineers do what John says they claim do

-To engineer is to optimize

Mark Harman

King’s College London

Page 5: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Introduction toSearch Based Software Engineering

Thanks

John Clark, University of York,Sebastian Elbaum, University of Nebraska Lincoln

Rob Hierons, Brunel UniversityZheng Li, King’s College London

Kiarash Mahdavi, King’s College LondonSpiros Mancoridis, Drexel University

Afshin Mansouri, King’s College LondonJian Ren, King’s College London

Joachim Wegener, DaimlerChryslerShin Yoo, King’s College London

YuanYuan Zhang, King’s College London

Page 6: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

6

Where is King’s College London?

20 minutes’ walk

Page 7: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

7

Search Based Software Engineering

SBSE what and whySBSE case studiesSBSE how

Current and future trendsAdvantages Multi Objective SearchInsight through searchCo Evolution

Page 8: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

8

Search Based Software Engineering

SBSE what and whySBSE case studiesSBSE how

Current and future trends – personal viewsAdvantages Multi Objective SearchInsight through searchCo Evolution

Page 9: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

9

Search Based Software Engineering

SBSE what and whySBSE case studiesSBSE how

Current and future trends – IMHOAdvantages Multi Objective SearchInsight through searchCo Evolution

Page 10: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

10

Search Based Software Engineering

SBSE what and whySBSE case studiesSBSE how

Current and future trends – In Mark Harman’s OpinionAdvantages Multi Objective SearchInsight through searchCo Evolution

Page 11: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

11

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

Page 12: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

15

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

So it is merely another application of Optimization Techniques?

Page 13: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

16

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

So it is merely another set of applications of Optimization Techniques?

Page 14: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

17

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

So it is merely another rich set of applications of Optimization Techniques?

Page 15: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

18

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

So it is merely another rich set of applications of Optimization Techniques?

Page 16: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

19

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

Have nails … seek hammer

Page 17: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

20

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

Have nails … seek hammers

Page 18: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

21

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

Have nails … seek hammers

Generalise, compare, develop

Page 19: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

22

What is SBSE

In SBSE we apply search techniques to search large search spaces, guided by a fitness function that captures properties of the acceptable software artefacts we seek.

Have nails … seek hammers

Generalise, compare, develop

in an unbiased manner

Page 20: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

23

What is Research?

In research we apply social search techniques to search large search spaces, guided by a natural evolution of memes

Have nails … seek hammers

Generalise, compare, develop

in an unbiased manner

Page 21: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

24

What is Research?

In research we apply social search techniques to search large search spaces, guided by a natural evolution of memes and all the usual human frailties

Have nails … seek hammers

Generalise, compare, develop

in an unbiased manner

Page 22: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

25

Why?

Page 23: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

26

The Eight Queens Problem

Page 24: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

27

The Eight Queens Problem

Page 25: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

28

The Eight Queens Problem

Page 26: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

29

The Eight Queens Problem

Perfect

Page 27: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

30

The Eight Queens Problem

Perfect Score 0

Page 28: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

31

The Eight Queens Problem

Page 29: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

32

The Eight Queens Problem

Page 30: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

33

The Eight Queens Problem

Two Attacks

Page 31: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

34

The Eight Queens Problem

Two Attacks

Score -2

Page 32: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

35

The Eight Queens Problem

Page 33: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

36

The Eight Queens Problem

Page 34: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

37

The Eight Queens Problem

Three Attacks

Page 35: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

38

The Eight Queens Problem

Three Attacks

Score -3

Page 36: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

39

That was easy

Page 37: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

40

Generate a solution

Place

8 queens

on the

board

so that

there are

no

attacks

Page 38: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

41

Scale up: Generate a solution

Place

44 queens

on the

board

so that

there are

no

attacks

Page 39: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

42

Scale up: Generate a solution

Place

400 queens

on the

board

so that

there are

no

attacks

Page 40: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

43

Checking vs Generating

Task One:

Write a method to determine which is the better of two placements of N queens

Task Two:

Write a method to construct a board placement with N non attacking queens

Page 41: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

44

Checking vs Generating

Task One:

Write a method to determine which is the better of two placements of N queens

Task Two:

Write a method to construct a board placement with N non attacking queens

Page 42: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

45

Checking vs Generating

Search Based Software Engineering

Write a method to determine which is the better of two solutions

Conventional Software Engineering

Write a method to construct a perfect solution

Page 43: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

46

Checking vs Generating

Search Based Software Engineering

Write a method to determine which is the better of two solutions

Conventional Software Engineering

Write a method to construct a perfect solution

Page 44: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

47

Checking vs Generating

Search Based Software Engineering

Write a method to determine which is the better of two solutions

Conventional Software Engineering

Write a method to construct a perfect solution

Page 45: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

48

Checking vs Generating

Search Based Software Engineering

Write a fitness function to determine which is the better of two solutions

Conventional Software Engineering

Write a method to construct a perfect solution

Page 46: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

49

Checking vs Generating

Search Based Software Engineering

Write a fitness function to guide a search aaaa

Conventional Software Engineering

Write a method to construct a perfect solution

Page 47: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

50

Checking vs Generating

Search Based Software Engineering

Write a fitness function to guide automated search

Conventional Software Engineering

Write a method to construct a perfect solution

Page 48: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

51

Examples

Page 49: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

52

Case Studies

Page 50: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

53

Evolutionary Algorithms

Selection

Insertion

Recombination

Mutation

Fitness evaluationTest

execution

End?

Page 51: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

54

Evolutionary Testing

Selection

Insertion

Recombination

Mutation

Fitness evaluation

Test cases

Testexecution

End?

Page 52: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

55

Evolutionary Testing

Selection

Insertion

Recombination

Mutation

Fitness evaluation

Test cases

Testexecution

End?

Execution

Page 53: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

56

Evolutionary Testing

Selection

Insertion

Recombination

Mutation

Fitness evaluation

Test cases

Testexecution

End?

Execution

Monitoring

Page 54: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

57

Temporal Testing

decelerationtmin

tmax

t

optimal point of time

for triggering the airbag

igniter Selection

Insertion

Recombination

Mutation

Fitness evaluation

Individuals

Test data

Monitoring

Fitness values

Testexecution

End?

Page 55: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

58

Temporal Testing

decelerationtmin

tmax

t

optimal point of time

for triggering the airbag

igniter Selection

Insertion

Recombination

Mutation

Duration

Individuals

Test data

Monitoring

Fitness values

Testexecution

End?

Page 56: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

59

Generation

Ex

ecu

tio

n

Tim

e (i

n c

ycl

es)

Evolutionary Test

Random Test

Evolution vs Random for Temporal Testing

Page 57: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

60

Search Based Testing Applications

Temporal testingCoverage based testingFunctional testingRegression testingFinite State Machine testingInteraction testingException testingStress testingRobustness testing

Page 58: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

61

Search Based Testing Applications

Temporal testingCoverage based testingFunctional testingRegression testingFinite State Machine testingInteraction testingException testingStress testingRobustness testing

Phil will talk

about some of these in

more detail

shortly

Page 59: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

62

Search Based Testing Applications

Temporal testingCoverage based testingFunctional testingRegression testingFinite State Machine testingInteraction testingException testingStress testingRobustness testing

Page 60: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

63

Page 61: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

64

Page 62: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

65

Page 63: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

66

Page 64: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

67

Page 65: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

68

Page 66: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

69

Finding UIOsHierons et al. 2004-2008

s1

s2

s3

a/0

a/0

a/1

b/1

b/1

b/0

a/1s3

b/0s2

b/1,a/1s1

UIOState

Page 67: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

70

Target

Level 4

Level 3

Level 2

Level 1

Fitness = Approximation_Level + Local_Distance

Evaluation of predicate in a branching condition

if A = B Local_Distance = | A - B |

Identify relevant branching statements using control dependence

TargetTargetTarget

1. 1. Approximation levelApproximation level1. 1. Approximation levelApproximation level

Structural Evolutionary Testing

Page 68: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

71

Evolutionary Testing vs Random

0

200000

400000

600000

800000

1000000

1200000

1400000

Num

ber

of te

st c

ases

ET 16915 42086 23633 35263

RT 199743 215834 470931 1251038

RT / ET 11,8 5,1 19,9 35,5

Triangle_int Triangle_float Complex My_atof0

20

40

60

80

100

120

Ach

ieve

d co

vera

ge

ET coverage 100 100 100 100

RT coverage 90,5 90,5 98,1 66,5

Triangle_int Triangle_float Complex My_atof

Effectiveness Cost

Page 69: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

72

Autonomous Parking System

Page 70: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

73

Autonomous Parking System

Page 71: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

74

Autonomous Parking System

Stop

Page 72: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

75

Autonomous Parking System - Input

psi

gap

dist2space

space length

space width

Page 73: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

76

Autonomous Parking System

Generation 0

Generation 10

Critical

Generation 20

collision

Generation 20

collision

Page 74: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

77

Regression Testing

Test case prioritzation

Test suite reduction

Test case selection

Page 75: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

78

Regression Testing

Test case prioritzation Li, Harman, Hierons, TSE 2007

Test suite reduction

Test case selection

Page 76: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

79

Test Case Prioritization

Order test cases

higher priority => earlier execution

Page 77: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

80

Greedy

Optimal orderings:

A B C

B C A

C B A

Page 78: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

81

Regression Testing

Test case prioritzation

Test suite reduction

Test case selection

Page 79: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

82

Regression Testing

Test case prioritzationTest suite reduction Yoo and Harman, ISSTA 07

Test case selection

Page 80: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

83

Regression Test Selection

Page 81: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

84

Regression Testing

Test case prioritzation

Test suite reductionTest case selection you and someone else, TSE 2008/9 ?

Page 82: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

85

Regression Testing

Test case prioritzation

Test suite reductionTest case selection yoo and me, TSE 2008/9 ?

Page 83: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

86

Does this look familiar?

Page 84: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

87

Does this look familiar?

Page 85: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

88

MDGM1

M2 M3

M4

M5 M6

Good Partition!

M1

M2

M3

M4

M5

M6

Bad Partition!

M1

M2

M4

M3M5

M6

MQ(Good Partition) > MQ(Bad Partition)

The Bunch ApproachMancoridis et al. 1998 - 2005

Page 86: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

89

Hill Climbing

Page 87: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

90

Hill Climbing

Page 88: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

91

Hill Climbing

Maybe this is

no longer

the optimal approach

Page 89: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

92

Hill Climbing

Kata Praditwong et al.

Page 90: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

93

SBSE is so generic

TestingFitness function: execution time

Representation: input vector

Page 91: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

94

SBSE is so generic

TestingFitness function: execution time

Representation: input vector

RestructuringFitness function: cohesion and coupling

Representation: mapping from modules to clusters

Page 92: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

95

SBSE is so generic

TestingFitness function: execution time

Representation: input vector

RequirementsFitness function: customer satisfaction, cost

Representation: bitset of requirements

Page 93: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

96

SBSE is so generic

TestingFitness function: execution time

Representation: input vector

Program ComprehensionFitness function: (in)direct aspect of cognition

Representation: code, architecture, visualization, model

Page 94: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

97

SBSE is so generic

TestingFitness function: execution time

Representation: input vector

Project ManagementFitness function: project duration

Representation: mapping from teams to WPs

Page 95: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

98

SBSE is so generic

Time for two more examplesProgram Comprehension Mahdavi et al. ICSM 05

Requirements Analysis Zhang et al. GECCO 07

Page 96: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

99

SBSE is so generic

Time for two more examplesProgram Comprehension Mahdavi et al. ICSM 05

Requirements Analysis

Page 97: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

100

Concept Assignment

“The process of assigning descriptive terms usually relating to computational intent.”

MOVE ‘EXAMPLE’ TO PRINT-LLMOVE ‘13’ TO PRINT-CC.CALL ‘PRINT’ USING P-PRINTLINE.MOVE POLICY-NUM TO OUT-PNUM.MOVE SCHEME-REF TO OUT-SREF.CALL ‘WRITE’ USING OUT-REC.

Write

Print

Page 98: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

101

Allowing Overlapping Concept Binding

Fitness: Signal to noise ratioRepresentation: Space of possible overlapping bindings

MOVE ‘EXAMPLE’ TO PRINT-LLMOVE POLICY-NUM TO OUT-PNUM.MOVE ‘13’ TO PRINT-CC.MOVE SCHEME-REF TO OUT-SREF.CALL ‘PRINT’ USING P-PRINTLINE.CALL ‘WRITE’ USING OUT-REC.

PrintWrite

Call

Page 99: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

102

SBSE is so generic

Time for two more examplesProgram ComprehensionRequirements Analysis Zhang et al. GECCO 07

Page 100: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

103

The Next Release Problem

,i jvalue r c

1,..., ,...,j mC c c c 1,..., ,...,i nR r r r

1,..., ,...,j mWeight w w w 1,..., nCost cost cost

1

,m

i j i jj

score w value r c

Page 101: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

104

Motorola Cell Phone Requirements

Page 102: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

105

SBSE ApplicationsTransformation Cooper, Ryan, Schielke, Subramanian, Fatiregun, WilliamsRequirements Bagnall, Mansouri, ZhangEffort prediction Aguilar-Ruiz, Burgess, Dolado, Lefley, Shepperd Management Alba, Antoniol, Chicano, Di Pentam Greer, RuheHeap allocation Cohen, Kooi, Srisa-an Regression test Li, Yoo, Elbaum, Rothermel, Walcott, Soffa, Kampfhamer SOA Canfora, Di Penta, Esposito, Villani Refactoring Antoniol, Briand, Cinneide, O’Keeffe, Merlo, Seng, TrattTest Generation Alba, Binkley, Bottaci, Briand, Chicano, Clark, Cohen, Gutjahr,

Harrold, Holcombe, Jones, Korel, Pargass, Reformat, Roper, McMinn,Michael, Sthamer, Tracy, Tonella,Xanthakis, Xiao, Wegener, Wilkins

Maintenance Antoniol, Lutz, Di Penta, Madhavi, Mancoridis, Mitchell, SwiftModel checking Alba, Chicano, GodefroidProbe dist’ion Cohen, Elbaum UIOs Derderian, Guo, HieronsComprehension Gold, Li, MahdaviProtocols Alba, Clark, Jacob, TroyaComponent sel Baker, Skaliotis, Steinhofel, YooAgent Oriented Haas, Peysakhov, Sinclair, Shami, Mancoridis

Page 103: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

106

SBSE ApplicationsTransformation Cooper, Ryan, Schielke, Subramanian, Fatiregun, WilliamsRequirements Bagnall, Mansouri, ZhangEffort prediction Aguilar-Ruiz, Burgess, Dolado, Lefley, Shepperd Management Alba, Antoniol, Chicano, Di Pentam Greer, RuheHeap allocation Cohen, Kooi, Srisa-an Regression test Li, Yoo, Elbaum, Rothermel, Walcott, Soffa, Kampfhamer SOA Canfora, Di Penta, Esposito, Villani Refactoring Antoniol, Briand, Cinneide, O’Keeffe, Merlo, Seng, TrattTest Generation Alba, Binkley, Bottaci, Briand, Chicano, Clark, Cohen, Gutjahr,

Harrold, Holcombe, Jones, Korel, Pargass, Reformat, Roper, McMinn,Michael, Sthamer, Tracy, Tonella,Xanthakis, Xiao, Wegener, Wilkins

Maintenance Antoniol, Lutz, Di Penta, Madhavi, Mancoridis, Mitchell, SwiftModel checking Alba, Chicano, GodefroidProbe dist’ion Cohen, Elbaum UIOs Derderian, Guo, HieronsComprehension Gold, Li, MahdaviProtocols Alba, Clark, Jacob, TroyaComponent sel Baker, Skaliotis, Steinhofel, YooAgent Oriented Haas, Peysakhov, Sinclair, Shami, Mancoridis

Page 104: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

107

SBSE ApplicationsTransformation Cooper, Ryan, Schielke, Subramanian, Fatiregun, WilliamsRequirements Bagnall, Mansouri, ZhangEffort prediction Aguilar-Ruiz, Burgess, Dolado, Lefley, Shepperd Management Alba, Antoniol, Chicano, Di Pentam Greer, RuheHeap allocation Cohen, Kooi, Srisa-an Regression test Li, Yoo, Elbaum, Rothermel, Walcott, Soffa, Kampfhamer SOA Canfora, Di Penta, Esposito, Villani Refactoring Antoniol, Briand, Cinneide, O’Keeffe, Merlo, Seng, TrattTest Generation Alba, Binkley, Bottaci, Briand, Chicano, Clark, Cohen, Gutjahr,

Harrold, Holcombe, Jones, Korel, Pargass, Reformat, Roper, McMinn,Michael, Sthamer, Tracy, Tonella,Xanthakis, Xiao, Wegener, Wilkins

Maintenance Antoniol, Lutz, Di Penta, Madhavi, Mancoridis, Mitchell, SwiftModel checking Alba, Chicano, GodefroidProbe dist’ion Cohen, Elbaum UIOs Derderian, Guo, HieronsComprehension Gold, Li, MahdaviProtocols Alba, Clark, Jacob, TroyaComponent sel Baker, Skaliotis, Steinhofel, YooAgent Oriented Haas, Peysakhov, Sinclair, Shami, Mancoridis

Page 105: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

108

The two SBSE ingredients

Representation

Fitness function

Page 106: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

109

The two SBSE ingredients

Representation

Fitness function

Should be easy

We always represent

Software Engineering

problems in data

structures

Page 107: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

110

The two SBSE ingredients

Representation

Fitness function

Often easy

We often define metrics

Page 108: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

111

So far

SBSE is useful

SBSE is generic

SBSE is easy

Page 109: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

112

Future

Multiple objective search

Co evolution

Sensitivity analysis

Metric validation

Landscape analysis

Interactive evolution

Page 110: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

113

Future

Multiple objective search

Co evolution

Sensitivity analysis

Metric validation

Landscape analysis

Interactive evolution

Page 111: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

114

Co Evolution

Two populations; Two fitness functions

Collaboration, and competition

Page 112: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

115

Co Evolution

Two populations; Two fitness functions

Collaboration, and competition

applied to mutation testing Adamopoulos, Harman and Hierons GECCO 2004

Page 113: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

116

Mutants Test Cases

Page 114: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

117

Mutants Test Cases

Fitness?

Page 115: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

118

Mutants Test Cases

Fitness for test cases

How many mutants

do you kill ?

Page 116: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

119

Mutants Test Cases

Fitness for mutants

How many test cases

do you survive?

Page 117: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

120

Sensitivity analysis

Inputs to search are typically estimates

Estimated Software Engineering attributes

Which estimates matter most?

Page 118: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

121

Sensitivity analysis

Inputs to search are typically estimates

Estimated Software Engineering attributes

Which estimates matter most?

applied to component selectionYoo, Ren, Harman, Not yet published

Page 119: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

122

Motorola Cell Phone Requirements

Page 120: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

123

Metric Robustness

Metric performs under …

change, noise, fuzziness

Not just good solutions; robust solutions

Page 121: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

124

Metric Robustness

Metric performs under …

change, noise, fuzziness

Not just good solutions; robust solutions

Metrics are fitness functions too!Harman and Clark, Metrics Symposium 2004

Page 122: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

125

Landscape Analysis

What landscape is denoted by the metric?

Landscape properties

smoothness, plateaux, …

Page 123: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

126

Landscape Analysis and Improvement

Improve the fitness landscape by transformation

SBSE allows transformation of program under testA Testability Transformation Harman et al. 2004 – 2008

Page 124: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

127

Landscape Analysis and Improvement

Improve the fitness landscape by transformation

SBSE allows transformation of program under testA Testability Transformation Harman et al. 2002 – 2008

An example for Structural Testing McMinn et al. ISSTA 2007

Page 125: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

128

Hitchcock Landscape

void alfred(double a, double b){ if (a == b) { // target 1 double c = b + 1;

if (c == 0) { // target 2 . . .

Page 126: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

129

Hitchcock Landscape

Page 127: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

130

Hitchcock Landscape

Page 128: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

131

Interactive evolutionHarman ICPC 2007

Human in the loop

Caters for intangibles

Can flush out implicit assumptions

Co evolution of cognitive models

Lots of fun things to do here …

Page 129: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

132

Summary

Software Engineering problems can be optimizedSoftware Engineering problems are often search problems

This should not be a surprise

The SBSE approach gives us a whole new set of ToolsConceptsTechniquesInsights

To optimize

Page 130: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

133

Summary

Software Engineering problems can be optimizedSoftware Engineering problems are often search problems

This should not be a surprise

The SBSE approach gives us a whole new set of ToolsConceptsTechniquesInsights

To optimize is to engineer

Page 131: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

134

Search Based Software Engineering is the focus of major initiatives

SEBASE $5m

5 year project

Search based software engineering

Led by King’s

Birmingham, York, Brunel

Daimler, Motorola, IBM

EvoTest $4m

3 year project

Evolutionary testing

Led by Valencia

King’s, FIRST, INRIA,

Daimler, Motorola, RILA, Xenon

Page 132: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

135

Summary

Page 133: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

136

Summary

Page 134: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

137

Conclusions

Search is what you seek

Page 135: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

138

Conclusions

Search is what you seek

www.sebase.org

Page 136: Introduction to Search Based Software Engineering SSS SEBASE Summer School, Birmingham University, July 2007 Mark Harman King’s College London

Mark Harman Introduction to SBSE

139

Conclusions

Search is what you seek

www.sebase.org

Questions?