SlideShare a Scribd company logo
1 of 53
Download to read offline
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)

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
 

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...
 
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
 
OpenNebulaConf2019 - How We Use GOCA to Manage our OpenNebula Cloud - Jean-Ph...
OpenNebulaConf2019 - How We Use GOCA to Manage our OpenNebula Cloud - Jean-Ph...OpenNebulaConf2019 - How We Use GOCA to Manage our OpenNebula Cloud - Jean-Ph...
OpenNebulaConf2019 - How We Use GOCA to Manage our OpenNebula Cloud - Jean-Ph...
 
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

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

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Recently uploaded (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 

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!