Upload
anand-powar
View
345
Download
1
Embed Size (px)
Citation preview
Lessons Learnt fromTest-Driven Development
By: Anand Powar
Once Upon A Time
Our product has got quality issues
Manager Developer
We lack a good QA, lets hire one
6 Months Later...
Our development is slowing down
Manager Developer
There is just too much workload, we need to introduce a shadow resource
“One bad programmer can easily create two new jobs a year.”
David Parnas
The Problem
?
Good
Cheap Fast
No Silver BulletGood
Cheap Fast
However
A bit better
A bit cheaper A bit faster
Test-Driven Development
Test Driven Development
Write new test
New require-
ment
Run tests
Write new code
Run tests
Refactor
Run tests
Make it Fail
Make it Work
Make it Better
It’s a lot like going to the gym
Build your confidence
Use TDD where it's suitable, mix other styles
Only test things that can possibly break
Avoid bad design trade-offs
Yes, we still need QA
“Imperfect tests, run frequently, are much better than perfect tests that
are never written at all”
Martin Fowler
PracticalLego Game
Acceptance criteria:
It should be 4 inches tall
Our hypothesis: 4 inches is the ideal size
It should be able to walk
At least 2 legs
It should be able to jump
If I drop it from a height of 2 inches, it should not break
Build a toy dinosaur
5 minutes
Children want a bigger dinosaur
6 inches tall
Time to market
We need to beat the competition
Market Feedback
ASAP
Can your dinosaur still jump?
“If you don’t like unit testing your product, most likely your customers
won’t like to test it either.”Anonymous
ThanksGet connected
http://in.linkedin.com/in/anandpowar http://twitter.com/anandpowar