Moving Towards Zero Defects with Specification by Example

33
Moving towards zero defects with Specificati on By Steve Rogalsky (Track Sponsor) @srogalsky winnipegagilist. blogspot.com

description

Love tracing bugs in a defect tracking system? Love the bug-fix cycle? If so, then don't come to this presentation. We'll be discussing how Specification by Example (also known as Acceptance Test Driven Development) will help move you towards a zero defect system by building the right thing the first time.

Transcript of Moving Towards Zero Defects with Specification by Example

Page 1: Moving Towards Zero Defects with Specification by Example

Moving towards zero defects with Specification By ExampleSteve Rogalsky

(Track Sponsor)

@srogalskywinnipegagilist.blogspot.com

Page 2: Moving Towards Zero Defects with Specification by Example

Choose 2 of these topics to discuss:1. Talk about your approach to quality and

the results of that approach.2. Talk about your approach to

requirements and how you keep those requirements up to date.

3. Talk about any previous experience with automated testing.

4. Talk about your team’s current bug tracking process.

5. Talk about zero defects – Is it possible? Is it responsible? Cost effective?

Page 3: Moving Towards Zero Defects with Specification by Example
Page 4: Moving Towards Zero Defects with Specification by Example
Page 5: Moving Towards Zero Defects with Specification by Example

A story of Zero Defects

Page 6: Moving Towards Zero Defects with Specification by Example

A SCIENCE EXPERIMENT

Page 7: Moving Towards Zero Defects with Specification by Example

Specification By Example improves Quality & Speed

HYPOTHESIS:

Page 8: Moving Towards Zero Defects with Specification by Example

DEFINITIONS:

Acceptance Testing Is...

Page 9: Moving Towards Zero Defects with Specification by Example

Goal: To build the right thing the first time.

What is Specification By Example?

Page 10: Moving Towards Zero Defects with Specification by Example

Also known as / similar to:

ATDD – Acceptance Test Driven Development

BDD – Behaviour Driven Development

What is Specification By Example?

Page 11: Moving Towards Zero Defects with Specification by Example

WRITE EXAMPLES (Acceptance Tests)(up front but not UP FRONT)

instead of requirements

SPECIFICATION BY EXAMPLE

To do this we:

1.Given muppet <Animal> When measuring <Craziness> Then return <10>

Given muppet <Animal> When <Drumming> Then return <Phenomenal Skillz>

Given muppet <Animal> When <talking> Then return <Grunt>

Page 12: Moving Towards Zero Defects with Specification by Example

TEST AS SOON AS POSSIBLEFIRST

in collaboration with the developers and customers

2.To do this we:

Page 13: Moving Towards Zero Defects with Specification by Example
Page 14: Moving Towards Zero Defects with Specification by Example

AUTOMATE our examples

To do this we:

3.

Page 15: Moving Towards Zero Defects with Specification by Example

AN EXAMPLE:

Requirement: Bring home something small from Europe

What I brought: What she wanted:

Page 16: Moving Towards Zero Defects with Specification by Example

ANOTHER EXAMPLE

User Story: As an employee I want to receive overtime pay

a standard wage per hour for the first 40 hours worked

1.5 times their wage for each hour after the first 40 hours

2 times their wage for each

hour worked on Sundays and

holidays

For each week, hourly employees are paid:

Page 17: Moving Towards Zero Defects with Specification by Example

(40*$20) = $800.00

a standard wage per hour for the first 40 hours worked

Page 18: Moving Towards Zero Defects with Specification by Example

1.5 times their wage for each hour after the first 40 hours

(40*$20) + (5*$20*1.5) = $950.00

Page 19: Moving Towards Zero Defects with Specification by Example

2 times their wage for each

hour worked on Sundays and

holidays

(40*$20) + (8*$20*1.5) +(8*$20*2) = $1,360.00

Page 20: Moving Towards Zero Defects with Specification by Example

(40*$20) + (8*$20*1.5) +(8*$20*2 ) = $1,360.00

*1.5

2 times their wage for each

hour worked on Sundays and

holidays

Page 21: Moving Towards Zero Defects with Specification by Example

Executable Specificatio

ns

Credit: This example is from “The Role of Quality Assurance in Lean-Agile” – Allan Shalloway

Page 22: Moving Towards Zero Defects with Specification by Example

Defect Tracking

Page 23: Moving Towards Zero Defects with Specification by Example
Page 24: Moving Towards Zero Defects with Specification by Example
Page 25: Moving Towards Zero Defects with Specification by Example

Where should we focus our automated testing?

UI

Services

Classes/Functions

Focus Here First

TDD

Later…

Credit: Testing Triangle first shown by Patrick Wilson-Welsh

Page 26: Moving Towards Zero Defects with Specification by Example

'''

What does it take to set this up?

It is simpler than this…

Page 27: Moving Towards Zero Defects with Specification by Example

1. Download FitNesse (free)2. Run FitNesse3. Add A Reference to your

project4. Create a Fixture per set of

examples5. Write the examples6. Press a button

Steps:

Page 28: Moving Towards Zero Defects with Specification by Example

How to do it?

Choose Story

Expand into

Examples

Think about how

Review

Automate

Examples

Code / TDD

Passes All

tests = done

High Level Tests

Tester

Developer

Customer and Team

Page 29: Moving Towards Zero Defects with Specification by Example

THE EXPERIMENT

Page 30: Moving Towards Zero Defects with Specification by Example

Steps:• Fold the paper in half• Open the folded paper up and make two

triangle folds for the ‘nose’ of the plane• Re-fold the plane in half and fold two wings

(one on each side…)• Finally, fold two wing flaps

Airplane Factory!

Page 31: Moving Towards Zero Defects with Specification by Example

CONCLUSIONS

Page 32: Moving Towards Zero Defects with Specification by Example

1. Communicate!2. Write Executable Examples

instead of requirements3. The Tooling is simple to use

and free4. Zero Defects isn’t impossible –

build it right the first time5. Trash your Defect Tracker

TO SUMMARIZE

Specification By Example:

Page 33: Moving Towards Zero Defects with Specification by Example

winnipegagilist.blogspot.com

@srogalskyhttp://fitnesse.org/

http://gojko.net/fitnesse/

http://seleniumhq.org/

[email protected]

Links Contact Info

Questions?

THANKS!

http://www.slideshare.net/SteveRogalsky/moving-towards-zero-defects-with-specification-by-example