Continuous Testing in Eclipse David Saff, Michael D. Ernst MIT - - PowerPoint PPT Presentation

continuous testing in eclipse
SMART_READER_LITE
LIVE PREVIEW

Continuous Testing in Eclipse David Saff, Michael D. Ernst MIT - - PowerPoint PPT Presentation

Continuous Testing in Eclipse David Saff, Michael D. Ernst MIT CSAIL eTX 2004, Barcelona, Spain Continuous testing: inspired by continuous compilation Continuous compilation, as in Eclipse, notifies the developer quickly when a syntactic


slide-1
SLIDE 1

Continuous Testing in Eclipse

David Saff, Michael D. Ernst MIT CSAIL eTX 2004, Barcelona, Spain

slide-2
SLIDE 2

Continuous testing: inspired by continuous compilation

  • Continuous compilation, as in Eclipse, notifies

the developer quickly when a syntactic error is introduced:

  • Continuous testing notifies the developer

quickly when a semantic error is introduced:

slide-3
SLIDE 3

Outline

  • Continuous testing: defined and motivated
  • Eclipse plug-in:

– Design principles – User interface design: demo – Software design

  • Next steps
slide-4
SLIDE 4

Outline

  • Continuous testing: defined and motivated
  • Eclipse plug-in:

– Design principles – User interface design: demo – Software design

  • Next steps
slide-5
SLIDE 5

Continuous testing

  • Continuous testing

uses excess cycles

  • n a developer's

workstation to continuously run regression tests in the background as the developer edits code.

developer changes code daemon runs tests IDE listens for changes IDE notifies about errors

slide-6
SLIDE 6

Goals of continuous testing

Continuous testing:

  • No longer forces the developer to decide

whether to test and what tests to run.

  • Prevents long-standing regression errors.*
  • Makes developer confident, not annoyed.

* Saff, Ernst, ISSRE 2003: Reducing wasted development time via continuous testing

slide-7
SLIDE 7

Continuous testing made students more productive

Treatment N Completed assignment No tool 11 27% Continuous compilation 10 50% Continuous testing & continuous compilation 18 78%

p < .03 * Saff, Ernst, ISSTA 2004: An experimental evaluation of continuous testing during development

slide-8
SLIDE 8

Students appreciated continuous testing

I would use continuous testing… Yes …for the rest of the course 94% …for my own programming 80% I would recommend the tool to others 90%

slide-9
SLIDE 9

Outline

  • Continuous testing: defined and motivated
  • Eclipse plug-in:

– Design principles – User interface design: demo – Software design

  • Next steps
slide-10
SLIDE 10

Design principles, 1 of 2

  • Reuse

– Whenever possible, plug in and reuse

  • Future reuse

– When reuse is impossible, copy and paste to show where Eclipse could be more flexible

slide-11
SLIDE 11

Design principles, 2 of 2

  • Consistent experience

– Don’t change expected behavior – Build on current developer metaphors

  • Minimal distraction

– Don’t swamp benefits by sapping attention

  • Testability

– Add testing-specific API’s when necessary

slide-12
SLIDE 12

Outline

  • Continuous testing: defined and motivated
  • Eclipse plug-in:

– Design principles – User interface design: demo – Software design

  • Next steps
slide-13
SLIDE 13

Outline

  • Continuous testing: defined and motivated
  • Eclipse plug-in:

– Design principles – User interface design: demo – Software design

  • Next steps
slide-14
SLIDE 14

Project Source file

* *

Builder

*

Eclipse auto-building: Static structure

RMI builder Java builder

slide-15
SLIDE 15

Project Source file

* *

Builder RMI builder Java builder Delta notifies Build Manager starts Auto-build Thread runs Marker creates

*

changes

*

Eclipse auto-building: Dynamic behavior

updates Problems view

*

slide-16
SLIDE 16

Launch config Launch config type JUnit Application Runtime workbench Launch project has classes

*

Eclipse launching: Static structure

slide-17
SLIDE 17

Launch config Launch config type JUnit Launch project updates Eclipse JVM Launched JVM Launch project Classpath Remote test runner Test runner client Test runner GUI Socket

Eclipse launching: Dynamic behavior (JUnit)

slide-18
SLIDE 18

Project Source file

* *

Builder Java builder Launch config Launch config type Continuous testing Launch project when changes has classes Testing metadata

Continuous Testing Static structure

CT builder

slide-19
SLIDE 19

updates Project Source file

*

Marker creates Launch config Launch config type CT Launch project updates Eclipse JVM Launched JVM Launch project Classpath CT test runner CT runner client CT runner GUI Socket Testing meta- data Testing meta- data when changes

Continuous Testing Dynamic behavior

*

Problems view

JUnit runtime structure copied Problem icon selection hacks internal classes Places we had difficulty Testing multiple asynchronous units is hard Testing multiple asynchronous units is hard

slide-20
SLIDE 20

Suggestions for Eclipse

  • JUnit integration:

– Display results from multiple simultaneous test runs – Allow plug-ins to contribute prioritization

  • Problems view:

– More flexibility in icons

  • Tools for testing asynchrony

– It’s hard to create deterministic unit tests

slide-21
SLIDE 21

Outline

  • Continuous testing: defined and motivated
  • Eclipse plug-in:

– Design principles – User interface design: demo – Software design

  • Next steps
slide-22
SLIDE 22

Next steps: split into individual plug-ins

Current plug-in

Prioritize tests Associate launches with projects Create markers based on test failures Run tests when project changes

slide-23
SLIDE 23

Next steps: feature enhancements

  • Extend to Plug-in Development

Environment

  • Prioritize based on which methods,

classes, etc. changed

  • Use hot-swapping JVM to reduce start-up

time

  • Increase resolution: associate suite with

package? class? method?

slide-24
SLIDE 24

Next steps: test factoring

Expected Result

  • User-supplied test:
  • Factored tests:

Method Call Expected Result Method Call Mock Object Expected Result Method Call

* Saff, Ernst, PASTE 2004: Automatic mock object creation for test factoring

slide-25
SLIDE 25

Further reading

  • Model of developer behavior

– Saff, Ernst, ISSRE 2003: Reducing wasted development time via continuous testing

  • Controlled student experiment

– Saff, Ernst, ISSTA 2004: An experimental evaluation

  • f continuous testing during development
  • Test factoring

– Saff, Ernst, PASTE 2004: Automatic mock object creation for test factoring

slide-26
SLIDE 26

Conclusion

  • Plug-in is publicly available at

http://pag.csail.mit.edu/~saff/continuoustesting.html

  • Many are using and enjoying continuous

testing: give it a try!

  • Eclipse was an excellent platform for

meeting our design goals.

  • Research and implementation continues