how to detect smelly acceptance tests - agile dev practices

61

Upload: kishen-simbhoedatpanday

Post on 05-Jul-2015

175 views

Category:

Education


0 download

TRANSCRIPT

Page 1: How to detect smelly acceptance tests - Agile Dev Practices
Page 2: How to detect smelly acceptance tests - Agile Dev Practices
Page 3: How to detect smelly acceptance tests - Agile Dev Practices
Page 4: How to detect smelly acceptance tests - Agile Dev Practices

How to detect smelly acceptance tests and why they are wrong!

Kishen Simbhoedatpanday

[email protected] @KishenPanday

Page 5: How to detect smelly acceptance tests - Agile Dev Practices

What is ATDD?

Page 6: How to detect smelly acceptance tests - Agile Dev Practices

Do you think the Business cares about Unit Testing? I don’t think so

Page 7: How to detect smelly acceptance tests - Agile Dev Practices

Unit Tests Facilitating the team with Design & Fast Feedback

Page 8: How to detect smelly acceptance tests - Agile Dev Practices

Getting lost in details. Not meeting customers’ expectations

Page 9: How to detect smelly acceptance tests - Agile Dev Practices

We need something that gives us the big picture. Acceptance tests to the rescue.

Page 10: How to detect smelly acceptance tests - Agile Dev Practices

Acceptance Tests should tell us which features are fault

Page 11: How to detect smelly acceptance tests - Agile Dev Practices

What do you think?

Page 12: How to detect smelly acceptance tests - Agile Dev Practices

Acceptance Tests They can do so much more!

Page 13: How to detect smelly acceptance tests - Agile Dev Practices

We stop treating them as Tests

We treat them as Specifications

Page 14: How to detect smelly acceptance tests - Agile Dev Practices

Specifications By Example

!   Describe the solution in non-technical terms

!   Define Acceptance Criteria before development

!   Quality increases when everyone understands

Page 15: How to detect smelly acceptance tests - Agile Dev Practices

My thoughts at work

Page 16: How to detect smelly acceptance tests - Agile Dev Practices

Developers and Acceptance Testing

Page 17: How to detect smelly acceptance tests - Agile Dev Practices

Testers and Acceptance Testing

Page 18: How to detect smelly acceptance tests - Agile Dev Practices

Business and Acceptance Testing

Page 19: How to detect smelly acceptance tests - Agile Dev Practices

What do you think?

Page 20: How to detect smelly acceptance tests - Agile Dev Practices

It stinks!

Page 21: How to detect smelly acceptance tests - Agile Dev Practices

FUN! Love and listen to your specification

Page 22: How to detect smelly acceptance tests - Agile Dev Practices

Specifications that matter Understandable for everyone

Page 23: How to detect smelly acceptance tests - Agile Dev Practices

Why?

!   Check common understanding

!   Get rid of assumptions

!   You’ll know when you’re done

Page 24: How to detect smelly acceptance tests - Agile Dev Practices

Stop talking abstract terms Get into detail as soon as you can!

Page 25: How to detect smelly acceptance tests - Agile Dev Practices

Good acceptance tests have these properties

!   Explicitly defined

!   Observable

!   Realistic scenario

!   Related to user story

!   Observed instantly

Page 26: How to detect smelly acceptance tests - Agile Dev Practices

Example

As an Account Holder I want to withdraw cash from an ATM So that I can get money when the bank is closed

Page 27: How to detect smelly acceptance tests - Agile Dev Practices

Explicitly defined?

Given a customer with ID "12" in front of ATM And the machine contains "100” And the user places card into ATM And the user gets "Please enter PIN” And the user enters PIN "1234” And the system verifies correct PIN And the user selects "cash withdrawal” And the user selects "Enter amount” And the user types "20” And the user selects "OK”

Page 28: How to detect smelly acceptance tests - Agile Dev Practices

Explicitly defined?

When the user gets "Please wait” And the user waits until no "Please wait” And the user gets "Please remove card” And the user removes card from ATM And the user gets "20” And the user gets "Please remove cash” And the user removes cash from ATM Then the machine contains "80” And the account balance should be "80"

Page 29: How to detect smelly acceptance tests - Agile Dev Practices

Observable?

Given a customer with ID "12" in front of ATM And the machine contains "100” When the user places card into ATM And the user enters PIN "1234” And the user selects "cash withdrawal” And the user selects "Enter amount” Then the user types "20” And the user selects "OK”

Page 30: How to detect smelly acceptance tests - Agile Dev Practices

Realistic scenario?

Given a customer with ID "12" in front of ATM When the user enters amount “-123” Then the user gets ”Not a valid amount”

Page 31: How to detect smelly acceptance tests - Agile Dev Practices

Related to user story?

Given a customer with ID "12" in front of ATM And transfers “100” from savings to withdrawal account When the user enters amount “100” Then the user gets ”100”

Page 32: How to detect smelly acceptance tests - Agile Dev Practices

