Milu: A Higher Order Mutation Testing Tool Yue Jia University - - PowerPoint PPT Presentation

milu a higher order mutation testing tool
SMART_READER_LITE
LIVE PREVIEW

Milu: A Higher Order Mutation Testing Tool Yue Jia University - - PowerPoint PPT Presentation

Milu: A Higher Order Mutation Testing Tool Yue Jia University College London Joint work with Mark Harman and William Langdon Agenda Why Higher Order Mutation Testing? Search for interesting HOMs Milu mutation testing tool Scalability and


slide-1
SLIDE 1

Milu: A Higher Order Mutation Testing Tool

Yue Jia University College London

Joint work with Mark Harman and William Langdon

slide-2
SLIDE 2

Agenda

Why Higher Order Mutation Testing? Search for interesting HOMs Milu mutation testing tool Scalability and Extendability Performance Study

slide-3
SLIDE 3

Mutation Testing

First Order Mutants : A single change Simple faults / FOMs Higher Order Mutant : Multiple changes Multiple faults / HOMs

slide-4
SLIDE 4

Mutation Testing

Subset of First Order Mutants are used No Higher Order Mutants at all!

slide-5
SLIDE 5

Mutation Testing

Subset of First Order Mutants are used No Higher Order Mutants at all!

slide-6
SLIDE 6

Higher Order Mutation Testing

The space of all mutants (first and higher order) is a search space, We should apply search based

  • ptimisation techniques to find

mutants that are fit for purpose.

slide-7
SLIDE 7

Higher Order Mutation Testing

Search for a small set of highly fit mutants within an enormous space, rather than to enumerate a complete set.

Genetic Algorithms Hill Climbing Simulated Annealing Random Tabu Search Estimation of Distribution Algorithms Particle Swarm Optimization Ant Colonies LP Genetic Programming Greedy

slide-8
SLIDE 8

Higher Order Mutation Testing

Search for a small set of highly fit mutants within an enormous space, rather than to enumerate a complete set.

Genetic Algorithms Hill Climbing Simulated Annealing Random Tabu Search Estimation of Distribution Algorithms Particle Swarm Optimization Ant Colonies LP Genetic Programming Greedy

slide-9
SLIDE 9

Higher Order Mutation Testing

Search for a small set of highly fit mutants within an enormous space, rather than to enumerate a complete set.

Genetic Algorithms Hill Climbing Simulated Annealing Random Tabu Search Estimation of Distribution Algorithms Particle Swarm Optimization Ant Colonies LP Genetic Programming Greedy

slide-10
SLIDE 10

Interesting HOMs

Most common case

FOM a is killed by { 1, 2, 3, 4 } Test set T Ta 1 2 3 4

slide-11
SLIDE 11

Interesting HOMs

Most common case

FOM a is killed by { 1, 2, 3, 4 } FOM b is killed by { 3, 4, 5, 6 } Test set T Ta 1 2 3 4 Tb 5 6

slide-12
SLIDE 12

Interesting HOMs

Most common case

FOM a is killed by { 1, 2, 3, 4 } FOM b is killed by { 3, 4, 5, 6 } HOM ab is killed by {1, 2, 3, 4, 5, 6} Test set T Ta 1 2 3 4 Tb 5 6

slide-13
SLIDE 13

Interesting HOMs

Subsuming HOM

FOM a is killed by { 1, 2, 3, 4 } FOM b is killed by { 3, 4, 5, 6 } HOM ab is killed by {2, 3, 5} Test set T Ta 1 2 3 4 Tb 5 6

slide-14
SLIDE 14

Interesting HOMs

Strongly Subsuming HOM

FOM a is killed by { 1, 2, 3, 4 } FOM b is killed by { 3, 4, 5, 6 } HOM ab is killed by { 3 } Test set T Ta 1 2 3 4 Tb 5 6

slide-15
SLIDE 15

Interesting HOMs

Anti Coupling Effect HOM

FOM a is killed by { 1, 2, 3, 4 } FOM b is killed by { 3, 4, 5, 6 } HOM ab is killed by { 7 } Test set T Ta 1 2 3 4 Tb 5 6 7

slide-16
SLIDE 16

Interesting HOMs

Equivalent HOM

FOM a is killed by { 1, 2, 3, 4 } FOM b is killed by { 3, 4, 5, 6 } HOM ab is killed by { } Test set T Ta 1 2 3 4 Tb 5 6

slide-17
SLIDE 17

Milu

Strong mutation First and Higher Order Mutants For C program Test harness

slide-18
SLIDE 18

Data Representation Index Position

Milu

  • /

* + +

slide-19
SLIDE 19

Data Representation Index Position

Milu

  • /

*

1

+

slide-20
SLIDE 20

Data Representation Index Position

Milu

  • /

*

1

+

2

*

slide-21
SLIDE 21

Data Representation Index Position

Milu

  • /

*

1 2

*

1 2

slide-22
SLIDE 22

Data Representation Index Position

Milu

  • /

*

1 2

*

1 2

  • Mutation Id
slide-23
SLIDE 23

Data Representation Index Position

Milu

  • /

*

1 2

*

1 2

  • Mutation Id
slide-24
SLIDE 24

Milu

Limitations Cannot scale up Hard to extend

slide-25
SLIDE 25

Solutions

Implement the mutation component as a pass into GCC

slide-26
SLIDE 26

GCC Internal

Front End Middle End Back End C C++ Java Fortran GENERIC GIMPLE RTL Assembly

slide-27
SLIDE 27

GCC Internal

Front End Middle End Back End C C++ Java Fortran GENERIC GIMPLE RTL Assembly

slide-28
SLIDE 28

GCC Internal

Source Front End Middle End Back End C C++ Java Fortran GENERIC GIMPLE RTL Assembly

Milu pass

slide-29
SLIDE 29

Gimple

SIMPLE IR of McCat compiler 3 address representation Control flow lowering Cleanups and simplification

slide-30
SLIDE 30

Gimple

If (foo (a + b, c)) c = b++ /a ; return c t1 = a + b; t2 = foo (t1, c) if (t2 != 0) { t3 = b b = b+ 1 c = t3 / a } return c

slide-31
SLIDE 31

Implementation

typedef void (*plugin_callback_func) (void *gcc_data, void *user_data); struct register_pass_info { struct opt_pass *pass; const char *reference_pass_name; int ref_pass_instance_number; enum pass_positioning_ops pos_op; };

slide-32
SLIDE 32

Advantages

Supports all major languages: C, C++, Java, Fortran 95, Ada, Objective-C, Objective-C++, Go, etc Large number of platforms

slide-33
SLIDE 33

Demo

slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36

Test set

Performance

Source Mutant Source Mutant Source Mutant Source Mutant Source Mutant Binary Mutant Binary Mutant Binary Mutant Binary

slide-37
SLIDE 37

Test set Source Mutant Source Mutant Binary 100-300 Loc , 1000 mutants, 100 test

7 secs 1min 5-10mins

Binary Injection Gimple MSG Test harness

slide-38
SLIDE 38

Conclusion

GCC Pass / Plugin Mutating real world program Multiple language mutation Multiple platform

http://gcc.gnu.org/onlinedocs/gccint/Plugins.html http://www.inf.kcl.ac.uk/pg/jiayue/milu/