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 ...
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/...
Auto-testThe plugin will monitor the project directory and will attempt torun only the subset of tests affected by what ch...
Autotest 1.01
Infinitest
Tip: Ignoring Integration Tests
Criteria: Spock
Test Execution in codingenvironment, interactive results.
Scores                  Spock Tests in   Results in   Auto-run   Interactive Score                        same env   same ...
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
Upcoming SlideShare
Loading in …5
×

Continous testing for grails

2,474 views

Published on

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

Published in: Technology, Education
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,474
On SlideShare
0
From Embeds
0
Number of Embeds
63
Actions
Shares
0
Downloads
16
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • TDD alternates between Green, Red.
  • Really Running the Tests, alternating Red/GreenNot batching
  • Unit tests are FastGood tooling supportWork without spinningup Grails.
  • Continuous Testing Idea Started @MIT, 2004in backgroundreduce time & effort to runReduce Change size if a problem is foundSame as Continuous Compilation for dev, or CI for an organisation.Work by watching .class files on disk. Save->Compile->Tests Run
  • Concept: Ignorance time: How long something broken, that you did not know about.Fix Time is correlated with Ignorance time. Same as continuous integration!
  • Issues: Run tests in different environment than coding environment. Alt-Tab to run tests, get results.
  • GoodColor Less Verbose Same JVMPeek @ResultsBad:- Still separate environment
  • InfiniTest was briefly commercialAuto-test is Grails only, no IDE integrations.JUnitMax – status?
  • Good:Fairly dumb heuristicsBad: Separate environment.
  • Demo-------Prefs/EnableRebuild project – tests run when classes change.Change AnotherClass.*Smart* about what to run… sometimes misses things.Open source – feel free to add fixes!Shows errs for all open projects.Won't run if compilation errs in any open projects.
  • Continous testing for grails

    1. 1. Continuous Testing for Grails Jeff Winkler
    2. 2. TDD FTW http://vinkamat.com/2011/tdd-unit-testing-and-benefits/
    3. 3. TDD http://vinkamat.com/2011/tdd-unit-testing-and-benefits/
    4. 4. TDD Focus: Unit Tests• Types – Junit TestCase – Grails: UnitTestCase – Groovy: TestCase – Spock: Unit Spec
    5. 5. Continuous Testing
    6. 6. Experimental Results on 22 Sophomores, 6.170
    7. 7. • 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
    8. 8. Tool Comparisons• Grails 1.37 vs Grails 2.01• CT: Auto-test, InfiniTest
    9. 9. 1.37: Rinse, Lather, Repeat
    10. 10. 2.01: New Hotness
    11. 11. 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
    12. 12. Auto-testThe plugin will monitor the project directory and will attempt torun only the subset of tests affected by what changed. This isvery rudimentary - for example, if you modify BookControlleror BookControllerTests or BookControllerSpec, it will run test-app BookController
    13. 13. Autotest 1.01
    14. 14. Infinitest
    15. 15. Tip: Ignoring Integration Tests
    16. 16. Criteria: Spock
    17. 17. Test Execution in codingenvironment, interactive results.
    18. 18. Scores Spock Tests in Results in Auto-run Interactive Score same env same env 5 points ResultsTest-app      1IDE (Eclipse)      4Auto-test 1.0.1      6.5InfiniTest      8
    19. 19. TLDR• InfiniTest for IDE users – same environment• Auto-test for non-IDE• Neither is perfect.
    20. 20. Results• MIT Study: Devs 3X more likely to finish task on deadline; 90% would recommend continuous testing.• Try It!
    21. 21. Thanks• winkler1@gmail.com• @winkler1

    ×