SlideShare a Scribd company logo
BDD
FOR LEGACY SYSTEM
Spin Lai
Testing
Testing, who doesn’t know it?
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
Testing
TDD (Test-driven Development)

BDD (Behavior-driven Development)

FDD (Feature-driven Development)

MDD (Model-driven Development)

DDD (Domain-driven Design)
So, what is BDD?
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
Gherkin Language
Gherkin Language
Use for describe the test scenarios
Why BDD?
Why BDD ?
Executable specifications

Business needs tie directly to the code

Tests are easier to maintain (stable)
Why BDD ?
Provides a common domain language for

User / Stakeholder

Project Manager

Developer

QA

Encourage collaboration between different roles
The obstacle : Legacy system
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
So, how?
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)
Tools
Tools
Selenium

Behave

PyHamcrest
Selenium
Automated web testing framework 

Selenium IDE

Selenium Remote Control

Selenium Client API

Selenium WebDriver
Selenium Practices
UI Mapping

Page Object design pattern

Three levels of UI test automation
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/
Behave
Feature

Scenario

Step

Tag
Behave - Feature
Composed of scenarios

Descriptions

Backgrounds

Tags
Behave - Scenario
Describe the behaviors being tested

Composed of a series of steps
Behave - Step
Take a line each

Begin with a keyword

“given”

“when”

“then”

“and”

“but”
Behave - Tag
Can be used on

Features

Scenarios

Scenario outlines

Used for controlling your test
PyHamcrest
Assertion matcher library

Predefined matchers

equal_to

has_properties

contains_string

ends_with

…
Show time
Recap
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
References
References
Q & A

More Related Content

DOCX
Tdd blog
PPTX
Behavior Driven Development with AngularJS & Jasmine
PPTX
QA/Test Engineering Perspectives
PDF
Product QA - A test engineering perspective
PDF
Behavior Driven Development (BDD)
PPTX
Behavior Driven Development
PPT
Behavior Driven Development Pros and Cons
PDF
Caring about Code Quality
Tdd blog
Behavior Driven Development with AngularJS & Jasmine
QA/Test Engineering Perspectives
Product QA - A test engineering perspective
Behavior Driven Development (BDD)
Behavior Driven Development
Behavior Driven Development Pros and Cons
Caring about Code Quality

What's hot (20)

KEY
TorontoRb Intro to BDD
PDF
Codesmells for AspectJ
PDF
Code quality as a built-in process
PPT
Test Driven Development
PDF
TDD vs. ATDD - What, Why, Which, When & Where
PPTX
Presentation Test Driven Development
PDF
Introduction to Test Driven Development
PPTX
Quality Assurance
PDF
Test driven development vs Behavior driven development
PDF
Approaching ATDD/BDD
PPT
Agile testing
PDF
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
PDF
The WHY behind TDD/BDD and the HOW with RSpec
DOCX
Experienced Resume
PDF
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
DOC
My Resume
PDF
50 points from the book_How Google tests Software
PPTX
Manual Testing Material by Durgasoft
PPTX
Software presentation
PDF
BDD in Action - Automated Web Testing with WebDriver and Serenity
TorontoRb Intro to BDD
Codesmells for AspectJ
Code quality as a built-in process
Test Driven Development
TDD vs. ATDD - What, Why, Which, When & Where
Presentation Test Driven Development
Introduction to Test Driven Development
Quality Assurance
Test driven development vs Behavior driven development
Approaching ATDD/BDD
Agile testing
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
The WHY behind TDD/BDD and the HOW with RSpec
Experienced Resume
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
My Resume
50 points from the book_How Google tests Software
Manual Testing Material by Durgasoft
Software presentation
BDD in Action - Automated Web Testing with WebDriver and Serenity
Ad

Viewers also liked (20)

