Jvm-bdd-quality-driven
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
734
On Slideshare
734
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
20
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. AMIR BARYLKO QUALITY DRIVEN BEHAVIOUR DRIVEN DEVELOPMENT JVM UG JAN 2012Amir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 2. WHO AM I? • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour!Amir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 3. TESTING Unit tests TDD Integration Tests Acceptance TestsAmir Barylko - BDD Training OCT ‘11 MavenThought Inc.Tuesday, January 10, 2012
  • 4. UNIT TESTING • Test for a class or method • No dependencies • Should use mocking • Small • ClearAmir Barylko - BDD Training OCT ‘11 MavenThought Inc.Tuesday, January 10, 2012
  • 5. TDD • First write a test that fails (RED) • Write code to make it pass (GREEN) • Check if code can be improved (REFACTOR) • Start again until it’s doneAmir Barylko - BDD Training OCT ‘11 MavenThought Inc.Tuesday, January 10, 2012
  • 6. BENEFITS OF TDD • Prove that your code • Regression tests as works byproduct • Avoid waste • Makechanges with (debugging) confidence • Increment code quality • Bring back the joy of coding! • Better designAmir Barylko - BDD Training OCT ‘11 MavenThought Inc.Tuesday, January 10, 2012
  • 7. WHEN TDD IS NOT ENOUGH •Legacy Code •Refactoring is not viable •Verify functionality across layers •Validate feature end to endAmir Barylko - BDD Training OCT ‘11 MavenThought Inc.Tuesday, January 10, 2012
  • 8. INTEGRATION TEST •More than one class •Still some parts can be mocked •Partial functionality of subsystemAmir Barylko - BDD Training OCT ‘11 MavenThought Inc.Tuesday, January 10, 2012
  • 9. ACCEPTANCE TEST •Black box testing •Crossing all layers •Should cover all scenarios •External subsystems may be mockedAmir Barylko - BDD Training OCT ‘11 MavenThought Inc.Tuesday, January 10, 2012
  • 10. SOFTWARE QUALITY What is it? Low Quality Classic QAAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 11. WHAT DOES IT MEAN? • Better code? • Faster delivery? • Less bugs? • Make sure we deliver the right thing? • Better Processes?Amir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 12. LOW QUALITY • Lack of testing • Lack of communication • Lack of metrics • Lack of traceability • Wrong toolsAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 13. CLASSIC QA • Team separated from developments • Follow scripts or requirements • Done after the feature is implemented • May have more than one project in the queue • Feedback cycle may take weeks • Manual (no automation)Amir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 14. DOES IT WORK? •Your opinion here......Amir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 15. A NEW CONCEPT Feature First Benefits Outside In Approach Runnable features RolesAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 16. FEATURE FIRST • Write the feature before implementation • Developers will implement feature using TDD • QA will validate against feature • Repeat until all features are doneAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 17. BENEFITS • Focus on the feature • Testing all the way • Traceability • Quality every step of the processAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 18. OUTSIDE IN APPROACH Red BDD Red Refactor Refactor TDD Green GreenAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 19. RUNNABLE FEATURES • Features describe functionality • What if we could run them? • Then features would validate functionality • Becoming live documentationAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 20. ROLES • Who writes the feature? • Who implements the feature? • Who validates the feature? • What’s the role of QA, PM, etc?Amir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 21. WRITING FEATURES Gherkin Syntax Feature Scenario StepsAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 22. GHERKIN DSL • Business readable DSL • Flush out requirements • Documentation • Automated testing • Used by Cucumber, SpecFlow, jBehaveAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 23. SYNTAX Feature: Listing movies As a User I want to list movies So I can see the contents of the library Scenario: Browse available movies Given I have the following movies When I go to "Movies" Then I should see in the listingAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 24. FEATURES • Keyword Feature • The rest is free text Feature: Listing movies As a User I want to list movies So I can see the contents of the libraryAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 25. SCENARIOS • Each feature file can have multiple scenarios • Each scenario can contain multiple steps • Keywords: • Given When Then • And Not ButAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 26. STEPS Scenario: Browse available movies Given I have some movies When I go to the listing page Then I should see all the moviesAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 27. TOOLS jBehave Scalatest Cucumber + Capybara jDaveAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 28. JBEHAVEAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 29. SCALATESTAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 30. CUCUMBERAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 31. BDD DEMOAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 32. QUESTIONS?Amir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 33. RESOURCES • Contact me: amir@barylko.com, @abarylko • Download: http://www.orthocoders.com/presentationsAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012
  • 34. RESOURCES II • jBehave: http://jbehave.org • Cucumber: http://cukes.info • ScalaTest: http://scalatest.org • Selenium: http://seleniumhq.org • jDave: http://jdave.org • EasyB: http://easyb.orgAmir Barylko - BDD MavenThought Inc.Tuesday, January 10, 2012