SlideShare a Scribd company logo
Gáspár Nagy
coach • trainer • bdd addict • creator of specflow
@gasparnagy • gaspar@specsolutions.eu
Introducing BDD to Legacy
Applications
with SpecFlow/Cucumber
Agilia Conference 2016 • 6/4/2016
Copyright © Gaspar Nagy
bdd addict
given.when.then
CAUTION!
bddaddict.com
on the stage
Copyright © Gaspar Nagy
What is BDD?
Copyright © Gaspar Nagy
BDD =
Product Ownership +
Collaboration +
Automation
on the product
of requirements
real
Copyright © Gaspar Nagy
Smart Calculator
Demo: BDD Drives
Development
Copyright © Gaspar Nagy
How can I apply this
to legacy apps?
Copyright © Gaspar Nagy
Working with a legacy app is like
renovating a house…
Renovation can be
challenging…
Source: http://kadarkocka.blogspot.com/2011_08_01_archive.html
Copyright © Gaspar Nagy
My Story
The project was delivered in cooperation with TechTalk (www.techtalk.at)
It was modern…
Source: http://irodahaz.info
Complex domain…
106 failing (integration?) tests
Copyright © Gaspar Nagy
… and other challenges
• 17 GB test database
• 46 projects
• 300k lines of code
• >2 minutes build time
Copyright © Gaspar Nagy
What can I do with this?
Copyright © Gaspar Nagy
Source: Wikipedia
Copyright © Gaspar Nagy
The first change request
Deployment –
Workflow
Copyright © Gaspar Nagy
0. Get the infrastructure ready
We need a healthy local dev and CI environment!
• Make a dummy test and get it running!
• Ignore/skip/delete unstable
tests
• Setup the desired testing
model (e.g. SpecFlow)
• Test core dependencies
(e.g. “When I do
something with the
database”)
Copyright © Gaspar Nagy
1. Capture current behavior
• Based on the way it was demoed to you
• Do not worry about automation
• Do not worry about details
• Do not worry about exact phrasing
Copyright © Gaspar Nagy
TDD Cycle
Copyright © Gaspar Nagy
ATDD Cycle
Copyright © Gaspar Nagy
1. Capture current behavior
Red
Copyright © Gaspar Nagy
2. Automate “Then” steps
• Feel free to hard-wire concrete data (IDs)!
Red
Copyright © Gaspar Nagy
3. Improve errors
Our scenario fails. Is it easy to understand why?
• Check the test output and improve if necessary!
Red
Copyright © Gaspar Nagy
Copyright © Gaspar Nagy
4. Automate “When”
with hard-wired data
• We have something to start with!
• (But its obviously nasty with “2347599”)
Green
Copyright © Gaspar Nagy
Copyright © Gaspar Nagy
We need to get rid of the hard-wired
data!
1
2
3
4
5
8
9
#6
7
5. Pick off a bite!
1
2
3
4
5
8
9
#6
7
Aut
#
#’
Copyright © Gaspar Nagy
5. Pick off a bite
Refactor
Copyright © Gaspar Nagy
Copyright © Gaspar Nagy
We have scaffolded our application
for implementing this feature!
Copyright © Gaspar Nagy
6. Describe the new feature
Red
Copyright © Gaspar Nagy
7. Automate and implement
it
• You can even forget that your are maintaining a legacy
app here…
Green
Copyright © Gaspar Nagy
8. Discover corner cases
• We have seen a “happy path” so far…
• But what happens if…
• …there are associated deliverables
• …the package is partially frozen
• …
Copyright © Gaspar Nagy
9. Pick low hanging fruits
• We have developed an automation interface for a part
of the application
• Can we use it to cover other usual cases?
Copyright © Gaspar Nagy
Copyright © Gaspar Nagy
Summary: The first change
request
• We addressed the system through a new feature
• Ensured that the test infrastructure works
• Scaffolded the app with a test for the current behavior
using hard wired data
• Refactored the automation to eliminate some parts of
these data – taken apart a bit of the scaffolding
• Described and implemented the new feature
• Used the automation infrastructure for further tests
Copyright © Gaspar Nagy
The first bug
Copyright © Gaspar Nagy
This is a nasty bug…
• Because
• Workflow is handled by WF 3
• Script is executed on a remote machine through SSH
• A very old dead OSS project is used for SSH (no timeout
setting)
• I cannot even try this out!
Copyright © Gaspar Nagy
Ok… calm down.
We have a process…
Copyright © Gaspar Nagy
1. Capture current behavior
• Do not worry about automation
• Do not worry about details
• Do not worry about exact phrasing
Red
Copyright © Gaspar Nagy
2. How to test SSH?
A focused scenario can drive you to find a solution for
automation
• Find a tool that can be well automated and can be
used for SSH – Vagrant?
• Set it up locally (don’t worry about the automation yet)
• Make the test pass with the local setup
• Do you remember deployment #2347599?
• Refactor: Eliminate hard-wired details
Green
Copyright © Gaspar Nagy
3. Describe bug as a
scenario
Red
Copyright © Gaspar Nagy
4. Fix the bug!
• With the test we could find the bug that was actually in
the SSH library
Green
Copyright © Gaspar Nagy
Shall we keep regression tests?
• It depends…
• If the bug highlighted an important business case –
keep it!
• If it described a special situation (and the bugfix was
covered by unit/integration tests) – delete it!
• Maintaining regression tests is very costly!
Copyright © Gaspar Nagy
Copyright © Gaspar Nagy
Summary: The first bug
• Similarly to new features, addressing the bugs by
capturing the current behavior as scenarios is helpful
• Don’t be afraid of deleting the regression test after
fixing the bug if it does not represent an important
business case
Copyright © Gaspar Nagy
Working on a legacy app does not
mean that you cannot apply BDD
process.
The scenarios can guide you to
discover more and more from the
application!
Copyright © Gaspar Nagy
Happy maintenance!
Gáspár Nagy
coach • trainer • bdd addict • creator of specflow
@gasparnagy • gaspar@specsolutions.eu
Thank you!

