Testable requirements
-
Upload
wyn-b-van-devanter -
Category
Software
-
view
706 -
download
0
Transcript of Testable requirements
![Page 1: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/1.jpg)
Requirements Delivery – Using Examples
![Page 2: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/2.jpg)
About Us
Bharti Rupani@[email protected] https://www.linkedin.com/in/bhartir
Wyn Van Devanter @[email protected]://www.linkedin.com/in/wyntuitionhttp://www.slideshare.net/wynvandevanter
![Page 3: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/3.jpg)
Terminology• Specification by Example• Executable Specifications• Automated Acceptance Tests (AAT)• Behavior Driven Development (BDD)• Acceptance Test Driven Development (ATDD)
• Testable Requirements
![Page 4: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/4.jpg)
“Specifications by examples are acceptance tests”
- Gajko Adzic
![Page 5: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/5.jpg)
Testable Requirements • User Journeys • Deliver business value• Clear examples • Executable
![Page 6: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/6.jpg)
Why should you care? • Clearly communicate the specifications• No functional gaps • Verify business rules • Build the right thing
6
![Page 7: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/7.jpg)
Building Quality
Plan Collaborate Deliver
Build the right thing
Build the thing right
![Page 8: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/8.jpg)
Developing Examples
Collaboration
Prioritized Backlog
Business Goals User Journey
User Story 2
Acceptance Criteria 1
Example 1
User Story 1
Acceptance Criteria 1
Example 1
Acceptance Criteria 2
Example 1
![Page 9: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/9.jpg)
Collaborate How do I code this feature?What are
the details of this
feature?
How do I validate that this work is done?
![Page 10: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/10.jpg)
Three Amigos • Business Analyst, Developers and Testers • Collaborate • Share knowledge • Think about the desired outcome • Shared understanding
![Page 11: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/11.jpg)
User JourneyYou are a Business Analyst that is looking for a conference to attend.
![Page 12: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/12.jpg)
Example of using an Example Attend BA
Conference
View Results
Region Date
View DCBADD
Details
View information
about IIBADC
View speaker profiles View Cost
Select DCBADD
Register via Eventbrite
Determine Discounts
![Page 13: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/13.jpg)
User StoryAs a business analyst, I want to review the various IIBA discounts available so that I can pay a reduced ticket price for DCBADD.
![Page 14: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/14.jpg)
What is Gherkin?• Business readable, domain specific language• Connects human concept of cause and effect to software
concept of input/process/output• Can be interpreted by automation tools to drive
acceptance tests
![Page 16: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/16.jpg)
ScenariosScenario: Standard RateGiven I am purchasing a ticket to DCBADDAnd I am not an IIBA memberWhen I view my ticket priceThen I see the full rate of $200
Scenario: IIBA RateGiven I am purchasing a ticket to DCBADDAnd I am an IIBA member When I view my ticket price Then I see the discounted rate of $150
![Page 17: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/17.jpg)
ExampleScenario Outline: Determine DCBADD ticket priceGiven I am purchasing a ticket to DCBADDAnd I am a “<membership type>”When I view my ticket priceThen I see the discounted “<ticket price>”
Examples:membership pricenonmember $200
IIBA national $150
IIBA DC $125
![Page 18: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/18.jpg)
ExampleUsing tables as arguments as input to a Given or as expected output from a Then:
Scenario: Validate Order TotalGiven I am a business analyst And I am purchasing multiple tickets with varying “<membership type>” to DCBADD:
When I view my total Then I see my “<total>”
ticket number & type price2 nonmember $4001 IIBA national $150
![Page 19: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/19.jpg)
Guidelines• Be precise• Make sure it’s testable • Focus on business functionality • Avoid specific details • Use active voice, not passive• Have a single action trigger the expected behavior
(WHEN condition)• Use parameters for concise expression of examples (i.e.
scenario outlines)
![Page 20: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/20.jpg)
Automating the scenarios
![Page 21: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/21.jpg)
Automated Acceptance Tests (AATs)
• Code automates them• They run constantly
![Page 22: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/22.jpg)
Why Have AATs? (Pros)
![Page 23: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/23.jpg)
Communication• Helps specify behavior of the system in plain text• Provides a medium for non-tech and devs to agree on
Are we talking about the right system?
![Page 24: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/24.jpg)
Seams, unit test mistakes
![Page 25: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/25.jpg)
Automation
“There’s no place for human beings to be doing regression testing manually.”
-Jez Humble
![Page 26: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/26.jpg)
Speedier deployments
![Page 27: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/27.jpg)
Save resources
![Page 28: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/28.jpg)
More testing during development
![Page 29: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/29.jpg)
Why NOT Have AATs? (Cons)
![Page 30: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/30.jpg)
Why don’t more people use them?
![Page 31: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/31.jpg)
Why NOT have AATs?• Maintenance • Speed• High false negatives, non-determinism
![Page 32: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/32.jpg)
Impediments • Poor adoption • Bandwidth/Velocity• Learning Curve/Experience• Business users won’t write specifications• Developers won’t automate them • Brittle if recorded
![Page 33: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/33.jpg)
Solutions
![Page 34: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/34.jpg)
Acceptance Test Strategy
• Happy paths• Major unhappy paths• Legacy• Regression
![Page 35: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/35.jpg)
Minimize # of end-to-end tests• AATs for journeys, not stories• Is your new story entirely new?• Balance high # of unit tests + selected end-to-end &
acceptance
![Page 36: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/36.jpg)
GherkinSpecs shouldn’t have much setup code
Given my friend ‘Bob’ typed ‘I’m excited’ into the text boxAnd clicks the Post button on my timelineWhen I press the Like link on the postThen the screen should say ‘Like’And should include my name as liking it
Given my friend ‘Bob’ has posted ‘I’m excited’And I am on my timelineWhen I like on the postThen the post should be liked by me
![Page 37: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/37.jpg)
General Tips• Create different levels of suites depending on depth/level
of feedback desired:• Smoke, Current iteration/sprint, Regression
• Run AATs as close to the real environment as possible
![Page 38: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/38.jpg)
When Acceptances Tests catches a bug• See why bug got through unit/integration tests• Add unit, integration tests • Prune AATs?
![Page 39: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/39.jpg)
UI tests• Sometimes tests will fail if the page doesn’t have enough
time to load. Use implicit waits, and explicit when really needed
• Capture screen shots when tests fail
• Selenium IDE
![Page 40: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/40.jpg)
AAT Workflow
![Page 41: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/41.jpg)
AAT workflow• Start with a scenario(s)
Given my friend ‘Bob’ has posted ‘I’m excited’And I am on my timelineWhen I like on the postThen the post should be liked by me
![Page 42: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/42.jpg)
What can you write them in?Vim
Sublime Text
![Page 43: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/43.jpg)
Tracking AATs
![Page 44: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/44.jpg)
Tracking AATs
![Page 45: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/45.jpg)
Conclusion• Worth the investment if done properly• Very expensive and wasteful if not• Requires collaboration between analysts, testers,
developers • Developers automate the gherkin• Focus on journey and scenarios as opposed to stories
![Page 46: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/46.jpg)
Resources:Books:• Continuous Delivery, Jez Humble, David Farley• Growing Object-Oriented Software, Guided By Tests, Steve Freeman,
Nat Pryce• Specification by Example, Gajko Adzic
Articles:• Automated Acceptance Tests,
http://www.thoughtworks.com/insights/articles/automated-acceptance-tests
• Using SpecFlow with the Page Object, http://blogs.lessthandot.com/index.php/EnterpriseDev/application-lifecycle-management/using-specflow-to
• Maintaining Automated Acceptance Tests (ThoughtWorks), http://www.youtube.com/watch?v=uf0EVbH5hdA
• Creating Maintainable Automated Acceptance Test Suites, Jez Humble,
• http://www.youtube.com/watch?v=v-L_2y6g5DI
![Page 47: Testable requirements](https://reader031.fdocuments.net/reader031/viewer/2022021814/58ef20f71a28abb45a8b45bd/html5/thumbnails/47.jpg)
Thanks!
Bharti Rupani@[email protected] https://www.linkedin.com/in/bhartir
Wyn Van Devanter @[email protected]://www.linkedin.com/in/wyntuitionhttp://www.slideshare.net/wynvandevanter