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.

Bdd for legacy system

616 views

Published on

How to deal with legacy system with BDD

Published in: Technology
  • Be the first to comment

Bdd for legacy system

  1. 1. BDD FOR LEGACY SYSTEM Spin Lai
  2. 2. Testing
  3. 3. Testing, who doesn’t know it?
  4. 4. Testing Unit test Tests the smallest unit of functionality Integration test Test the result combination functions correctly.  Acceptance test Tests on the full system to see whether the application's functionality satisfie s the specification
  5. 5. Testing TDD (Test-driven Development) BDD (Behavior-driven Development) FDD (Feature-driven Development) MDD (Model-driven Development) DDD (Domain-driven Design)
  6. 6. So, what is BDD?
  7. 7. Behavior-driven Development A software development process Emerged from TDD Focus on “what” to test rather than “how” to test Use examples to illustrate behavior Writing test cases in a natural language that non- programmers can read Using Domain Specific Language
  8. 8. Gherkin Language
  9. 9. Gherkin Language Use for describe the test scenarios
  10. 10. Why BDD?
  11. 11. Why BDD ? Executable specifications Business needs tie directly to the code Tests are easier to maintain (stable)
  12. 12. Why BDD ? Provides a common domain language for User / Stakeholder Project Manager Developer QA Encourage collaboration between different roles
  13. 13. The obstacle : Legacy system
  14. 14. Legacy System It wasn’t designed with automation in mind Web elements with no identifier or meaningful classes Limited control of the source code Works, but hard to maintain
  15. 15. So, how?
  16. 16. BDD for legacy system Think about the capabilities Group the scenarios What kind of contexts (the Givens) What kind of outcomes (the Thens) The events (the Whens)
  17. 17. Tools
  18. 18. Tools Selenium Behave PyHamcrest
  19. 19. Selenium Automated web testing framework Selenium IDE Selenium Remote Control Selenium Client API Selenium WebDriver
  20. 20. Selenium Practices UI Mapping Page Object design pattern Three levels of UI test automation
  21. 21. Selenium Practices UI Mapping Page Object design pattern Three levels of UI test automation Source : http://gojko.net/2010/04/13/how-to-implement-ui-testing-without-shooting-yourself-in-the-foot-2/
  22. 22. Behave Feature Scenario Step Tag
  23. 23. Behave - Feature Composed of scenarios Descriptions Backgrounds Tags
  24. 24. Behave - Scenario Describe the behaviors being tested Composed of a series of steps
  25. 25. Behave - Step Take a line each Begin with a keyword “given” “when” “then” “and” “but”
  26. 26. Behave - Tag Can be used on Features Scenarios Scenario outlines Used for controlling your test
  27. 27. PyHamcrest Assertion matcher library Predefined matchers equal_to has_properties contains_string ends_with …
  28. 28. Show time
  29. 29. Recap
  30. 30. Recap BDD isn’t the only way to do testing Use BDD tools to automate scenarios doesn’t means you’re doing BDD Don’t start with tools, start by having conversations Don’t stick to the BDD (Gherkin) format to have conversations
  31. 31. References
  32. 32. References
  33. 33. Q & A

×