Testing Storm components with Groovy and Spock

1,998 views

Published on

Ho to use Groovy and Spock framework for testing Java projects. Examples of using Storm testing facility.

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

No Downloads
Views
Total views
1,998
On SlideShare
0
From Embeds
0
Number of Embeds
33
Actions
Shares
0
Downloads
27
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Testing Storm components with Groovy and Spock

  1. 1. TESTING STORM COMPONENTS WITH GROOVY AND SPOCK
  2. 2. About Me Architect @WebMD Java Developer Big Data and NoSQL enthusiast NYC Storm meetup organizer @edvorkin
  3. 3. "It works on my machine" Testing is annoying to the typical programmer. Programmers are driven to create things, build products, add features, and make things work. Testing is just the opposite. It's about finding weaknesses, exploiting edge cases and making it breaks.
  4. 4. "It works on my machine" How to make testing Java applications easy and fast?
  5. 5. Groovy - more productive Java Compiles to byte code Easy to pick up by Java developers Reuse of Java semantics and API
  6. 6. Concise syntax
  7. 7. Concise syntax
  8. 8. Differences from Java Optional typing Optional Exception handling Optional parentheses meta programming
  9. 9. Lambdas -> Closures • Closures are blocks of code that can be treated as first-class objects: passed around as references, stored, executed at arbitrary times, and so on.
  10. 10. Groovy Collections A lot of syntax sugar and convenience methods on collections
  11. 11. JsonSlupper and XmlSlupper Builders - Xml, Json, HTTP
  12. 12. Easy to work with SQL
  13. 13. IDE Support
  14. 14. How to get started?
  15. 15. How to get started? Write tests! Not a production code, easy to get approval.
  16. 16. WHICH TESTING FRAMEWORK CAN I USE WITH GROOVY? SPOCK - BEHAVIOR-DRIVEN TESTING FRAMEWORK
  17. 17. Spock Testing Framework Expressive testing language Easy to Learn Reduce the line of test code Leverage Groovy Productivity Structural blocks - BDD style -context, stimulus, expectation
  18. 18. BDD Style
  19. 19. BDD Style
  20. 20. Mock and Interaction verification
  21. 21. Stubbing Stubbing is the act of making collaborators respond to method calls in a certain way.
  22. 22. Testing Storm components
  23. 23. Testing Storm components
  24. 24. Bolt under the test
  25. 25. Demo
  26. 26. Test Code
  27. 27. Test Code
  28. 28. Some ideas Treat Storm components as regular functions Use backtype.storm.Testing Use Spock Mocks, Stubs and Interactions https://github.com/xumingming/storm-lib/blob/master/sr
  29. 29. Resources
  30. 30. Resources http://docs.spockframework.org/en/latest/ http://groovy.codehaus.org/ http://vimeo.com/43808772 - Venkat Subramaniam - Caring about Code Quality Storm Real-time Processing Cookbook by Quinton Anderson
  31. 31. THANKS.

×