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

cloud

  • Upload
    lovebot

  • View
    293

  • Download
    0

Embed Size (px)

DESCRIPTION

cloud technology

Citation preview

Page 1: cloud

CLOUD9: A SOFTWARE TESTING SERVICE

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

Page 2: cloud

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: cloud

GOALS

• Autonomy: Minimize intervention in test generation

• Usability: Minimize con!guration effort

• Performance: Maximize results relevance

3

Page 4: cloud

OVERVIEW

• System Interface

• Parallel Symbolic Execution

• Cloud9 Design

• Preliminary Results

4

Page 5: cloud

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: cloud

6

Page 7: cloud

SERVICE INTERFACE

7

Page 8: cloud

8

Page 9: cloud

OVERVIEW

• System Interface

• Parallel Symbolic Execution

• Cloud9 Design

• Preliminary Results

9

Page 10: cloud

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: cloud

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: cloud

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: cloud

PATH EXPLOSION

Large memory consumptionCPU Intensive

Page 14: cloud

Large memory consumptionCPU Intensive

Page 15: cloud

We massively parallelize in the cloud

Page 16: cloud

CHALLENGES

• Tree structure is not known a priori

15

Page 17: cloud

CHALLENGES

• Tree structure is not known a priori

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

15

Page 18: cloud

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: cloud

CHALLENGES

• State transfer

• Avoid work and memory redundancy

• Coordination

16

Page 20: cloud

OVERVIEW

• System Interface

• Parallel Symbolic Execution

• Cloud9 Design

• Preliminary Results

17

Page 21: cloud

TREE EXPLORATION

Explorationfrontier

Exploration strategy = which node to expand next?

w1

w2

18

Page 22: cloud

TREE EXPLORATION

Explorationfrontier

Exploration strategy = which node to expand next?

w1

w2

18

Page 23: cloud

LOAD BALANCING

w1 w2

LB

19

Page 24: cloud

LOAD BALANCING

w1 w2

LB

19

negotiate

Page 25: cloud

LOAD BALANCING

w1 w2

LB

19

Page 26: cloud

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: cloud

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: cloud

OVERVIEW

• System Interface

• Parallel Symbolic Execution

• Cloud9 Design

• Preliminary Results

22

Page 29: cloud

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: cloud

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: cloud

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: cloud

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: cloud

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