Continous testing for grails

21
Continuous Testing for Grails Jeff Winkler

description

Slides presented by Jeff Winkler to the Boston Grails Meetup, 3/28/2012

Transcript of Continous testing for grails

Page 1: Continous testing for grails

Continuous Testing for Grails

Jeff Winkler

Page 2: Continous testing for grails

TDD FTW

http://vinkamat.com/2011/tdd-unit-testing-and-benefits/

Page 3: Continous testing for grails

TDD

http://vinkamat.com/2011/tdd-unit-testing-and-benefits/

Page 4: Continous testing for grails

TDD Focus: Unit Tests

• Types– Junit TestCase– Grails: UnitTestCase– Groovy: TestCase– Spock: Unit Spec

Page 5: Continous testing for grails

Continuous Testing

Page 6: Continous testing for grails

Experimental Results on 22 Sophomores, 6.170

Page 7: Continous testing for grails

• A controlled experiment has shown that continuous testing has a statistically significant effect on developer success in completing a programming task, without affecting time worked. Developers using continuous testing were three times more likely to complete the task before the deadline than those without.

• Most participants found continuous testing to be useful and believed that it helped them write better code faster, and 90% would recommend the tool to others

Page 8: Continous testing for grails

Tool Comparisons

• Grails 1.37 vs Grails 2.01

• CT: Auto-test, InfiniTest

Page 9: Continous testing for grails

1.37: Rinse, Lather, Repeat

Page 10: Continous testing for grails

2.01: New Hotness

Page 11: Continous testing for grails

Continuous Testing Options

• InfiniTest– http://infinitest.github.com/– For IDEA or Eclipse– groups.google.com/group/infinitest-users

• Auto-test– http://grails.org/plugin/auto-test

• JUnitMax from Kent Beck– $100– Health? Not tried

Page 12: Continous testing for grails

Auto-test

The plugin will monitor the project directory and will attempt to run only the subset of tests affected by what changed. This is very rudimentary - for example, if you modify BookController or BookControllerTests or BookControllerSpec, it will run test-app BookController

Page 13: Continous testing for grails

Autotest 1.01

Page 14: Continous testing for grails

Infinitest

Page 15: Continous testing for grails

Tip: Ignoring Integration Tests

Page 16: Continous testing for grails

Criteria: Spock

Page 17: Continous testing for grails

Test Execution in coding environment, interactive results.

Page 18: Continous testing for grails

ScoresSpock Tests in

same envResults in same env

Auto-run5 points

Interactive Results

Score

Test-app 1

IDE (Eclipse) 4

Auto-test 1.0.1 6.5

InfiniTest 8

Page 19: Continous testing for grails

TLDR

• InfiniTest for IDE users– same environment

• Auto-test for non-IDE

• Neither is perfect.

Page 20: Continous testing for grails

Results

• MIT Study: Devs 3X more likely to finish task on deadline; 90% would recommend continuous testing.

• Try It!

Page 21: Continous testing for grails

Thanks

[email protected]• @winkler1