Observed instantly?

Given a customer with ID "12" in front of ATM And the machine contains "100” And the user places card into ATM And the user gets "Please enter PIN” And the user enters PIN "1234” And the system verifies correct PIN And the user selects "cash withdrawal” And the user selects "Enter amount” And the user types "20” And the user selects "OK” Then screen show correctly

Page 33: How to detect smelly acceptance tests - Agile Dev Practices

When writing tests or specifications Think about Heidi Klum who needs to fix it tomorrow

Page 34: How to detect smelly acceptance tests - Agile Dev Practices

Transforming tests into specifications

Business

Workflow

Technical

Cla

rity

Stab

ility

Page 35: How to detect smelly acceptance tests - Agile Dev Practices

Less smelly

Page 36: How to detect smelly acceptance tests - Agile Dev Practices

The breakdown

Withdraw Money

ATM dispensing

Account Balance

Page 37: How to detect smelly acceptance tests - Agile Dev Practices

The split

Page 38: How to detect smelly acceptance tests - Agile Dev Practices

Layers of Abstraction

Business

Workflow

Technical

JVM

Page 39: How to detect smelly acceptance tests - Agile Dev Practices

Specifications that matter

Questions?

!   Know upfront what to “accept” as done

!   Check common understanding

!   SMART

!   Layers of Abstractions

Page 40: How to detect smelly acceptance tests - Agile Dev Practices

Smelly Acceptance Tests More examples

Page 41: How to detect smelly acceptance tests - Agile Dev Practices

Lost in UI details Watch out!

Page 42: How to detect smelly acceptance tests - Agile Dev Practices

End – to – end testing Is not bad in itself, it’s just hard

Page 43: How to detect smelly acceptance tests - Agile Dev Practices

Slow tests

Test Suites > 15 minutes are not allowed!

Page 44: How to detect smelly acceptance tests - Agile Dev Practices

Huge Test Data

Page 45: How to detect smelly acceptance tests - Agile Dev Practices

Huge Test Data

Page 46: How to detect smelly acceptance tests - Agile Dev Practices

Huge Test Data

Page 47: How to detect smelly acceptance tests - Agile Dev Practices

UI, API Huge Test Data goes here!

Create User Create Transfer Account Create products > 200 euro Order products

Given a Customer has a transfer account When a user orders funds of total price > 200 EUR Then transfer is accepted

Huge Test Data

Business

Workflow

Technical

Page 48: How to detect smelly acceptance tests - Agile Dev Practices

Erratic Tests

Object

Property X: 10

Test 1

Test 2

Test 3

Read X: 10

Write X : 12

Read X : 10

Page 49: How to detect smelly acceptance tests - Agile Dev Practices

Regression Bug Suite Why do you have them in the first place?

Page 50: How to detect smelly acceptance tests - Agile Dev Practices

How to detect smelly Acceptance Tests

Questions?

!   Not SMART

!   Slow - End-to-End

!   Irrelevant Details

!   Edge Cases

!   Erratic Tests

!   Shared mutable objects

!   Regression checks

!   UI details

Page 51: How to detect smelly acceptance tests - Agile Dev Practices

Why bother? Why care about smelly acceptance tests?

Page 52: How to detect smelly acceptance tests - Agile Dev Practices

Keep the team together

Page 53: How to detect smelly acceptance tests - Agile Dev Practices

Unstable tests - There is nothing worse No one likes to work with them

Page 54: How to detect smelly acceptance tests - Agile Dev Practices

Tools, Tools and more Tools

Page 55: How to detect smelly acceptance tests - Agile Dev Practices

Success is not in tools It’s in collaboration Select a tool that facilitates maximum collaboration

Page 56: How to detect smelly acceptance tests - Agile Dev Practices
Page 57: How to detect smelly acceptance tests - Agile Dev Practices
Page 58: How to detect smelly acceptance tests - Agile Dev Practices

De afbeelding kan niet worden weergegeven. Mogelijk is er onvoldoende geheugen beschikbaar om de afbeelding te openen of is de afbeelding beschadigd. Start de computer opnieuw op en open het bestand opnieuw. Als de afbeelding nog steeds wordt voorgesteld door een rode X, kunt u de afbeelding verwijderen en opnieuw invoegen.

Wat Rong Khun, Chiang Rai, Thailand

Page 59: How to detect smelly acceptance tests - Agile Dev Practices

Thank you! Please evaluate my presentation

See evaluation booklets in conference bag

Kishen Simbhoedatpanday

[email protected] @KishenPanday

Page 60: How to detect smelly acceptance tests - Agile Dev Practices

Xebium = Fitnesse + Selenium The Love & Hate

Page 61: How to detect smelly acceptance tests - Agile Dev Practices

Xebium & Layers of Abstraction

Fitnesse

Other Fixtures

API

DB

Xebium Selenium

Business level Workflow level

Technical level

Too technical level