Continous testing for grails

Preview:

DESCRIPTION

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

Citation preview

Continuous Testing for Grails

Jeff Winkler

TDD FTW

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

TDD

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

TDD Focus: Unit Tests

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

Continuous Testing

Experimental Results on 22 Sophomores, 6.170

• 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

Tool Comparisons

• Grails 1.37 vs Grails 2.01

• CT: Auto-test, InfiniTest

1.37: Rinse, Lather, Repeat

2.01: New Hotness

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

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

Autotest 1.01

Infinitest

Tip: Ignoring Integration Tests

Criteria: Spock

Test Execution in coding environment, interactive results.

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

TLDR

• InfiniTest for IDE users– same environment

• Auto-test for non-IDE

• Neither is perfect.

Results

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

• Try It!

Thanks

• winkler1@gmail.com• @winkler1