SlideShare uma empresa Scribd logo
1 de 101
Baixar para ler offline
Moving away from
legacy code
with BDD
BDD Practice Manager
Creator of Behat - Cucumber
for PHP
Software Engineer turned
Stakeholder whisperer
Konstantin
Kudryashov
@everzet
This talk is about
• Solving purely technical “TCIAM” problem using
behaviour driven development practices and agile
discovery processes
• Planning a delivery strategy on the basis of change
appreciation
• Real-life experience
Legacy projects
How most teams see their
next project
our next
project
our next
project
their actual next
project
Agile, TDD, BDD, etc… // TODO: refactor later
Is it really that bad?
If a project can afford a salary of an engineer
concerned about the project state,
then the project state is not that bad.
// TODO: refactor later
// TODO: refactor later
// TODO: refactor later
This world is full of brilliant projects that nobody
is concerned about. Sadly, it’s often because
there’s no one left to care.
You deliver value
Just not as effectively as you could
Great value + Awful code = Great product yesterday
Great value + Awful code = Great product yesterday
Great value + Great code = Great product tomorrow
Great value + Awful code = Great product yesterday
Great value + Great code = Great product tomorrow
No value + Any code = Awful product anytime
Great value + Awful code = Great product yesterday
No value + Any code = Awful product anytime
Great value + Awful code = Great product yesterday
Great value + Great code = Great product tomorrow
// TODO: refactor laterAgile, TDD, BDD, etc…
Rewrite
all the things!
learning
learning
trash bin
else
learning • Agile
• XP
• BDD
trash bin
else
learning • Agile
• XP
• BDD
trash bin
else
learning • Agile
• XP
• BDD
trash bin
else
Working system
1 year later…
nearly working system
how come?
learning • Agile
• XP
• BDD
trash bin
else
learning • Agile
• XP
• BDD
trash bin
else
legacylegacy
legacylegacy
shiny new
legacylegacy
shiny new
£A
legacylegacy
U
my
features!!!
shiny new
£A
legacylegacy
shiny new
£A
U
my
features!!!
legacylegacy
shiny new
£A + £B
U
my
features!!!
legacylegacy
shiny new
£ U
my
features!!!
£A + £B
my
opportunities!!!
legacylegacy
shiny new
£ U
my
features!!!
£10,000/m
£A + £B
my
opportunities!!!
legacylegacy
shiny new
£ U
my
features!!!
£10,000/m £10,000*x
£A + £B
my
opportunities!!!
legacylegacy
shiny new
£ U
my
features!!!
£A + £B
my
opportunities!!!
legacylegacy
£A + £B
£ U
my
features!!!
shiny new
my
opportunities!!!
legacylegacy
shiny new
£A + £B + £C
my
opportunities!!!
£ U
my
features!!!
legacylegacy
my
opportunities!!!
£
shiny new
£A + £B + £C*?
my
opportunities!!!
£ U
my
features!!!
legacylegacy
my
opportunities!!!
£
my
opportunities!!!
£
it does not work!
Well, not always...
Why do legacy
projects suck?
Cost
Time
cost of change
How do we balance
the cost of change?
Cost
Time
cost of ownership
Cost
Time
cost of ownership
Cost
Time
cost of change
cost of ownership
Cost
Time
rewrite
take ownership only when
you need to support change
… Of change where?
Innovation Predictability
Innovation Predictability
Innovation Predictability
Constant change,
never ideal
Rarest change,
good is good enough
Questionnaire
1. Where is this product going?
2. Which features need to change?
3. How are they going to change?
4. How to support that change?
“BDD Pipeline”
1. Where is this product going?
2. Which features need to change?
3. How are they going to change?
4. How to support that change?
• Impact Mapping
• Value Prioritisation
• Example (3 Amigos) Workshop
• BDD layers
1. Where is this
product going?
Impact Mapping
– Gojko Adzic
“Impact mapping is a strategic planning technique
that prevents organisations from getting lost
while building products and delivering projects,
by clearly communicating assumptions, helping
teams align their activities with overall business
objectives and make better roadmap decisions.”
Four levels of Impact Map
1. Why? are we doing all this (rewrite)? What is the
goal we’re trying to achieve?
2. Who? will be impacted by it?
3. How? can they help us to achieve the goal?
4. What? can we do to support them?
MVP
Product Backlog
In order to buy more products
As a customer
I need to have a product autocompletion in the search field
2. Which features are
going to change?
Value Prioritisation
In order to maintain my shopping history
As a site visitor
I need to be able to register on this site
In order to maintain my shopping history
As a site visitor
I need to be able to register on this site
benefit
actor
SELECT s.*
FROM backlog as s
ORDER BY s.role, s.benefit
LIMIT 25
3. How are these features
going to change?
Example (3 Amigos) workshops
Three layers of a User-Story
• Business rule(s)
• Communication
• Acceptance criteria
Three layers of a User-Story
• Business rule(s)
• Communication in Examples
• Acceptance criteria
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
Scenario: Replaced items should be returned to stock
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
Scenario: ...
Scenario: Replaced items should be returned to stock
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
Scenario: ...
Scenario: ...
Scenario: ...
Scenario: ...
Scenario: ...
Scenario: Replaced items should be returned to stock
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
Given a customer previously bought a black sweater from us
And we currently have three black sweaters left in stock
When customer returns the sweater for a refund
Then we should have four black sweaters in stock
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
4. How to support
that change?
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
Given a customer previously bought a black sweater costing 15$ from us
And we currently have three black sweaters left in stock
When customer returns the sweater for a refund
Then we should have four black sweaters in stock
And customer account should be debited with 15$
Step#1: Identify change area
Step#2: Identify old logic
Step#3: Discuss old logic
1. What should this thing do
2. What if it suddenly stops doing it?
3. How would you know if it doesn't work?
4. How would you know if it does?
Scenario: Replaced items should be returned to stock
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
Scenario: Cost of refunded item should be returned to customer bank account
Scenario: Cost of refunded item should be returned to customer PayPal account
Scenario: Cost of refunded item should be returned to customer via in-shop credits
Scenario: Replaced items should be returned to stock
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
@legacy
Scenario: Cost of refunded item should be returned to customer bank account
@legacy
Scenario: Cost of refunded item should be returned to customer PayPal account
@legacy
Scenario: Cost of refunded item should be returned to customer via in-shop credits
Scenario: Replaced items should be returned to stock
Scenario: Refunded items should be returned to stock
In order to keep track of stock
As a store owner
I want to add items back to stock when they are returned
Feature: Returned items go back to stock
Step#4: Prepare for A change
1. Cover old behaviour in an end-to-end fashion
2. Make sure that scenarios/tests are green
3. Refactor code to make the lower testing possible
4. Convert scenarios/tests to lower level tests
Step#5: Make a change
1. Automate new scenarios
2. Make scenarios green by applying BDD loops
Stories
Examples
Describe
Implement
Design
Working system
1 year later…
Same ashtrays, better system
Stop dreaming of a greater code
Find a way to deliver a greater value
We do that for clients
And help others to do it
http:// .com
Thank you!
@everzet

