lessons learnt from test driven development

23
Lessons Learnt from Test-Driven Development By: Anand Powar

Upload: anand-powar

Post on 11-Jan-2017

345 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Lessons learnt from test driven development

Lessons Learnt fromTest-Driven Development

By: Anand Powar

Page 2: Lessons learnt from test driven development

Once Upon A Time

Our product has got quality issues

Manager Developer

We lack a good QA, lets hire one

Page 3: Lessons learnt from test driven development

6 Months Later...

Our development is slowing down

Manager Developer

There is just too much workload, we need to introduce a shadow resource

Page 4: Lessons learnt from test driven development

“One bad programmer can easily create two new jobs a year.”

David Parnas

Page 5: Lessons learnt from test driven development

The Problem

?

Good

Cheap Fast

Page 6: Lessons learnt from test driven development

No Silver BulletGood

Cheap Fast

Page 7: Lessons learnt from test driven development

However

A bit better

A bit cheaper A bit faster

Test-Driven Development

Page 8: Lessons learnt from 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

Page 9: Lessons learnt from test driven development

It’s a lot like going to the gym

Page 10: Lessons learnt from test driven development

Build your confidence

Page 11: Lessons learnt from test driven development

Use TDD where it's suitable, mix other styles

Page 12: Lessons learnt from test driven development

Only test things that can possibly break

Page 13: Lessons learnt from test driven development

Avoid bad design trade-offs

Page 14: Lessons learnt from test driven development

Yes, we still need QA

Page 15: Lessons learnt from test driven development

“Imperfect tests, run frequently, are much better than perfect tests that

are never written at all”

Martin Fowler

Page 16: Lessons learnt from test driven development

PracticalLego Game

Page 17: Lessons learnt from test driven development

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

Page 18: Lessons learnt from test driven development

5 minutes

Page 19: Lessons learnt from test driven development

Children want a bigger dinosaur

6 inches tall

Time to market

We need to beat the competition

Market Feedback

Page 20: Lessons learnt from test driven development

ASAP

Page 21: Lessons learnt from test driven development

Can your dinosaur still jump?

Page 22: Lessons learnt from test driven development

“If you don’t like unit testing your product, most likely your customers

won’t like to test it either.”Anonymous

Page 23: Lessons learnt from test driven development

ThanksGet connected

http://in.linkedin.com/in/anandpowar http://twitter.com/anandpowar