SlideShare a Scribd company logo
1 of 26
Lean code
What is Lean?
Lean software
development
Eliminate Waste
Focus on Value
Deliver Fast
Decide Late
Can code be lean?
Introducing
the customer
Fresco plc
Iteration 0
10 minutes to choose a pair, and set up your
dev environment

We are writing a command line tool: accept
stdin, write stdout.

If you need a quick environment in Ruby:

$ git clone git://github.com/chrismdp/checkout-kata.git
$ git checkout lean_code_start
$ bin/checkout
Iteration 1
10 minutes to write a simple checkout scanner
• Apples cost £1, Bananas cost £1.50, Cherries cost £0.75
• Accept each of these words one per line on stdin
• Print the cart total in pence on stdout each time.
• Questions?
Acceptance Test:

• Apples => 100
• Cherries => 175
• Cherries => 250
Iteration 2
10 minutes to add a discount:
• Same input and output as before
• Two lots of Cherries get 20p off.
Acceptance test:
• Apples => 100
• Cherries => 175
• Cherries => 230
Iteration 3
10 minutes to add CSV format:

• Now need to accept the values as comma seperated
• Same prices as Iteration 2
Acceptance test:
• Apples, Cherries, Bananas => 325
• Cherries, Cherries => 130
Iteration 3a
No! Urgent requirement from business! Deadline the same.

• Fresco suppliers notified delay of new API requiring CSV
• Now input back to one per line
• Cherries have now got 30p discount
• Bananas are now Buy One Get One Free
Acceptance test:
• Cherries => 75
• Cherries => 120
• Bananas => 270
• Bananas => 270
Iteration 4
10 minutes to support localisation:
• Fresco suppliers still behind on CSV change
• Cherries are now back to 20p discount
• Should also support the words “Pommes” and “Mele” for
apples.

Acceptance test:
• Cherries => 75
• Pommes => 175
• Cherries => 230
• Bananas => 380
• Bananas => 380
• Apples => 480
Iteration 5
10 minutes to support seperate discounts for different names:
• Be advised CSV change is coming next iteration
• 3 x Pommes is discounted to £2
• 2 x Mela is discounted to £1.50
Acceptance test:
• Mele => 100
• Pommes => 200
• Pommes => 300
• Apples => 400
• Pommes => 400
• Mele => 450
• Cherries => 525
• Cherries => 580
Iteration 5a
10 minutes to support seperate discounts for different names:
• NEW TILLS DEPLOYED YOUR CODE IS BROKEN!
• 3 x Pommes is discounted to £2
• 2 x Mela is discounted to £1
Acceptance test:
• Mele, Pommes, Pommes, Apples, Pommes, Mele, Cherries,
Cherries, Bananas => 680
Iteration 6
10 minutes to work around supplier bug and apply super-
discount:
• Supplier bug: support entry of both CR seperated and CSV
• 2 x Mele is discounted to £1.50
• Buy 4 apples and get another £1 off the bill.
• Buy 5 pieces of Fruit a get a further £2 off the bill.
Acceptance test:
• Mele, Pommes, Pommes, Mele => 250
• Bananas => 200
Acceptance test:
• Mele, Pommes, Pommes, Apples, Mele => 150
Conclusions
Eliminate Waste
Focus on Value
Deliver Fast
Decide Late
“The quality of your software is inversely
proportional to how often you have to say no
             to your customer.”

                         -- Uncle Bob Martin
git clone git://github.com/chrismdp/checkout-kata.git
git checkout lean_code

More Related Content

What's hot

Design thinking assignment 2
Design thinking assignment 2Design thinking assignment 2
Design thinking assignment 2
TeviTuakli
 
Eatby Pitch Deck: It’s always good to know your guests’ tastes
Eatby Pitch Deck: It’s always good to know your guests’ tastesEatby Pitch Deck: It’s always good to know your guests’ tastes
Eatby Pitch Deck: It’s always good to know your guests’ tastes
Jp Mohanty
 

What's hot (20)

Metrics: where and how
Metrics: where and howMetrics: where and how
Metrics: where and how
 
Design thinking assignment 2
Design thinking assignment 2Design thinking assignment 2
Design thinking assignment 2
 
What is Robotic Process Automation?
What is Robotic Process Automation?What is Robotic Process Automation?
What is Robotic Process Automation?
 
Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...
 
