specification by example - course summary

25
From user stories to acceptance tests What we learned about Specification by example Morten Berg and Jakub Holy present: Iterate :: 1/2012

Upload: jakub-holy

Post on 29-Nov-2014

1.782 views

Category:

Technology


3 download

DESCRIPTION

Key lessons from the course on specification by example called From user stories to acceptance tests lead by Gojko Adzic in Oslo, 1/2012.What SbE is, what are its key goals, how to introduce it, selected techniques including Effect Mapping and Specification Workshop.

TRANSCRIPT

Page 1: Specification by example - course summary

From user stories to acceptance tests

What we learned about Specification by example

Morten Berg and Jakub Holy present:

Iterate :: 1/2012

Page 2: Specification by example - course summary

Quick fly-through

Page 3: Specification by example - course summary

The Key Concerns of SbE

Deliver true business value

Build shared understanding

(Evolve living documentation)

"Doing the right thing vs. doing the thing right."

Page 4: Specification by example - course summary

Shared understanding in business terms

Shared understanding + business terms and relations

Aligned business, SW, test models

Small change in business => small in SW, test

Much, much better maintainability, evolvability

(also less rework)

Build the right thing

Page 5: Specification by example - course summary

The Key Patterns of SbEBusiness

goalScope

(UC, US)

Key examples

Executable specification

Living documentation

derive

Specify collaboratively

automate w/o changing

ilustrate

Often, evolve

1. Derive scope from business goal2. Specify collaboratively3. Ilustrate using examples4. Refine the specification5. Automate validation w/o changing specification6. Validate frequently7. Evolve into a documentation system

http://specificationbyexample.com/key_ideas.html

Page 6: Specification by example - course summary

Goal: Shared understanding0. Clarify the goal

1. Build the shared understanding○ Collaborative specification... ○ ... with examples

2. Keep it○ Automate validation

3. Profit from it○ Evolve into living documentation

"The devil is in the details"

Page 7: Specification by example - course summary

Example specification with examples

Title: Free book delivery

Objective: VIP users who order more books get free shipping in Norway. Examples: Customer Books Country Free shipping?

VIP 5 Norway Y

VIP 4 Norway N

VIP 10 Danmark N

Regular 10 Norway N

Page 8: Specification by example - course summary

Sidenote: Automization

class FreeBookDeliveryTest { void setCustomer(..) {..} void setBooks(..) {..} void setCountry(..) {..} boolean isFreeShipping() {..}}

Customer Books Country Free shipping?

Page 9: Specification by example - course summary

Showtime: Some real-world specifications with example

Page 10: Specification by example - course summary

What makes a good specification with examples?

Good● Good google-able title● Clear objective - how to read the examples?● Uses business language, unified terms● Couple of key, focused examples, completeBad● Script ("click here, find css class X, ...)● Too detailed, too verbose, duplication● Many examples (bad understanding, bad

representation, more concepts mixed)

Page 11: Specification by example - course summary

Show the poster!

Page 12: Specification by example - course summary

Introducing SbE & Its Applicability

Strategy: What's the team's top pain? Can something from SbE fix it?

Examples:● Lot of rework devs - testers => better shared

understanding via Specification workshop● Late feedback from testers => automateKey: Introduce what you need, when you need it, step by step. Shift culture first. It's easy!

9-15 mo

buzz-words

Big Bang

Page 13: Specification by example - course summary

Why to specify collaboratively?

Page 14: Specification by example - course summary

Examples Tests

Requirements

can become

elaborate verif

y

Page 15: Specification by example - course summary

Single source of truth

Devs: Truth in codeTesters: Truth in test casesBusiness analyst: Truth in documents Use a single source of truth, avoid translation! => Start with business analyst

Extend with examples from devsExtend with examples from testers

Page 16: Specification by example - course summary
Page 17: Specification by example - course summary

Random highlights

Page 18: Specification by example - course summary

How to Make Acceptance Tests Maintainable 1. Aligned business, software, and test models

○ => small change in one is small in the other too

2. Test under the surface level, if possible○ Service > Servlet > UI - decide by risk vs. cost

3. Isolate tests from implementation by layers of test abstraction (What>Instrumentation>DSL)

See The Holy Java: How to Create Maintainable Acceptance Tests (http://wp.me/pTHiC-tl)

Page 19: Specification by example - course summary

Why Are We Doing This?The Effect Maps Technique

Simple mind-mapping technique that incredibly facilitates agile product design, planning, prioritisation, and scoping. Levels:1. Why - the measurable business goal2. Who can help/hinder achievel of the goal?3. How can they do it?4. What are the SW features or business

activities that support it?

demo

Page 20: Specification by example - course summary

Techniques: Spec Workshop and Diverge & Merge

Specification Workshop (½ day → 2w sprint)● All: business + devs + testers

○ Business: What, why○ Devs: What's technically possible/troublesome○ Testers: How to test (break) this? Corner cases

● Surface hidden complexities, discover assumptions● Build shared understanding (=> feedback exercise)

Diverge & Merge● Groups of 3-5 work in parallel 10-20 min, then merge

results● More divergent => richer & better ideas● Prevent paralysation by confining troublesome people

Page 21: Specification by example - course summary

Acceptance Test Automation Tools

● FitNesse - wiki-based○ Cons: Long learning, encourages copy&paste○ Pros: Wiki, mature

● Concordion - new, HTML+JUnit○ Pros: Contrary to FitNesse disables copying, quick to

learn, integrated anywhere via JUnit, free-form○ Cons: No live editing, no copying => not for 104 tests

● Cucumber - new, websites, Ruby, ecosystem○ Pros: Simple text format (RegExp), easy2learn, web○ Cons: Only test execution - other tools for the rest

● Robot Framework - tabular, keyword-driven○ Pros: Great for testers w/o devs, libraries (SQL,..)

● Commercial - GreenPepper (Confluence), ...

Page 22: Specification by example - course summary

The end is coming, run for your life!

Page 23: Specification by example - course summary

Other Key Lessons

● When the time is short ... do communicate!● The key benefit of SbE aside of improved

communication is living documentation; regression tests are only a minor by-product

● (and many others :-))

Page 24: Specification by example - course summary

Quiz

What have we learned today?

Page 25: Specification by example - course summary

Resources

Gojko Adzic: Specification by example, 2011- condensed experience of 50 highly successful teams

Gojko Adzic: Agile product management using Effect Maps (paper)

Eric Evans: Domain Driven Design, 2003