Mais conteúdo relacionado

Destaque

Devops meetup - Automatizált tesztek
Devops meetup - Automatizált tesztekDevops meetup - Automatizált tesztek
Devops meetup - Automatizált tesztek
Zsolt Takács
 
BDD for Rails Legacy Code
BDD for Rails Legacy CodeBDD for Rails Legacy Code
BDD for Rails Legacy Code
Wei Jen Lu
 
Jvm-bdd-quality-driven
Jvm-bdd-quality-drivenJvm-bdd-quality-driven
Jvm-bdd-quality-driven
Amir Barylko
 

Destaque (20)

Bdd for legacy system
Bdd for legacy systemBdd for legacy system
Bdd for legacy system
 
Taking back BDD
Taking back BDDTaking back BDD
Taking back BDD
 
Legacy Code: Evolve or Rewrite?
Legacy Code: Evolve or Rewrite?Legacy Code: Evolve or Rewrite?
Legacy Code: Evolve or Rewrite?
 
BDD by example
BDD by exampleBDD by example
BDD by example
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projects
 
Modern Project Toolbox
Modern Project ToolboxModern Project Toolbox
Modern Project Toolbox
 
Being effective with legacy projects
Being effective with legacy projectsBeing effective with legacy projects
Being effective with legacy projects
 
BDD в PHP с Behat и Mink
BDD в PHP с Behat и MinkBDD в PHP с Behat и Mink
BDD в PHP с Behat и Mink
 
BDD для PHP проектов
BDD для PHP проектовBDD для PHP проектов
BDD для PHP проектов
 
Devops meetup - Automatizált tesztek
Devops meetup - Automatizált tesztekDevops meetup - Automatizált tesztek
Devops meetup - Automatizált tesztek
 
PHP alapú keretrendszerek összehasonlítása - védés bemutató
PHP alapú keretrendszerek összehasonlítása - védés bemutatóPHP alapú keretrendszerek összehasonlítása - védés bemutató
PHP alapú keretrendszerek összehasonlítása - védés bemutató
 
Mobil Weekend - A tesztelői csapat evolúciója
Mobil Weekend - A tesztelői csapat evolúciójaMobil Weekend - A tesztelői csapat evolúciója
Mobil Weekend - A tesztelői csapat evolúciója
 
Magyar Attila - Kata és a TDD a dojoban
Magyar Attila - Kata és a TDD a dojobanMagyar Attila - Kata és a TDD a dojoban
Magyar Attila - Kata és a TDD a dojoban
 
Laravel for Dummies
Laravel for DummiesLaravel for Dummies
Laravel for Dummies
 
Selenium and Cucumber Automation Services
Selenium and Cucumber Automation ServicesSelenium and Cucumber Automation Services
Selenium and Cucumber Automation Services
 
P 101 ep 1-d
P 101 ep 1-dP 101 ep 1-d
P 101 ep 1-d
 
