SPOCK:
BOLDLY GO
WHERE NO TEST
HAS GONE
BEFORE
ANDRES ALMIRAY
CANOO ENGINEERING A.G.

@AALMIRAY
ABOUT THE SPEAKER
Java developer since the beginning

True believer in open source
Groovy committer since 2007
Project lea...
WHAT IS SPOCK?
Where, Who, How?
■ http://spockframework.org
■ Peter Niederwiser
@pniederw
■ Groovy based Testing
Language
...
FIRST CUT

4
INTRODUCING A BUG

5
A WILD ERROR APPEARS!

6
FEATURE LIST (1)
Blocks
■ given:
■ when:
■ then:
■ expect:
■ where:
■ and:
■ setup:
■ cleanup:

preconditions, data fixtur...
FEATURE LIST (2)
Lifecycle
■ setup
■ cleanup
■ setupSpec
■ cleanupSpec

Data Driven
■ List based variables
■ Table based v...
UNROLLING

9
UNROLLING AS SEEN BY AN IDE

10
INTERACTIONS (MOCKS)

11
BUT WAIT, THERE’S MORE!
■ http://docs.spockframework.org/en/latest
■ Spock is extensible via plugins
■ Functional web test...
THANK
YOU!
@AALMIRAY

HTTP://PEOPLE.CANOO.COM/SHARE/
Upcoming SlideShare
Loading in …5
×

JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before

579 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
579
On SlideShare
0
From Embeds
0
Number of Embeds
73
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before

  1. 1. SPOCK: BOLDLY GO WHERE NO TEST HAS GONE BEFORE ANDRES ALMIRAY CANOO ENGINEERING A.G. @AALMIRAY
  2. 2. ABOUT THE SPEAKER Java developer since the beginning True believer in open source Groovy committer since 2007 Project lead of the Griffon framework Currently working for
  3. 3. WHAT IS SPOCK? Where, Who, How? ■ http://spockframework.org ■ Peter Niederwiser @pniederw ■ Groovy based Testing Language ■ Byte code manipulation at compile time ■ Inspired by JUnit, Rspec, jMock, Moc kito, Groovy, Scala and Why? ■ Expressive testing language ■ Easy to learn ■ Usable from unit to end-toend level ■ Leverages Groovy language features ■ Runs with JUnit: compatible with IDEs, build tools & CI ■ Extensible for specialized testing scenarios 3
  4. 4. FIRST CUT 4
  5. 5. INTRODUCING A BUG 5
  6. 6. A WILD ERROR APPEARS! 6
  7. 7. FEATURE LIST (1) Blocks ■ given: ■ when: ■ then: ■ expect: ■ where: ■ and: ■ setup: ■ cleanup: preconditions, data fixtures, etc. actions that trigger some outcome makes assertions about outcome short alternative to when & then applies varied inputs sub-divides other blocks alias for given post-conditions, housekeeping, etc. 7
  8. 8. FEATURE LIST (2) Lifecycle ■ setup ■ cleanup ■ setupSpec ■ cleanupSpec Data Driven ■ List based variables ■ Table based variables ■ @Unroll ■ @Shared 8
  9. 9. UNROLLING 9
  10. 10. UNROLLING AS SEEN BY AN IDE 10
  11. 11. INTERACTIONS (MOCKS) 11
  12. 12. BUT WAIT, THERE’S MORE! ■ http://docs.spockframework.org/en/latest ■ Spock is extensible via plugins ■ Functional web testing with GEB ■ Plugins exist for Grails and Griffon ■ Next release will be 1.0.0 12
  13. 13. THANK YOU! @AALMIRAY HTTP://PEOPLE.CANOO.COM/SHARE/

×