TDD and BDD in Java 8 - what's in it for me?

3,132 views

Published on

How does Java 8 affect the way we practice

Published in: Technology, Education

TDD and BDD in Java 8 - what's in it for me?

  1. 1. and BDD What’s in it for me?
  2. 2. John Ferguson Smart Consultant   Trainer   Mentor   Author   Speaker   Coder
  3. 3. »TDD is not about writing tests »TDD is a design strategy: »Write better-designed code »Have more confidence in our code »Make changes more easily »Write code that meets user requirements more accurately »(and incidentally...) »Build up a comprehensive set of automated tests Test Driven Development
  4. 4. TDD
  5. 5. Behaviour Driven Development
  6. 6. BDD
  7. 7. Lambdas java.time Functional interfaces Streams Type inference Collections API
  8. 8. Dates and Times
  9. 9. Create date constants more easily Date arithmetic that works Works fine with Hamcrest asserts
  10. 10. Lambda Expressions
  11. 11. Conventional for loop
  12. 12. Use lambdas for more expressive expectations
  13. 13. Using a predicate
  14. 14. Lambda expressions + Streams
  15. 15. Retrieve the event locations
  16. 16. Convert directly to a Set
  17. 17. Java 8 and Page Objects
  18. 18. Start off with the business objectives Business requirements
  19. 19. Describe the business flow Business flow
  20. 20. Describe the page interactions Page interactions
  21. 21. Page implementation details HTML details go here
  22. 22. Business  Rules Business  Flow Page/Component   interac8ons Page/Component   details Good automated acceptance tests have layers
  23. 23. Retrieve a list of word definitions Convert WebDriver WebElements to text form
  24. 24. Retrieve a list of word definitions The same thing with streams
  25. 25. Retrieve a list of word definitions Use parallel streams for more optimal WebDriver page querying
  26. 26. Thank You John Ferguson Smart john.smart@wakaleo.com wakaleo http://www.wakaleo.com

×