Domain-Driven Design in legacy application
Domain-Driven Design in legacy applicationDomain-Driven Design in legacy application
Domain-Driven Design in legacy application
 
Bridging The Communication Gap, Fast
Bridging The Communication Gap, Fast Bridging The Communication Gap, Fast
Bridging The Communication Gap, Fast
 
BDD for Rails Legacy Code
BDD for Rails Legacy CodeBDD for Rails Legacy Code
BDD for Rails Legacy Code
 
Jvm-bdd-quality-driven
Jvm-bdd-quality-drivenJvm-bdd-quality-driven
Jvm-bdd-quality-driven
 

Semelhante a Moving away from legacy code (AgileCymru)

Entrepreneurship Education Experience - Bob Caspe (Aula 3)
Entrepreneurship Education Experience - Bob Caspe (Aula 3)Entrepreneurship Education Experience - Bob Caspe (Aula 3)
Entrepreneurship Education Experience - Bob Caspe (Aula 3)
Cultura e Mercado
 
06.04.2020
06.04.202006.04.2020
06.04.2020
UMS
 

Semelhante a Moving away from legacy code (AgileCymru) (20)

Modelling by Example Workshop - PHPNW 2016
Modelling by Example Workshop - PHPNW 2016Modelling by Example Workshop - PHPNW 2016
Modelling by Example Workshop - PHPNW 2016
 
Trust-Pay monetization model
Trust-Pay monetization modelTrust-Pay monetization model
Trust-Pay monetization model
 
AGS Support Live: SAP Business One Procure to Pay Refresher Training
AGS Support Live: SAP Business One Procure to Pay Refresher TrainingAGS Support Live: SAP Business One Procure to Pay Refresher Training
AGS Support Live: SAP Business One Procure to Pay Refresher Training
 
User Story Splitting.pptx
User Story Splitting.pptxUser Story Splitting.pptx
User Story Splitting.pptx
 
Aviatorusa deck-5.9
Aviatorusa deck-5.9Aviatorusa deck-5.9
Aviatorusa deck-5.9
 
Error correction activity becs 16-17
Error correction activity becs 16-17Error correction activity becs 16-17
Error correction activity becs 16-17
 
Weekend escape
Weekend escapeWeekend escape
Weekend escape
 
Embrace Community! Embrace a better life!
Embrace Community! Embrace a better life!Embrace Community! Embrace a better life!
Embrace Community! Embrace a better life!
 
Panning for User Story Gold - by Damon Poole, Agile Coach
Panning for User Story Gold - by Damon Poole, Agile CoachPanning for User Story Gold - by Damon Poole, Agile Coach
Panning for User Story Gold - by Damon Poole, Agile Coach
 
How to make $1,000,000 from real estate
How to make $1,000,000 from real estateHow to make $1,000,000 from real estate
How to make $1,000,000 from real estate
 
Majorship tle-1
Majorship tle-1Majorship tle-1
Majorship tle-1
 
SEO Plan
SEO PlanSEO Plan
SEO Plan
 
SI Profile.
SI Profile.SI Profile.
SI Profile.
 
Project guideline
Project guideline Project guideline
Project guideline
 
A New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story SplittingA New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story Splitting
 
Entrepreneurship Education Experience - Bob Caspe (Aula 3)
Entrepreneurship Education Experience - Bob Caspe (Aula 3)Entrepreneurship Education Experience - Bob Caspe (Aula 3)
Entrepreneurship Education Experience - Bob Caspe (Aula 3)
 
How to Write Great User Stories Today.pptx
How to Write Great User Stories Today.pptxHow to Write Great User Stories Today.pptx
How to Write Great User Stories Today.pptx
 
Bdd for Life
Bdd for LifeBdd for Life
Bdd for Life
 
Would this clothing fit me
Would this clothing fit meWould this clothing fit me
Would this clothing fit me
 
06.04.2020
06.04.202006.04.2020
06.04.2020
 

Mais de Konstantin Kudryashov

Mais de Konstantin Kudryashov (6)

Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015
 
Design how your objects talk through mocking
Design how your objects talk through mockingDesign how your objects talk through mocking
Design how your objects talk through mocking
 
Behat 3.0 meetup (March)
Behat 3.0 meetup (March)Behat 3.0 meetup (March)
Behat 3.0 meetup (March)
 
BDD in Symfony2
BDD in Symfony2BDD in Symfony2
BDD in Symfony2
 
LESS, SASS, HAML: 4 буквы, изменившие frontend development
LESS, SASS, HAML: 4 буквы, изменившие frontend developmentLESS, SASS, HAML: 4 буквы, изменившие frontend development
LESS, SASS, HAML: 4 буквы, изменившие frontend development
 
Автоматизируем деплоймент проекта с помощью Capistrano
Автоматизируем деплоймент проекта с помощью CapistranoАвтоматизируем деплоймент проекта с помощью Capistrano
Автоматизируем деплоймент проекта с помощью Capistrano
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Moving away from legacy code (AgileCymru)