2nd PyData Piraeus meetup - Data Science Initiatives in Titan Cement Company
2nd PyData Piraeus meetup - Data Science Initiatives in Titan Cement Company2nd PyData Piraeus meetup - Data Science Initiatives in Titan Cement Company
2nd PyData Piraeus meetup - Data Science Initiatives in Titan Cement Company
 
What is Robotic Process Automation-RPA
What is Robotic Process Automation-RPAWhat is Robotic Process Automation-RPA
What is Robotic Process Automation-RPA
 
Getting started with GitHub Desktop
Getting started with GitHub DesktopGetting started with GitHub Desktop
Getting started with GitHub Desktop
 
How to Write the Fastest JSON Parser/Writer in the World
How to Write the Fastest JSON Parser/Writer in the WorldHow to Write the Fastest JSON Parser/Writer in the World
How to Write the Fastest JSON Parser/Writer in the World
 
How to become senior .net developer
How to become senior .net developerHow to become senior .net developer
How to become senior .net developer
 
Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)
 
PXEless Discovery with Foreman
PXEless Discovery with ForemanPXEless Discovery with Foreman
PXEless Discovery with Foreman
 
IBM BPM & ODM
IBM BPM & ODMIBM BPM & ODM
IBM BPM & ODM
 
GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
 
Python+gradle
Python+gradlePython+gradle
Python+gradle
 
Web Assembly Big Picture
Web Assembly Big PictureWeb Assembly Big Picture
Web Assembly Big Picture
 
Eatby Pitch Deck: It’s always good to know your guests’ tastes
Eatby Pitch Deck: It’s always good to know your guests’ tastesEatby Pitch Deck: It’s always good to know your guests’ tastes
Eatby Pitch Deck: It’s always good to know your guests’ tastes
 
From Transactions to Relationships: Benefits of an Omnichannel Strategy at Pe...
From Transactions to Relationships: Benefits of an Omnichannel Strategy at Pe...From Transactions to Relationships: Benefits of an Omnichannel Strategy at Pe...
From Transactions to Relationships: Benefits of an Omnichannel Strategy at Pe...
 
Salesforce Apex Hours :- Hyper batch
Salesforce Apex Hours :- Hyper batchSalesforce Apex Hours :- Hyper batch
Salesforce Apex Hours :- Hyper batch
 
MPlan Format Sept2022.pptx
MPlan Format Sept2022.pptxMPlan Format Sept2022.pptx
MPlan Format Sept2022.pptx
 
ADP: Driving Faster Customer Onboarding with MuleSoft - Michael Bevilacqua, V...
ADP: Driving Faster Customer Onboarding with MuleSoft - Michael Bevilacqua, V...ADP: Driving Faster Customer Onboarding with MuleSoft - Michael Bevilacqua, V...
ADP: Driving Faster Customer Onboarding with MuleSoft - Michael Bevilacqua, V...
 

Similar to Lean code

Kristin’s Cookie Company Production process and analysis case study
Kristin’s Cookie Company Production process and analysis case studyKristin’s Cookie Company Production process and analysis case study
Kristin’s Cookie Company Production process and analysis case study
Arfan Afzal
 

Similar to Lean code (16)

Lean code en
Lean code   enLean code   en
Lean code en
 
Lean code kata en PHPMad
Lean code kata  en PHPMadLean code kata  en PHPMad
Lean code kata en PHPMad
 
C2 c finalpresentation
C2 c finalpresentationC2 c finalpresentation
C2 c finalpresentation
 
New e-Discovery Reference Model Pricing
New e-Discovery Reference Model PricingNew e-Discovery Reference Model Pricing
New e-Discovery Reference Model Pricing
 
Kristin’s Cookie Company Production process and analysis case study
Kristin’s Cookie Company Production process and analysis case studyKristin’s Cookie Company Production process and analysis case study
Kristin’s Cookie Company Production process and analysis case study
 
Project six sigma
Project  six sigmaProject  six sigma
Project six sigma
 
Six sigma on burning brownie
Six sigma on burning brownieSix sigma on burning brownie
Six sigma on burning brownie
 
Proposal Presentation
Proposal PresentationProposal Presentation
Proposal Presentation
 
Toi uu hoa he thong 30 trieu nguoi dung
Toi uu hoa he thong 30 trieu nguoi dungToi uu hoa he thong 30 trieu nguoi dung
Toi uu hoa he thong 30 trieu nguoi dung
 
