Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java Testing with Spock: why you should get on board with Spock

1,622 views

Published on

An overview of what Spock is and the benefits of using Spock for testing Java applications.
Excerpt from "Java Testing with Spock": http://bit.ly/21DI9Ml

Published in: Internet
  • Be the first to comment

  • Be the first to like this

Java Testing with Spock: why you should get on board with Spock

  1. 1. W H Y Y O U S H O U L D G E T O N B O A R D W I T H S P O C K E X C E R P T F R O M J A VA T E S T I N G W I T H S P O C K B Y K O N S TA N T I N O S K A P E L O N I S
  2. 2. T O D AY, D E V E L O P E R S FA C E G R E AT E R A N D G R E AT E R P R E S S U R E T O P R O D U C E E R R O R - F R E E A P P L I C AT I O N S … .
  3. 3. “How will you sleep at night if you’re not sure these applications are thoroughly tested before reaching production status?” – K O N S TA N T I N O S K A P E L O N I S
  4. 4. S P O C K C A N H E L P.
  5. 5. P H O T O C R E D I T: “ … N I M O Y A S S P O C K ” B Y J A M E S VA U G H N I S L I C E N S E D U N D E R C C B Y 2 . 0 N O , N O T T H I S S P O C K …
  6. 6. A T E S T I N G F R A M E W O R K F O R J AVA ( A N D G R O O V Y ) T H AT C A N A U T O M AT E T H E R E P E T I T I V E A N D M A N U A L P R O C E S S O F T E S T I N G . T H I S S P O C K …
  7. 7. “Spock, a new entry in the test framework arena, challenges the undisputed king - JUnit - armed with a bunch of fresh ideas against the legacy techniques of the past.” – K O N S TA N T I N O S K A P E L O N I S L E A R N M O R E A B O U T H O W S P O C K F I T S I N W I T H O T H E R J AVA T E S T I N G T O O L S .
  8. 8. B U T W H Y S P O C K ?
  9. 9. I T ’ S A O N E S T O P S H O P
  10. 10. “The main reason that I became interested in Spock in the first place is that it comes ‘batteries included,’ with mocking and stubbing supported out of the box.” – K O N S TA N T I N O S K A P E L O N I S
  11. 11. M O C K I N G A N D S T U B B I N G ? T H E C A PA B I L I T Y T O T E S T A S I N G L E C L A S S I N A C O N T R O L L E D E N V I R O N M E N T A N D I S O L A T E I T F R O M T H E O T H E R C L A S S E S I T D E P E N D S O N .
  12. 12. S P O C K C A N T E S T A S I N G L E C L A S S , A C O D E M O D U L E , O R A W H O L E A P P L I C AT I O N .
  13. 13. R E A D A B L E ( E V E N B Y N O N - T E C H N I C A L P E O P L E )
  14. 14. A G N O S T I C Spock can test any class that runs on the JVM, regardless of the original source code. You can even verify both Java and Groovy code in the same Spock test.
  15. 15. “When things go wrong, Spock gives as much detail as possible on the inner workings of the code at the time of failure. ” – K O N S TA N T I N O S K A P E L O N I S FA I L E D S P E C S
  16. 16. T H E W O N D E R S O F S P O C K D O N ’ T E N D T H E R E .
  17. 17. T O L E A R N M O R E , S TA R T R E A D I N G J A VA T E S T I N G W I T H S P O C K N O W. A N D S A V E 2 0 % W I T H C O D E S S 2 0 K A P E L

×