More Related Content

Similar to Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Conference 2016)

Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Gáspár Nagy
 
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Gáspár Nagy
 
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Gáspár Nagy
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Gáspár Nagy
 
Jonathon Rochelle @ FOWA Feb 07
Jonathon Rochelle @ FOWA Feb 07Jonathon Rochelle @ FOWA Feb 07
Jonathon Rochelle @ FOWA Feb 07
carsonsystems
 
4gl code parser
4gl code parser 4gl code parser
4gl code parser
Avikal Gupta
 
BDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing StrategyBDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing Strategy
Gáspár Nagy
 
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
Gáspár Nagy
 
The 10 Commandments For The Eager Developer
The 10 Commandments For The Eager DeveloperThe 10 Commandments For The Eager Developer
The 10 Commandments For The Eager Developer
Tsvika Kleinman
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Gáspár Nagy
 
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
ShaiAlmog1
 
Tools and best practices for sustainable software
Tools and best practices for sustainable softwareTools and best practices for sustainable software
Tools and best practices for sustainable software
Green Software Development
 
Tools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdfTools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdf
GeorgMolz
 
Tools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdfTools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdf
GeorgMolz
 
Road to NODES - Blazing Fast Ingest with Apache Arrow
Road to NODES - Blazing Fast Ingest with Apache ArrowRoad to NODES - Blazing Fast Ingest with Apache Arrow
Road to NODES - Blazing Fast Ingest with Apache Arrow
Neo4j
 
OSDC 2018 | Migrating to the cloud by Devdas Bhagat
OSDC 2018 | Migrating to the cloud by Devdas BhagatOSDC 2018 | Migrating to the cloud by Devdas Bhagat
OSDC 2018 | Migrating to the cloud by Devdas Bhagat
NETWAYS
 
Automic Support Tips and Tricks
Automic Support Tips and TricksAutomic Support Tips and Tricks
Automic Support Tips and Tricks
CA | Automic Software
 
Building the Pipeline of My Dreams
Building the Pipeline of My DreamsBuilding the Pipeline of My Dreams
Building the Pipeline of My Dreams
Gene Gotimer
 
QA Fest 2015. Gáspár Nagy. BDD Crash Course for Testers
QA Fest 2015. Gáspár Nagy. BDD Crash Course for TestersQA Fest 2015. Gáspár Nagy. BDD Crash Course for Testers
QA Fest 2015. Gáspár Nagy. BDD Crash Course for Testers
QAFest
 
Using GOCA to Manage OpenNebula - Iguane Solutions
Using GOCA to Manage OpenNebula - Iguane SolutionsUsing GOCA to Manage OpenNebula - Iguane Solutions
Using GOCA to Manage OpenNebula - Iguane Solutions
Sally Laouacheria
 

Similar to Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Conference 2016) (20)

Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
 
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
 
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
Jonathon Rochelle @ FOWA Feb 07
Jonathon Rochelle @ FOWA Feb 07Jonathon Rochelle @ FOWA Feb 07
Jonathon Rochelle @ FOWA Feb 07
 
4gl code parser
4gl code parser 4gl code parser
4gl code parser
 
BDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing StrategyBDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing Strategy
 
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
 
The 10 Commandments For The Eager Developer
The 10 Commandments For The Eager DeveloperThe 10 Commandments For The Eager Developer
The 10 Commandments For The Eager Developer
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
 
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
 
Tools and best practices for sustainable software
Tools and best practices for sustainable softwareTools and best practices for sustainable software
Tools and best practices for sustainable software
 
Tools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdfTools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdf
 
Tools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdfTools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdf
 
Road to NODES - Blazing Fast Ingest with Apache Arrow
Road to NODES - Blazing Fast Ingest with Apache ArrowRoad to NODES - Blazing Fast Ingest with Apache Arrow
Road to NODES - Blazing Fast Ingest with Apache Arrow
 
OSDC 2018 | Migrating to the cloud by Devdas Bhagat
OSDC 2018 | Migrating to the cloud by Devdas BhagatOSDC 2018 | Migrating to the cloud by Devdas Bhagat
OSDC 2018 | Migrating to the cloud by Devdas Bhagat
 
Automic Support Tips and Tricks
Automic Support Tips and TricksAutomic Support Tips and Tricks
Automic Support Tips and Tricks
 
Building the Pipeline of My Dreams
Building the Pipeline of My DreamsBuilding the Pipeline of My Dreams
Building the Pipeline of My Dreams
 
QA Fest 2015. Gáspár Nagy. BDD Crash Course for Testers
QA Fest 2015. Gáspár Nagy. BDD Crash Course for TestersQA Fest 2015. Gáspár Nagy. BDD Crash Course for Testers
QA Fest 2015. Gáspár Nagy. BDD Crash Course for Testers
 
Using GOCA to Manage OpenNebula - Iguane Solutions
Using GOCA to Manage OpenNebula - Iguane SolutionsUsing GOCA to Manage OpenNebula - Iguane Solutions
Using GOCA to Manage OpenNebula - Iguane Solutions
 

More from Gáspár Nagy

Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023
Gáspár Nagy
 
Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)
Gáspár Nagy
 
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Gáspár Nagy
 
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
Gáspár Nagy
 
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Gáspár Nagy
 
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Gáspár Nagy
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Gáspár Nagy
 
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
Gáspár Nagy
 

More from Gáspár Nagy (8)

Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023
 
Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)
 
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
 
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
 
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
 
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
 
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
 

Recently uploaded

VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
jealousviolet
 
Mobile App Development Company in Noida - Drona Infotech.
Mobile App Development Company in Noida - Drona Infotech.Mobile App Development Company in Noida - Drona Infotech.
Mobile App Development Company in Noida - Drona Infotech.
Mobile App Development Company in Noida - Drona Infotech
 
Il Data Streaming per un’AI real-time di nuova generazione
Il Data Streaming per un’AI real-time di nuova generazioneIl Data Streaming per un’AI real-time di nuova generazione
Il Data Streaming per un’AI real-time di nuova generazione
confluent
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
akshesh doshi
 
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptxWired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
SimonedeGijt
 
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning
VishrutGoyani1
 
UMiami degree offer diploma Transcript
UMiami degree offer diploma TranscriptUMiami degree offer diploma Transcript
UMiami degree offer diploma Transcript
attueb
 
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
kiara pandey
 
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
ashiklo9823
 
IoT In Manufacturing_ Use Cases, Benefits, and Challenges.pdf
IoT In Manufacturing_ Use Cases, Benefits, and Challenges.pdfIoT In Manufacturing_ Use Cases, Benefits, and Challenges.pdf
IoT In Manufacturing_ Use Cases, Benefits, and Challenges.pdf
mohitd6
 
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
revolutionary575
 
Attendance Tracking From Paper To Digital
Attendance Tracking From Paper To DigitalAttendance Tracking From Paper To Digital
Attendance Tracking From Paper To Digital
Task Tracker
 
welcome to presentation on Google Apps
welcome to   presentation on Google Appswelcome to   presentation on Google Apps
welcome to presentation on Google Apps
AsifKarimJim
 
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
Srinivas Dukka
 
Blockchain in Agricultural Traceability Use Cases in 2024.pdf
Blockchain in Agricultural Traceability Use Cases in 2024.pdfBlockchain in Agricultural Traceability Use Cases in 2024.pdf
Blockchain in Agricultural Traceability Use Cases in 2024.pdf
Natsoft Corporation
 
GT degree offer diploma Transcript
GT degree offer diploma TranscriptGT degree offer diploma Transcript
GT degree offer diploma Transcript
attueb
 
