Tata AIG General Insurance Company - Insurer Innovation Award 2024
Â
Is BDD Worth It? Considerations for Advanced Test Automation
1. Is BDD Worth It? Considerations for
Advanced Test Automation
2. Eran Kinsbruner
⢠Chief Evangelist, Product Manager, and Author at Perfecto by Perforce
⢠Blogger, Inventor, and Speaker
⢠20+ years in software development & testing
⢠Author of:
⢠The Digital Quality Handbook
⢠Continuous Testing for DevOps Professionals
⢠Accelerating Software Quality
⢠Twitter: @ek121268
3. perfecto.io
3 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Behavior Driven Development (BDD) Definition
Source: Tricentis OSS Report 2020 Source: Dzone - John f. Smart
4. perfecto.io
4 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Behavior Driven Development (BDD) is a synthesis and refinement of practices stemming from Test Driven Development
(TDD) and Acceptance Test Driven Development (ATDD). BDD augments TDD and ATDD with the following tactics:
⢠Apply the âFive Whyâsâ principle to each proposed user story, so that its purpose is clearly related
to business outcomes.
⢠Thinking âfrom the outside inâ â in other words, implement only those behaviors which contribute
most directly to these business outcomes to minimize waste.
⢠Describe behaviors in a single notation which is directly
accessible to domain experts, testers,
and developers to improve communication.
⢠Apply these techniques all the way down to the lowest levels
of abstraction of the software, paying particular attention to the
distribution of behavior, so that evolution remains cheap.
Behavior Driven Development (BDD) Definition
Source: Agile Alliance
5. perfecto.io
5 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
The 3 Amigos
Source: Embrace DevOps
6. perfecto.io
6 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
In Gherkin, each line that isn't blank has to start with a
Gherkin keyword, followed by any text you like.
The main keywords are:
⢠Feature
⢠Scenario
⢠Given, When, Then, And, But (Steps)
⢠Background (Pre-requisites to avoid repetition
across scenarios)
⢠Scenario Outline
⢠Examples
Gherkin Primer/101
https://cucumber.io/docs/gherkin/reference/
There are a few extra keywords as well:
⢠""" (Doc Strings)
⢠| (Data Tables)
⢠@ (Tags)
⢠# (Comments)
7. perfecto.io
7 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Gherkin Scenarios & Outline
https://cucumber.io/docs/gherkin/reference/
8. perfecto.io
8 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Example Based Testing â BDD
Source: John F. Smart - BDD In Action
9. perfecto.io
9 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Differences Between BDD, TDD, and ATDD
⢠TDD is rather a paradigm than a process. It describes the cycle of
writing a test first, and application code afterwards â followed by
an optional refactoring.
⢠TDD doesnât make any statements about: Where do I begin to
develop? What exactly should I test? How should tests be
structured and named?
⢠BDD always start with the piece of functionality thatâs most
important to your user.
⢠TDD and BDD have language differences. BDD tests are written in
an English-like language.
⢠BDD is customer-focused while ATDD leans towards the
developer-focused side of things like [Unit] TDD does. This allows
much easier collaboration with non-techie stakeholders than TDD.
⢠BDD gives a clearer understanding as to what the system should
do from the perspective of the developer and the customer.
⢠BDD focuses on the behavioral aspect of the system, unlike TDD
which focuses on the implementation aspect of the system.
⢠ATDD focuses on capturing requirements in acceptance tests and
uses them to drive the development. (Does the system do what it
is required to do?)
⢠TDD tools and techniques are usually much more techie in nature,
requiring that you become familiar with the detailed object model
(or in fact create the object model in the process, if doing true
test-first canonical TDD).
⢠TDD allows a good and robust design. Still, your tests can be very
far away from the users' requirements. BDD is a way to ensure
consistency between requirements and the developer tests.
⢠TDD allows for a good and robust design. Still, your tests can be
very far from the users' requirements. BDD is a way to ensure
consistency between requirements and the developer tests.
11. perfecto.io
11 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Quantum Architecture
Perfecto Advanced
Reporting
Object Spy
Repository
file
Live Dashboard
Cucumber BDD test
Test Java/JS code
testNG
Perfecto utils
Pre-defined steps
User
advance
code
Script Creation Execute Report
Access to devices
Remote debugging
Real devices and desktop browsers
Manual Services
12. perfecto.io
12 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Quantum Scenarios Example
Test -Feature files
Pre define steps
by Perfecto
Logical steps
created by
customers
13. perfecto.io
13 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Quantum Step Definitions
Test feature files
Pre-defined steps
created by
Perfecto
Logical steps
created by
customers
14. perfecto.io
14 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Quantum Architecture
objectID = locatorID = locator
search.text.box = {"locator":"name=q","desc":"Search Text Box"}
15. perfecto.io
15 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Quantum Project Structure
BDD
Logical commands
Java tests for Java coder testers
Perfecto extensions
TestNG execution
Data repository
Cloud/app configuration file
16. perfecto.io
16 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Quantum Driver Configuration (Web vs. Mobile)
Appium
Selenium
17. perfecto.io
17 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Quantum â API Test Automation With BDD
Create the
API Details
in JSON File
Create a
Gherkin
Scenario to
Test the API
18. perfecto.io
18 | Perfecto by Perforce Š 2021 Perforce Software, Inc.
Quantum â API Test Automation With BDD
TestNG Execution
Configuration
Examine Report
(Perfecto/External
Framework)
19. perfecto.io
19 | Perfecto by Perforce Š 2020 Perforce Software, Inc.
BDD â Which Testing Types?
Functional and End-to-End Testing:
Business Behavior Flows
⢠Mobile App Testing
⢠Appium & Gherkin
⢠Cross-Browser Testing
⢠Selenium & Gherkin
⢠Cypress & Gherkin
⢠API Testing
https://www.perfecto.io/behavior-driven-development-testing