tdd

17
TDD Test Driven Development

Upload: joerg-henning

Post on 13-Feb-2017

75 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Tdd

TDDTest Driven Development

Page 2: Tdd

Clean code that works

Page 3: Tdd

Two Rules

• Don’t write a single line of code unless you have a failing automated test

• Eliminate duplication

Page 4: Tdd

Write a little test

Page 5: Tdd

Make the test work (quick and dirty)

Page 6: Tdd

Eliminate all duplication (Refactor)

Page 7: Tdd

Red/Green/Refactor

Page 8: Tdd

Why this rocks..

• Reduces defect density

• Reduces risk

• Interaction between developers

• Shippable software === Agile

Page 9: Tdd

Fear

Page 10: Tdd

Cups of Coffee Per Cup Total

Starbucks 25 4 100

Total 100

Page 11: Tdd

Cups of Coffee Per Cup Total

Starbucks 25 S$ 4 S$ 100

Highlands 15 VND 25,000 VND 375,000

Total ???

Page 12: Tdd

Cups of Coffee Per Cup Total

Starbucks 25 S$ 4 S$ 100

Highlands 15 VND 25,000 VND 375,000

Total S$ 125

SGD/VND 15,000

Page 13: Tdd

7 USD +10 SGD = 14 USD(if SGD to USD = 0.7)

Page 14: Tdd

7 USD x 2 = 14 USDlet’s start small

Page 15: Tdd

7 USD x 2 = undefinedoh boy …

Page 16: Tdd

7 USD x 2 = 14 USDbut wait …

Page 17: Tdd

this.amount = 7 * 2dependency —> duplication