Independent Girls call Service Pune 000XX00000 Provide Best And Top Girl Serv...
Independent Girls call Service Pune 000XX00000 Provide Best And Top Girl Serv...Independent Girls call Service Pune 000XX00000 Provide Best And Top Girl Serv...
Independent Girls call Service Pune 000XX00000 Provide Best And Top Girl Serv...
bhumivarma35300
 
Authentication Review-June -2024 AP & TS.pptx
Authentication Review-June -2024 AP & TS.pptxAuthentication Review-June -2024 AP & TS.pptx
Authentication Review-June -2024 AP & TS.pptx
DEMONDUOS
 
當測試開始左移
當測試開始左移當測試開始左移
當測試開始左移
Jersey (CHE-PING) Su
 
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
3610stuck
 

Recently uploaded (20)

VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
VVIP Girls Call Mumbai 9910780858 Provide Best And Top Girl Service And No1 i...
 
Mobile App Development Company in Noida - Drona Infotech.
Mobile App Development Company in Noida - Drona Infotech.Mobile App Development Company in Noida - Drona Infotech.
Mobile App Development Company in Noida - Drona Infotech.
 
Il Data Streaming per un’AI real-time di nuova generazione
Il Data Streaming per un’AI real-time di nuova generazioneIl Data Streaming per un’AI real-time di nuova generazione
Il Data Streaming per un’AI real-time di nuova generazione
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
 
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptxWired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
 
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning
 
UMiami degree offer diploma Transcript
UMiami degree offer diploma TranscriptUMiami degree offer diploma Transcript
UMiami degree offer diploma Transcript
 
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
 
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
 
IoT In Manufacturing_ Use Cases, Benefits, and Challenges.pdf
IoT In Manufacturing_ Use Cases, Benefits, and Challenges.pdfIoT In Manufacturing_ Use Cases, Benefits, and Challenges.pdf
IoT In Manufacturing_ Use Cases, Benefits, and Challenges.pdf
 
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
 
Attendance Tracking From Paper To Digital
Attendance Tracking From Paper To DigitalAttendance Tracking From Paper To Digital
Attendance Tracking From Paper To Digital
 
welcome to presentation on Google Apps
welcome to   presentation on Google Appswelcome to   presentation on Google Apps
welcome to presentation on Google Apps
 
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
 
Blockchain in Agricultural Traceability Use Cases in 2024.pdf
Blockchain in Agricultural Traceability Use Cases in 2024.pdfBlockchain in Agricultural Traceability Use Cases in 2024.pdf
Blockchain in Agricultural Traceability Use Cases in 2024.pdf
 
GT degree offer diploma Transcript
GT degree offer diploma TranscriptGT degree offer diploma Transcript
GT degree offer diploma Transcript
 
Independent Girls call Service Pune 000XX00000 Provide Best And Top Girl Serv...
Independent Girls call Service Pune 000XX00000 Provide Best And Top Girl Serv...Independent Girls call Service Pune 000XX00000 Provide Best And Top Girl Serv...
Independent Girls call Service Pune 000XX00000 Provide Best And Top Girl Serv...
 
Authentication Review-June -2024 AP & TS.pptx
Authentication Review-June -2024 AP & TS.pptxAuthentication Review-June -2024 AP & TS.pptx
Authentication Review-June -2024 AP & TS.pptx
 
