Spock: A Highly Logical Way To Test*
Spock tests are concise and readable, with excellent support for error reporting and for mock object creation. Spock removes much of the pain from test driven development!
Spock is a fabulous new testing framework for the JVM. Spock leverages all the DSL power of the Groovy language to make testing a breeze. Spock tests are concise and readable, with excellent support for error reporting and for mock object creation. Spock removes much of the pain from test driven development!
Spock is a testing DSL (Domain Specific Language) that transforms the Groovy programming language into a language specifically targeting testing. Spock can be used to test Java, Groovy, or any JVM language.
In Spock, classes are test specifications; methods of those classes are used to describe expected features of the system under specification. Each feature method is broken up into blocks that specify a stimulus (such as invoking a method) and a response (the behavior or state from that method invocation). Spock keeps you honest about what kind of code can appear in each block, and the end result is a highly readable, highly maintainable test.
Spock also has first class support for mock-object testing, and the Spock DSL uses an elegant and obvious syntax to specify how the mock objects interact with the system under specification. Rolled together, Spock is a formidable tool … and makes using any other testing framework a highly illogical choice.
Howard Lewis Ship cut his teeth writing customer support software in
PL/1. He made the jump to Object Oriented programming via NeXTSTEP
and Objective-C before transitioning to Java. He created the initial version of
Tapestry in early 2000, and is currently working on Apache Tapestry 5.2.
Howard is respected in the Java community as an expert on web application development, dependency injection, Java meta-programming, and developer productivity. He is a frequent speaker at JavaOne, NoFluffJustStuff, ApacheCon and other conferences, and the author of “Tapestry in Action” for Manning (covering Tapestry 3.0).
Howard was elected a Java Champion in February 2010.
Howard is an independent consultant, specializing in Tapestry and Clojure training, mentoring and project work. He lives in Portland, Oregon with his wife Suzanne, a novelist, and his son Jacob.
- Title: Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
- Track: Cooking
- Room: B304
- Time: 3:45 – 4:30pm
You’ll learn about the techniques needed to transform classes at runtime, adding new behaviors and addressing cross-cutting concerns. The presentation will discuss a new framework for this specific purpose, but also draw examples from the Apache Tapestry web framework, which itself is rich in meta-programming constructs.
- Speakers: Howard Lewis Ship