asos tech community live: atdd

32
1 Nik Crabtree Principal Software Engineer for Digital Experience Gareth Waterhouse Lead QA Engineer for Content & Product

Upload: nik-crabtree

Post on 17-Mar-2018

164 views

Category:

Software


0 download

TRANSCRIPT

1

Nik Crabtree

Principal Software Engineer for Digital Experience

Gareth Waterhouse

Lead QA Engineer for Content & Product

The Plan

It’s a what now?Shared Ownership

Shared UnderstandingTest-first

Acceptance CriteriaI Can Haz Demo

2

It’s a what now?

3

ATDD: Acceptance Test Driven Development

4

It’s a three-legged race, not a relay

5

We do Scrum

Scrum makes some very specific statements about ownership.

6

Shared Ownership

“Scrum recognizes no titles for Development Team members other than Developer, regardless of the work being performed by the person; there are no exceptions to this rule.”

7

Shared Ownership

http://www.scrumguides.org/scrum-guide.html#team-dev

“Scrum recognizes no sub-teams in the Development Team, regardless of particular domains that need to be addressed like testing or business analysis; there are no exceptions to this rule.”

8

Shared Ownership

http://www.scrumguides.org/scrum-guide.html#team-dev

“Individual Development Team members may have specialized skills and areas of focus, but accountability belongs to the Development Team as a whole.”

9

Shared Ownership

http://www.scrumguides.org/scrum-guide.html#team-dev

There are no heroes

The Development Team is responsible for every PBI in the sprint backlog.

10

Shared Ownership

There is no ‘dev complete’

It’s done when it’s proven to meet all of the acceptance criteria.

11

Shared Ownership

Not burning down to zero isn’t a failure

Throwing your team-mates under the bus is.

12

Shared Ownership

One hymn sheet between two please

13

{P} C {Q}

This is a Hoare Triple

Where P is a pre-condition assertion, C is a command and Q is a post-condition assertion.

If the pre-condition is met, executing the command establishes the post-condition.

14

Shared Understanding

15

{P} C {Q}

Ok, let’s put it another way…

Given the pre-condition P is met

When the command C is executed

Then it establishes the post condition Q

16

Shared Understanding

A Hoare Triple

is a logical function to which we provide input, invoke an action

and examine the output.

17

Shared Understanding

A Functional Test

is a logical function to which we provide input, invoke an action

and examine the output.

18

Shared Understanding

A Unit Test

is a logical function to which we provide input, invoke an action

and examine the output.

19

Shared Understanding

So…

We can write

Functional Tests

and Unit Tests

from the same

Acceptance

Criteria

20

Shared Understanding

21

Cats eyes for your development supercar

22

Test-first is not…

A waste of valuable delivery time

All about code coverage

An opportunity to start a holy war

Just for software engineers

Boring

23

Acceptance Criteria

Test-first is…

A way of engendering a lean approach to development (avoid gold-plating, over-engineering and breaking YAGNI)

A way of being confident that software meets requirements from the first line of code

All about understanding what you are doing and why

24

Acceptance Criteria

Building from a solid foundation

25

Acceptance Criteria should be…

Defined and agreed by the Development Team with the Product Owner

Written in a business readable, domain specific language, like Gherkin

Written from an Outside-In perspective

Expectations of behaviour, not implementation

26

Acceptance Criteria

Practical ATDD

27

Feature: Add SweetsIn order to populate the Sweets CatalogueAs a Sweets Catalogue ManagerI want to be able to add a new Sweet to the Sweets Catalogue

The Development Team discusses the story…

How do we pass credentials? What information does a new sweet contain? Are there any validation rules? What about duplicates? What if I send an empty request? What if the name is in a different case?

Feature: Get SweetsIn order to view a available sweet(s)As a Sweets Catalogue ReaderI want to be shown available sweet(s)And I want to be shown individual sweets

The Development Team discusses the story…

How do we pass credentials? What information does a new sweet contain? Are there any validation rules? What about duplicates? What if I send an empty request? What if the name is in a different case?

32