A workshop run at conferences and user groups which helps people understand how the constraints of delivery and changing requirements affects their code.
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 Thursday, 12 July 12
• 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 Thursday, 12 July 12
input and output as before • Two lots of Cherries get 20p off. Acceptance test: • Apples => 100 • Cherries => 175 • Cherries => 230 Thursday, 12 July 12
need to accept the values as comma seperated • Same prices as Iteration 2 Acceptance test: • Apples, Cherries, Bananas => 325 • Cherries, Cherries => 130 Thursday, 12 July 12
• 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 Thursday, 12 July 12
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 Thursday, 12 July 12
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 Thursday, 12 July 12
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 Thursday, 12 July 12
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 Thursday, 12 July 12