當測試開始左移
當測試開始左移當測試開始左移
當測試開始左移
 
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
 

Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Conference 2016)

  • 1. Gáspár Nagy coach • trainer • bdd addict • creator of specflow @gasparnagy • gaspar@specsolutions.eu Introducing BDD to Legacy Applications with SpecFlow/Cucumber Agilia Conference 2016 • 6/4/2016
  • 2. Copyright © Gaspar Nagy bdd addict given.when.then CAUTION! bddaddict.com on the stage
  • 3. Copyright © Gaspar Nagy What is BDD?
  • 4. Copyright © Gaspar Nagy BDD = Product Ownership + Collaboration + Automation on the product of requirements real
  • 5. Copyright © Gaspar Nagy Smart Calculator Demo: BDD Drives Development
  • 6. Copyright © Gaspar Nagy How can I apply this to legacy apps?
  • 7. Copyright © Gaspar Nagy Working with a legacy app is like renovating a house…
  • 8. Renovation can be challenging… Source: http://kadarkocka.blogspot.com/2011_08_01_archive.html
  • 9. Copyright © Gaspar Nagy My Story The project was delivered in cooperation with TechTalk (www.techtalk.at)
  • 10. It was modern… Source: http://irodahaz.info
  • 13. Copyright © Gaspar Nagy … and other challenges • 17 GB test database • 46 projects • 300k lines of code • >2 minutes build time
  • 14. Copyright © Gaspar Nagy What can I do with this?
  • 17. Copyright © Gaspar Nagy The first change request
  • 19. Copyright © Gaspar Nagy 0. Get the infrastructure ready We need a healthy local dev and CI environment! • Make a dummy test and get it running! • Ignore/skip/delete unstable tests • Setup the desired testing model (e.g. SpecFlow) • Test core dependencies (e.g. “When I do something with the database”)
  • 20. Copyright © Gaspar Nagy 1. Capture current behavior • Based on the way it was demoed to you • Do not worry about automation • Do not worry about details • Do not worry about exact phrasing
  • 21. Copyright © Gaspar Nagy TDD Cycle
  • 22. Copyright © Gaspar Nagy ATDD Cycle
  • 23. Copyright © Gaspar Nagy 1. Capture current behavior Red
  • 24. Copyright © Gaspar Nagy 2. Automate “Then” steps • Feel free to hard-wire concrete data (IDs)! Red
  • 25. Copyright © Gaspar Nagy 3. Improve errors Our scenario fails. Is it easy to understand why? • Check the test output and improve if necessary! Red
  • 27. Copyright © Gaspar Nagy 4. Automate “When” with hard-wired data • We have something to start with! • (But its obviously nasty with “2347599”) Green
  • 29. Copyright © Gaspar Nagy We need to get rid of the hard-wired data!
  • 31. 5. Pick off a bite! 1 2 3 4 5 8 9 #6 7 Aut # #’
  • 32. Copyright © Gaspar Nagy 5. Pick off a bite Refactor
  • 34. Copyright © Gaspar Nagy We have scaffolded our application for implementing this feature!
  • 35. Copyright © Gaspar Nagy 6. Describe the new feature Red
  • 36. Copyright © Gaspar Nagy 7. Automate and implement it • You can even forget that your are maintaining a legacy app here… Green
  • 37. Copyright © Gaspar Nagy 8. Discover corner cases • We have seen a “happy path” so far… • But what happens if… • …there are associated deliverables • …the package is partially frozen • …
  • 38. Copyright © Gaspar Nagy 9. Pick low hanging fruits • We have developed an automation interface for a part of the application • Can we use it to cover other usual cases?
  • 40. Copyright © Gaspar Nagy Summary: The first change request • We addressed the system through a new feature • Ensured that the test infrastructure works • Scaffolded the app with a test for the current behavior using hard wired data • Refactored the automation to eliminate some parts of these data – taken apart a bit of the scaffolding • Described and implemented the new feature • Used the automation infrastructure for further tests
  • 41. Copyright © Gaspar Nagy The first bug
  • 42. Copyright © Gaspar Nagy This is a nasty bug… • Because • Workflow is handled by WF 3 • Script is executed on a remote machine through SSH • A very old dead OSS project is used for SSH (no timeout setting) • I cannot even try this out!
  • 43. Copyright © Gaspar Nagy Ok… calm down. We have a process…
  • 44. Copyright © Gaspar Nagy 1. Capture current behavior • Do not worry about automation • Do not worry about details • Do not worry about exact phrasing Red
  • 45. Copyright © Gaspar Nagy 2. How to test SSH? A focused scenario can drive you to find a solution for automation • Find a tool that can be well automated and can be used for SSH – Vagrant? • Set it up locally (don’t worry about the automation yet) • Make the test pass with the local setup • Do you remember deployment #2347599? • Refactor: Eliminate hard-wired details Green
  • 46. Copyright © Gaspar Nagy 3. Describe bug as a scenario Red
  • 47. Copyright © Gaspar Nagy 4. Fix the bug! • With the test we could find the bug that was actually in the SSH library Green
  • 48. Copyright © Gaspar Nagy Shall we keep regression tests? • It depends… • If the bug highlighted an important business case – keep it! • If it described a special situation (and the bugfix was covered by unit/integration tests) – delete it! • Maintaining regression tests is very costly!
  • 50. Copyright © Gaspar Nagy Summary: The first bug • Similarly to new features, addressing the bugs by capturing the current behavior as scenarios is helpful • Don’t be afraid of deleting the regression test after fixing the bug if it does not represent an important business case
  • 51. Copyright © Gaspar Nagy Working on a legacy app does not mean that you cannot apply BDD process. The scenarios can guide you to discover more and more from the application!
  • 52. Copyright © Gaspar Nagy Happy maintenance!
  • 53. Gáspár Nagy coach • trainer • bdd addict • creator of specflow @gasparnagy • gaspar@specsolutions.eu Thank you!