Lean code

3,135 views
2,871 views

Published on

My Lean Code presentation from #sc2011.

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,135
On SlideShare
0
From Embeds
0
Number of Embeds
608
Actions
Shares
0
Downloads
60
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Lean code

  1. 1. Lean code
  2. 2. What is Lean?
  3. 3. Lean softwaredevelopment
  4. 4. Eliminate Waste
  5. 5. Focus on Value
  6. 6. Deliver Fast
  7. 7. Decide Late
  8. 8. Can code be lean?
  9. 9. Introducingthe customer
  10. 10. Fresco plc
  11. 11. Iteration 010 minutes to choose a pair, and set up yourdev environmentWe are writing a command line tool: acceptstdin, 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. 12. Iteration 110 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. 13. Iteration 210 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. 14. Iteration 310 minutes to add CSV format:• Now need to accept the values as comma seperated• Same prices as Iteration 2Acceptance test:• Apples, Cherries, Bananas => 325• Cherries, Cherries => 130
  15. 15. Iteration 3aNo! 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 FreeAcceptance test:• Cherries => 75• Cherries => 120• Bananas => 270• Bananas => 270
  16. 16. Iteration 410 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” forapples.Acceptance test:• Cherries => 75• Pommes => 175• Cherries => 230• Bananas => 380• Bananas => 380• Apples => 480
  17. 17. Iteration 510 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.50Acceptance test:• Mele => 100• Pommes => 200• Pommes => 300• Apples => 400• Pommes => 400• Mele => 450• Cherries => 525• Cherries => 580
  18. 18. Iteration 5a10 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 £1Acceptance test:• Mele, Pommes, Pommes, Apples, Pommes, Mele, Cherries,Cherries, Bananas => 680
  19. 19. Iteration 610 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 => 200Acceptance test:• Mele, Pommes, Pommes, Apples, Mele => 150
  20. 20. Conclusions
  21. 21. Eliminate Waste
  22. 22. Focus on Value
  23. 23. Deliver Fast
  24. 24. Decide Late
  25. 25. “The quality of your software is inverselyproportional to how often you have to say no to your customer.” -- Uncle Bob Martin
  26. 26. git clone git://github.com/chrismdp/checkout-kata.gitgit checkout lean_code

×