7 email marketing programs to automate silverpop dma14
7 email marketing programs to automate silverpop dma147 email marketing programs to automate silverpop dma14
7 email marketing programs to automate silverpop dma14
 
Pricing strategies 2017 nz
Pricing strategies 2017 nzPricing strategies 2017 nz
Pricing strategies 2017 nz
 
Hidden Grounds Proposal
Hidden Grounds ProposalHidden Grounds Proposal
Hidden Grounds Proposal
 
Cmt pos solution presentation
Cmt pos solution presentationCmt pos solution presentation
Cmt pos solution presentation
 
Lean Supply Chain Management--by JULIAN KALAC
Lean Supply Chain Management--by JULIAN KALACLean Supply Chain Management--by JULIAN KALAC
Lean Supply Chain Management--by JULIAN KALAC
 
App Store Subscriptions - Condensed Edition
App Store Subscriptions - Condensed EditionApp Store Subscriptions - Condensed Edition
App Store Subscriptions - Condensed Edition
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
 

Recently uploaded

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
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
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 

Recently uploaded (20)

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
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
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 

Lean code

  • 8. Can code be lean?
  • 11. Iteration 0 10 minutes to choose a pair, and set up your dev environment We are writing a command line tool: accept stdin, write stdout. If you need a quick environment in Ruby: $ git clone git://github.com/chrismdp/checkout-kata.git $ git checkout lean_code_start $ bin/checkout
  • 12. Iteration 1 10 minutes to write a simple checkout scanner • Apples cost £1, Bananas cost £1.50, Cherries cost £0.75 • Accept each of these words one per line on stdin • Print the cart total in pence on stdout each time. • Questions? Acceptance Test: • Apples => 100 • Cherries => 175 • Cherries => 250
  • 13. Iteration 2 10 minutes to add a discount: • Same input and output as before • Two lots of Cherries get 20p off. Acceptance test: • Apples => 100 • Cherries => 175 • Cherries => 230
  • 14. Iteration 3 10 minutes to add CSV format: • Now need to accept the values as comma seperated • Same prices as Iteration 2 Acceptance test: • Apples, Cherries, Bananas => 325 • Cherries, Cherries => 130
  • 15. Iteration 3a No! Urgent requirement from business! Deadline the same. • Fresco suppliers notified delay of new API requiring CSV • Now input back to one per line • Cherries have now got 30p discount • Bananas are now Buy One Get One Free Acceptance test: • Cherries => 75 • Cherries => 120 • Bananas => 270 • Bananas => 270
  • 16. Iteration 4 10 minutes to support localisation: • Fresco suppliers still behind on CSV change • Cherries are now back to 20p discount • Should also support the words “Pommes” and “Mele” for apples. Acceptance test: • Cherries => 75 • Pommes => 175 • Cherries => 230 • Bananas => 380 • Bananas => 380 • Apples => 480
  • 17. Iteration 5 10 minutes to support seperate discounts for different names: • Be advised CSV change is coming next iteration • 3 x Pommes is discounted to £2 • 2 x Mela is discounted to £1.50 Acceptance test: • Mele => 100 • Pommes => 200 • Pommes => 300 • Apples => 400 • Pommes => 400 • Mele => 450 • Cherries => 525 • Cherries => 580
  • 18. Iteration 5a 10 minutes to support seperate discounts for different names: • NEW TILLS DEPLOYED YOUR CODE IS BROKEN! • 3 x Pommes is discounted to £2 • 2 x Mela is discounted to £1 Acceptance test: • Mele, Pommes, Pommes, Apples, Pommes, Mele, Cherries, Cherries, Bananas => 680
  • 19. Iteration 6 10 minutes to work around supplier bug and apply super- discount: • Supplier bug: support entry of both CR seperated and CSV • 2 x Mele is discounted to £1.50 • Buy 4 apples and get another £1 off the bill. • Buy 5 pieces of Fruit a get a further £2 off the bill. Acceptance test: • Mele, Pommes, Pommes, Mele => 250 • Bananas => 200 Acceptance test: • Mele, Pommes, Pommes, Apples, Mele => 150
  • 25. “The quality of your software is inversely proportional to how often you have to say no to your customer.” -- Uncle Bob Martin