test first development... impact on traditional roles

15
Test First Development Impact on Traditional Testing Roles Gaurav Maheshwari [email protected], @g_maheshwari TL Spectrum Consulting Pvt. Ltd. (http://www.tlspectrum.com)

Upload: gaurav-maheshwari

Post on 18-Jul-2015

125 views

Category:

Engineering


4 download

TRANSCRIPT

Page 1: Test First Development... Impact on Traditional Roles

Test First Development Impact on Traditional Testing Roles

Gaurav Maheshwari

[email protected], @g_maheshwari

TL Spectrum Consulting Pvt. Ltd. (http://www.tlspectrum.com)

Page 2: Test First Development... Impact on Traditional Roles

Test First Development Impact on Traditional Testing Roles

Page 3: Test First Development... Impact on Traditional Roles

Image credit: Google Image with respective trademarks

Page 4: Test First Development... Impact on Traditional Roles

75% 25%

Software Maintenance

Source: Software Maintenance (Wikipedia) , Estimating Software Maintenance, Prof M Glinz, University of Zurich

Lientz and Swanson (1980)

Corrective 22%

Adaptive 24%

Perfective 51%

Preventive 3%

Page 5: Test First Development... Impact on Traditional Roles

Quality

Works as Expected

Responsive, Easy to Use

Reliable, Accurate

Predictable

Easy to Understand

Easy to Change

Testable

Modular, Readable

External Quality Internal Quality

Customers Developers

Purpose of Software Design of Software

Reference: GoodCode, Structure & Interpretation of Computer Programs, MIT Press

“Programs must be written for people to read, and only

incidentally for machines to execute” - Abelson & Sussman,

Page 6: Test First Development... Impact on Traditional Roles

Development Flow

Code

High-level design

architecture

High-level design

architecture Detailed Design Detailed Design Code Code Unit Test Unit Test Test Test

(a)

Design & Code

High-level design

architecture

High-level design

architecture Unit Test Unit Test Code Code Refactor Refactor Test Test

(c)

Development Flow: (a) (b) Traditional test-last and (c) Test-First (TDD) flow

Code

High-level design

architecture

High-level design

architecture Detailed Design Detailed Design Code Code UT, CR, SA, CC UT, CR, SA, CC Test, CC Test, CC

(b)

Page 7: Test First Development... Impact on Traditional Roles

Test Driven Development (TDD)

Red

Green Gold/

Refactor

Write a simple test & make it fail

Test as example code, technical

documentation

No external dependency

Get to green fast, simple steps

Just enough code to pass the test

Clean up, Remove Duplication,

Restructure, Optimize

Run the tests and keep them “Green”

What to build ?

Who is going to use it and how ?

How to test ? Different Scenarios ?

Page 9: Test First Development... Impact on Traditional Roles
Page 10: Test First Development... Impact on Traditional Roles

User story, Acceptance Criteria

As a [X]

So that [Z]

I want [Y]

-- person (role) who will benefit

-- benefit or business value

-- feature

Given

Then

When

-- some initial context (the givens)

-- ensure some outcomes

-- an event occurs

Page 11: Test First Development... Impact on Traditional Roles

Examples

What if these Acceptance

criterions are executable?

Behavior Driven Development (BDD)

Source: Dan North Blog : Introducing BDD

Page 12: Test First Development... Impact on Traditional Roles

PO

Dev Team Customer

Requirements to Design to Code to Product Translation Cycle

Page 13: Test First Development... Impact on Traditional Roles

BDD – TDD Working Together

Dev Cycle

TDD

BDD

Customer, PO, Dev, Test –

Sharing understanding by

discussing specific examples

Improved internal code quality

Page 14: Test First Development... Impact on Traditional Roles

What’s in it for me, the Tester ?

• Focus beyond basic sanity

• Improved

– Internal quality, and external quality

– Testability

• Put testing on behalf of the user

• Automated test as production code

• Testers as

– Design consultants

– Partners

– Domain experts

• Demonstrate value by going Upstream!

Testers Behaviour

Developers Design,

Coding

Page 15: Test First Development... Impact on Traditional Roles

THANK YOU!

@g_maheshwari

/in/mgaurav

[email protected]