PDF
Moving away from legacy code with BDD
PDF
Moving away from legacy code (AgileCymru)
PDF
Legacy Code: Evolve or Rewrite?
PDF
Domain-Driven Design in legacy application
KEY
BDD for Rails Legacy Code
PDF
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
PPTX
DOES14 - Jonny Wooldridge - The Cambridge Satchel Company - 10 Enterprise Tip...
PPT
Introducing bdd elements to unit testing.pptx
PDF
Jvm-bdd-quality-driven
PPTX
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
PDF
ATAAS 2016 - Amol pradhan - Bridging the gap between business and technology ...
PDF
Object-Oriented BDD w/ Cucumber by Matt van Horn
PDF
Impact Map Your Project
PDF
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
ODP
Mock Aren't Stub 讀後心得
PDF
BDD and Test Automation in Evalutionary Product Suite
PDF
BDD com Cucumber
PDF
Impact Maps/Story Maps - liefern was wirklich zählt
PDF
Upcoming events 2017
PDF
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Moving away from legacy code with BDD
Moving away from legacy code (AgileCymru)
Legacy Code: Evolve or Rewrite?
Domain-Driven Design in legacy application
BDD for Rails Legacy Code
20141024 AgileDC 2014 Conf How much testing is enough for software that can c...
DOES14 - Jonny Wooldridge - The Cambridge Satchel Company - 10 Enterprise Tip...
Introducing bdd elements to unit testing.pptx
Jvm-bdd-quality-driven
Agile Tour Pune 2015:Test automation using BDD - Anita Pol and Sachin Salvekar
ATAAS 2016 - Amol pradhan - Bridging the gap between business and technology ...
Object-Oriented BDD w/ Cucumber by Matt van Horn
Impact Map Your Project
10 things about BDD, Cucumber and SpecFlow - Long Version 2016
Mock Aren't Stub 讀後心得
BDD and Test Automation in Evalutionary Product Suite
BDD com Cucumber
Impact Maps/Story Maps - liefern was wirklich zählt
Upcoming events 2017
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Ad

Similar to Bdd for legacy system (20)

PDF
Behavior Driven GUI Testing
PPTX
Tdd and bdd
PPTX
Topic tdd-and-bdd b4usolution
PPTX
Making the Move to Behavior Driven Development
PDF
Intro to TDD & BDD
PDF
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
PDF
2015 in tothebox-introtddbdd
PPTX
Myths and Challenges of Behaviour Driven Development
PPTX
Design your tests to behave - An introduction To BDD!
PPTX
Behavior Driven Development
PDF
Behaviour testing for single-page applications and API’s
PPTX
BDD and Behave
PDF
Whole team approach to agile testing bdd can help better pune 15th meetup
PPTX
Behavior Driven Development
PDF
TDD and BDD in Sky Deutschland
PPTX
Behavior-Driven Development (BDD) and Its Impact on Software Testing.pptx
KEY
Bahaviour Driven Development
PPTX
BDD - beyond: Given, When and Then
PPTX
Test driven development v1.0
PDF
Behavior Driven Development—A Guide to Agile Practices
Behavior Driven GUI Testing
Tdd and bdd
Topic tdd-and-bdd b4usolution
Making the Move to Behavior Driven Development
Intro to TDD & BDD
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
2015 in tothebox-introtddbdd
Myths and Challenges of Behaviour Driven Development
Design your tests to behave - An introduction To BDD!
Behavior Driven Development
Behaviour testing for single-page applications and API’s
BDD and Behave
Whole team approach to agile testing bdd can help better pune 15th meetup
Behavior Driven Development
TDD and BDD in Sky Deutschland
Behavior-Driven Development (BDD) and Its Impact on Software Testing.pptx
Bahaviour Driven Development
BDD - beyond: Given, When and Then
Test driven development v1.0
Behavior Driven Development—A Guide to Agile Practices

More from Spin Lai (6)

PDF
Django User Management & Social Authentication
PDF
Django class based views for beginners
PDF
Two scoops of Django - Security Best Practices
PDF
Speed up your web development
PDF
Hitcon2013 overview
PDF
The django book - Chap10 : Advanced Models
Django User Management & Social Authentication
Django class based views for beginners
Two scoops of Django - Security Best Practices
Speed up your web development
Hitcon2013 overview
The django book - Chap10 : Advanced Models

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
A Presentation on Artificial Intelligence
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
A Presentation on Artificial Intelligence
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Review of recent advances in non-invasive hemoglobin estimation
Mobile App Security Testing_ A Comprehensive Guide.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

Bdd for legacy system