Certification: AI-driven Test Automation
Your Progress: out of 26
BDD & SDD
What is BDD?
BDD, which stands for Behavior-Driven Development, is a software development methodology that emphasizes collaboration between developers, QA (Quality Assurance), and non-technical participants in a software project. Its main intent is to allow for the creation of system behavior specifications in a readable, user-friendly format using the Gherkin language.
- Given Eric has a valid Credit or Debit card
- And his account balance is $100
- When he inserts his card
- And withdraws $45
- Then the ATM should return $45
- And his account balance is $55
- Enable business users to outline how the application should operate before its actual development.
- Use these specifications as regression tests to ensure continued proper functionality.
Challenges with BDD
- Specifications: The Gherkin specifications cannot be executed until they are converted into code using tools like Selenium.
- Complexity for business users: The Gherkin language can be unintuitive and hard for non-technical stakeholders to understand and write.
- Maintenance overhead: BDD test implementations become tightly bound to the code, leading to maintenance challenges.
- Dependence on web structures: BDD tests often rely heavily on web page structures (HTML/XML) instead of an end-user perspective. This can lead to brittle tests, especially when UI changes occur.
- Implementation timing: Implementing BDD tests is challenging before the feature is completely developed because it often depends on specific UI elements, like XPaths.
BDD 2.0: Specification-Driven Development (SDD)
SDD, also known as BDD 2.0, is an evolution designed to tackle the challenges posed by traditional BDD.
Key Features of SDD:
- User-Friendly Language: It employs a subset of plain English commands, making it accessible for less technical users.
- End-User Perspective: It does away with the need to rely on web page structure, emphasizing the user’s perspective instead.
- Ready-to-Execute Specifications: SDD specifications are executable immediately, eliminating the need for any coding.
insert "Credit Card" check that page contains "Balance: $100" click "Withdraw" enter "45" into "amount" click "Confirm" enter "1234" into "PIN" click "Complete" check that page contains "Transaction complete" check that money given by ATM is equal to "45" click "Ok" check that page contains "Balance: $55"
Why is SDD a better alternative?
- Simplicity for business users: The plain English commands in SDD are more intuitive, enabling actual business users to draft executable specifications in a language familiar to them.
- Less overhead: SDD bypasses the need for coding tests, which can save time and reduce maintenance challenges.
- End-user focus: Tests are constructed from an end-user’s viewpoint rather than being tied to the underlying code or web page structure.