Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
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/
Nächste SlideShare
Wird geladen in …5
×

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

656 Aufrufe

Veröffentlicht am

Veröffentlicht in: Technologie
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

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/

×