An experimental evaluation
- f continuous testing during
An experimental evaluation of continuous testing during development - - PowerPoint PPT Presentation
An experimental evaluation of continuous testing during development David Saff, Michael D. Ernst MIT CSAIL ISSTA 2004 2/29 Overview Continuous testing runs tests in the background to provide feedback as developers code. A controlled
Saff, Ernst: Continuous Testing 2/29
Saff, Ernst: Continuous Testing 3/29
Saff, Ernst: Continuous Testing 4/29
developer changes code system runs tests system notified about changes system notifies about errors
Saff, Ernst: Continuous Testing 5/29
Saff, Ernst: Continuous Testing 6/29
Saff, Ernst: Continuous Testing 7/29
Saff, Ernst: Continuous Testing 8/29
Saff, Ernst: Continuous Testing 9/29
Saff, Ernst: Continuous Testing 10/29
107 total students 34 volunteers 14.5 worked outside monitored environment 19.5 monitored 73 non-volunteers 25% (5.5) no tools 25% (5) compilation notification
50% (9) compilation and test error notification
Saff, Ernst: Continuous Testing 11/29
Years…
…programming 2.8 …using Emacs
…using Java
…using IDE
Saff, Ernst: Continuous Testing 12/29
PS1 PS2 participants 22 17 written lines
150 135 written methods 18 31 time worked (hours) 9.4 13.2 tests 49 82
Saff, Ernst: Continuous Testing 13/29
Never passed Once passed, Now failing
Saff, Ernst: Continuous Testing 14/29
Saff, Ernst: Continuous Testing 15/29
Saff, Ernst: Continuous Testing 16/29
Saff, Ernst: Continuous Testing 17/29
Saff, Ernst: Continuous Testing 18/29
Saff, Ernst: Continuous Testing 19/29
– Just frequent manual testing: 33% success
– All students could run tests with a keypress
Saff, Ernst: Continuous Testing 20/29
Saff, Ernst: Continuous Testing 21/29
Saff, Ernst: Continuous Testing 22/29
Saff, Ernst: Continuous Testing 23/29
(scale: +3 = strongly agree,
Continuous compilation Continuous testing The reported errors often surprised me 1.0 0.7 I discovered problems more quickly 2.0 0.9 I completed the assignment faster 1.5 0.6 I enjoyed using the tool 1.5 0.6 The tool changed the way I worked 1.7 1.7 I was not distracted by the tool 0.5 0.6
Saff, Ernst: Continuous Testing 24/29
Saff, Ernst: Continuous Testing 25/29
Saff, Ernst: Continuous Testing 26/29
Saff, Ernst: Continuous Testing 27/29
Saff, Ernst: Continuous Testing 28/29
– scalability – user confusion
Saff, Ernst: Continuous Testing 29/29
– We’ve built an industrial-strength implementation in Eclipse, including test prioritization and selection
Saff, Ernst: Continuous Testing 30/29
Saff, Ernst: Continuous Testing 31/29
Saff, Ernst: Continuous Testing 32/29
Saff, Ernst: Continuous Testing 33/29
Saff, Ernst: Continuous Testing 34/29
– changing test frequency – reordering tests
testing reduces total development time 10 to 15%
Wasted Time Reduction by Continuous Testing
0.02 0.04 0.06 0.08 0.1 0.12 Observed Changing Test Frequency Reordering Tests Continuous Testing Test Ordering Wasted Time / Total Time Regret Test-wait
Saff, Ernst: Continuous Testing 35/29
Don't use Emacs 45% Don't use Athena 29% Didn't want the hassle 60% Feared work would be hindered 44% Privacy concerns 7%
Students could choose as many reasons as they wished. Other IDE’s cited, in order of popularity:
Saff, Ernst: Continuous Testing 36/29
– already had work habits they didn’t want to change
Saff, Ernst: Continuous Testing 37/29
Years…
…programming
…using Java
…using Emacs
… using IDE
Saff, Ernst: Continuous Testing 38/29
PS1 PS2 participants 22 17 total lines of code 882 804 skeleton lines of code 732 669 written lines
150 135 written classes 4 2 written methods 18 31 time worked (hours) 9.4 13.2
Saff, Ernst: Continuous Testing 39/29
PS1 PS2 tests 49 82 initial failing tests 45 46 lines of code 3299 1444 running time (secs) 3 2 compilation time (secs) 1.4 1.4
Saff, Ernst: Continuous Testing 40/29
Wrapper Junit Test Suite
Test Suite Results
unimplemented tests
Results
Saff, Ernst: Continuous Testing 41/29
Usual environment: Unix 29%, Windows 38%, both 33%
0% 20% 40% 60% 80% 100% Regression Testing Using Emacs to compile Using Emacs for Java Familiar Unfamiliar
Saff, Ernst: Continuous Testing 42/29
– Fixing
:00 :05 :10 :15 :20 :25 :30 :35 :40 :45 :50 :55 :00 xx x x x x x = source edit
Saff, Ernst: Continuous Testing 43/29
Saff, Ernst: Continuous Testing 44/29
Saff, Ernst: Continuous Testing 45/29
Saff, Ernst: Continuous Testing 46/29
Saff, Ernst: Continuous Testing 47/29
Saff, Ernst: Continuous Testing 48/29
PS1 PS2 tests 49 82 initial failing tests 45 46 running time (secs) 3 2 compilation time (secs) 1.4 1.4
Saff, Ernst: Continuous Testing 49/29
Saff, Ernst: Continuous Testing 50/29
Participants Non-participants waited until end to test 31% 51% tested regularly throughout 69% 49% Test frequency (minutes) for those who tested regularly mean 20 18 min 7 3 max 40 60
Saff, Ernst: Continuous Testing 51/29
Saff, Ernst: Continuous Testing 52/29
Saff, Ernst: Continuous Testing 53/29
Saff, Ernst: Continuous Testing 54/29