Slide 1

Slide 1 text

The Lean Code Challenge Sit in pairs: at least one will need a laptop. You’ll be reading from stdin and writing to stdout. Find someone who knows the same language as you! Thursday, 12 July 12

Slide 2

Slide 2 text

What is Lean? Thursday, 12 July 12

Slide 3

Slide 3 text

Lean software development Thursday, 12 July 12

Slide 4

Slide 4 text

Eliminate Waste Thursday, 12 July 12

Slide 5

Slide 5 text

Focus on Value Thursday, 12 July 12

Slide 6

Slide 6 text

Deliver Fast Thursday, 12 July 12

Slide 7

Slide 7 text

Decide Late Thursday, 12 July 12

Slide 8

Slide 8 text

Can code be lean? Thursday, 12 July 12

Slide 9

Slide 9 text

Introducing the customer Thursday, 12 July 12

Slide 10

Slide 10 text

Fresco plc Thursday, 12 July 12

Slide 11

Slide 11 text

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 Thursday, 12 July 12

Slide 12

Slide 12 text

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 Thursday, 12 July 12

Slide 13

Slide 13 text

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 Thursday, 12 July 12

Slide 14

Slide 14 text

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 Thursday, 12 July 12

Slide 15

Slide 15 text

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 Thursday, 12 July 12

Slide 16

Slide 16 text

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 Thursday, 12 July 12

Slide 17

Slide 17 text

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 Thursday, 12 July 12

Slide 18

Slide 18 text

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 Thursday, 12 July 12

Slide 19

Slide 19 text

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 Thursday, 12 July 12

Slide 20

Slide 20 text

Conclusions Thursday, 12 July 12

Slide 21

Slide 21 text

Eliminate Waste Thursday, 12 July 12

Slide 22

Slide 22 text

Focus on Value Thursday, 12 July 12

Slide 23

Slide 23 text

Deliver Fast Thursday, 12 July 12

Slide 24

Slide 24 text

Decide Late Thursday, 12 July 12

Slide 25

Slide 25 text

“The quality of your software is inversely proportional to how often you have to say no to your customer.” -- Uncle Bob Martin Thursday, 12 July 12

Slide 26

Slide 26 text

git clone git://github.com/chrismdp/checkout-kata.git git checkout lean_code Thursday, 12 July 12