This is a presentation given at gr8conf 2014 in Copenhagen.
The slides are available inβ¦
For Keynote and HTML formats you will need Fira Mono and Horizon BT fonts installed for the slides to render correctly. The PDF has the fonts embedded so it's the best option if you just want to read through the slides.
In addition to the slide there is a small set of example specifications to support the talk. If you have JDK 8 installed you should be able to run the tests using ./gradlew
. JDK 8 is needed as I'm using Nashorn and the Java 8 time API.
- Breaking down long tests using helper methods, mixins & traits are applications of Uncle Bob Martin's Clean Code principles.
- Luke Daley showed me the idea of using
expect
blocks to enforce preconditions. - An emphasis on diagnostic quality is a point made in Growing Object Oriented Software Guided by Tests by Steve Freeman and Nat Pryce.
- I think "never trust a test you haven't seen fail" was a quote from Colin Vipurs' talk on testing anti-patterns at Devoxx UK 2013.
- The section on separating test data from test logic is based on a blog post by J. B. Rainsberger that I can't seem to find now.
- False moniker is an anti-pattern written about by Max Ashton here.
- David Norton of Object Partners wrote about testing JavaScript using Spock and Nashorn.
- Spock is the creation of Peter Niederwieser