Cloud9: A Software Testing Service

33
CLOUD9: A SOFTWARE TESTING SERVICE Liviu Ciortea, Cristian Zamr, Stefan Bucur , Vitaly Chipounov, George Candea

Transcript of Cloud9: A Software Testing Service

Page 1: Cloud9: A Software Testing Service

CLOUD9: A SOFTWARE TESTING SERVICE

Liviu Ciortea, Cristian Zam!r,Stefan Bucur, Vitaly Chipounov, George Candea

Page 2: Cloud9: A Software Testing Service

SOFTWARE TESTING

• Software testing is laborious and expensive

• Bugs are still very common

• Human testing is prone to errors

• Current automatic test case generation is limited

2

Page 3: Cloud9: A Software Testing Service

GOALS

• Autonomy: Minimize intervention in test generation

• Usability: Minimize con!guration effort

• Performance: Maximize results relevance

3

Page 4: Cloud9: A Software Testing Service

OVERVIEW

• System Interface

• Parallel Symbolic Execution

• Cloud9 Design

• Preliminary Results

4

Page 5: Cloud9: A Software Testing Service

WHAT IS CLOUD9?

• Web service for automated testing

• Easy to use interface

• Relies on thorough testing technique

• Can operate autonomously

• Massive parallelization in the cloud

• Brings scalable performance5

Page 6: Cloud9: A Software Testing Service

6

Page 7: Cloud9: A Software Testing Service

SERVICE INTERFACE

7

Page 8: Cloud9: A Software Testing Service

8

Page 9: Cloud9: A Software Testing Service

OVERVIEW

• System Interface

• Parallel Symbolic Execution

• Cloud9 Design

• Preliminary Results

9

Page 10: Cloud9: A Software Testing Service

SYMBOLIC EXECUTIONvoid read(int x) {

}

if (x < 0) {

} else {if (x < 5)bar(x);

else {...

}}

if (x > -3)foo(x);

else {...

} x = -2

Concrete value:

10

Page 11: Cloud9: A Software Testing Service

SYMBOLIC EXECUTIONvoid read(int x) {

}

if (x < 0) {

} else {

}

if (x > -3)foo(x);

else {...

} x = 3

Concrete value:

if (x < 5)bar(x);

else {...

}

11

Page 12: Cloud9: A Software Testing Service

SYMBOLIC EXECUTIONvoid read(int x) {

}

if (x < 0) {

} else {

}

if (x > -3)foo(x);

else {...

}

Symbolic execution tree:

if (x < 5)bar(x);

else {...

}

λ

λ<0 λ>=0

λ<0&& λ>-3

λ>=0&& λ<5

Symbolic value

Constraint

λ<0 && λ>-3 Constraintsolver λ=-2 (a solution)

12

Page 13: Cloud9: A Software Testing Service

PATH EXPLOSION

Large memory consumptionCPU Intensive

Page 14: Cloud9: A Software Testing Service

Large memory consumptionCPU Intensive

Page 15: Cloud9: A Software Testing Service

We massively parallelize in the cloud

Page 16: Cloud9: A Software Testing Service

CHALLENGES

• Tree structure is not known a priori

15

Page 17: Cloud9: A Software Testing Service

CHALLENGES

• Tree structure is not known a priori

• Naive approach: pre-allocate workers equally on the tree

15

Page 18: Cloud9: A Software Testing Service

CHALLENGES

• Tree structure is not known a priori

• Naive approach: pre-allocate workers equally on the tree

• Slightly better: examine the !rst h levels, then decide work allocation

h levels

15

Page 19: Cloud9: A Software Testing Service

CHALLENGES

• State transfer

• Avoid work and memory redundancy

• Coordination

16

Page 20: Cloud9: A Software Testing Service

OVERVIEW

• System Interface

• Parallel Symbolic Execution

• Cloud9 Design

• Preliminary Results

17

Page 21: Cloud9: A Software Testing Service

TREE EXPLORATION

Explorationfrontier

Exploration strategy = which node to expand next?

w1

w2

18

Page 22: Cloud9: A Software Testing Service

TREE EXPLORATION

Explorationfrontier

Exploration strategy = which node to expand next?

w1

w2

18

Page 23: Cloud9: A Software Testing Service

LOAD BALANCING

w1 w2

LB

19

Page 24: Cloud9: A Software Testing Service

LOAD BALANCING

w1 w2

LB

19

negotiate

Page 25: Cloud9: A Software Testing Service

LOAD BALANCING

w1 w2

LB

19

Page 26: Cloud9: A Software Testing Service

STATE TRANSFER DECISIONS• State copying vs. state reconstruction

• Reconstruction optimizations

Copying(Network intensive)

Reconstruction(CPU intensive)

c1&&(c2||c3)&&...

w1 w2 c1&&(c2||c3)&&...

w1 w2

10010...

1

00

1

0

20

Page 27: Cloud9: A Software Testing Service

STRATEGY PORTFOLIO

• No “one size !ts all” exploration strategy

• Different workers with different strategies

• Invest in few workers, then select successful methods

21

Page 28: Cloud9: A Software Testing Service

OVERVIEW

• System Interface

• Parallel Symbolic Execution

• Cloud9 Design

• Preliminary Results

22

Page 29: Cloud9: A Software Testing Service

CLOUD9 PROTOTYPE

• We built Cloud9 on KLEE

• State-of-the art sequential symbolic execution engine

• Tested real programs and found bugs

• Use Amazon EC2 as cloud computing platform

23

Page 30: Cloud9: A Software Testing Service

TESTING METHODOLOGY

• We compare with KLEE for testing Coreutils

• ls, cat, chmod, cp, mv, etc.

• Cloud9 and KLEE run for 1 hour

• 16 workers for Cloud9

24

Page 31: Cloud9: A Software Testing Service

CLOUD9 SPEEDUPFix code coverageand measure time

(Linear) 16 50

100

150

200

250

echojoinheadln cp ptx

du chgrp

cutdatecksum

ls pr commcsplit

fmtod factor

chmod

printf

basename

chown

expand

mv catnl dircolors

readlink

paste

chcon

rm mktemp

fold

Speedup(tKLEE/tCloud9)

Tool25

Page 32: Cloud9: A Software Testing Service

CODE COVERAGE

26

Fix resources (CPU time)and measure code coverage

0

20

40

60

80

100

ptxls chcon

cp headdate

joinpr fmt

du catfold

dircolors

csplit

echood chmod

expand

mv ln nl paste

cutcksum

chgrp

commrm chown

factor

basename

printf

mktemp

readlink

Cove

rage

(%)

Tool

Cloud9 (1h x 16w)KLEE (16h)

Page 33: Cloud9: A Software Testing Service

CONCLUSIONSAutonomy:

• Symbolic execution

Usability:

• Web service interface

• No local setup overhead

Performance: up to 250x speedup

• Parallel symbolic execution

• Dynamic load balancing

• Adaptive state transfer

• Strategy portfolio

27