23
BEHAVIOR-DRIVEN DEVELOPMENT THE CONCEPT OF Fabian Kiss

The concept of Behavior-Driven Development

Embed Size (px)

DESCRIPTION

The concept of Behavior-Driven Development

Citation preview

Page 1: The concept of Behavior-Driven Development

BEHAVIOR-DRIVEN DEVELOPMENTTHE CONCEPT OF

Fabian Kiss

Page 2: The concept of Behavior-Driven Development

UnitTesting

Page 3: The concept of Behavior-Driven Development

UnitTesting

test-first

Page 4: The concept of Behavior-Driven Development

UnitTesting

test-first

TDD

Page 5: The concept of Behavior-Driven Development

UnitTesting

test-first

TDD

BDD

Page 6: The concept of Behavior-Driven Development

BDD

?

“TDD done right”

Page 7: The concept of Behavior-Driven Development

BDD IS NOT ABOUT TOOLS

(ALTHOUGH THERE ARE TOOLS FOR BDD)

Page 8: The concept of Behavior-Driven Development

BDD

practices

Page 9: The concept of Behavior-Driven Development

BDD

maybe you already practice it(without being aware of it)

practices

Page 10: The concept of Behavior-Driven Development

BDD

maybe you already practice it(without being aware of it)

practices

Page 11: The concept of Behavior-Driven Development

BDD

practices

awareness

Page 12: The concept of Behavior-Driven Development

SYNTACTIC CONVENTIONS

method names are complete sentences

public class CustomerLookupTest extends TestCase { testFindsCustomerById() { ... } testFailsForDuplicateCustomers() { ... } ...}

“should” instead of “test”

testShouldFailForMissingSurnametestShouldFailForMissingTitle

...

http://dannorth.net/introducing-bdd/

Page 13: The concept of Behavior-Driven Development

WHAT TO TEST?

Page 14: The concept of Behavior-Driven Development

WHAT TO TEST? UNITS

Page 15: The concept of Behavior-Driven Development

CODE COVERAGE ...

Pict

ure

by P

eter

JBel

lis, l

icen

sed

unde

r the

CC

BY 2

.0

Page 16: The concept of Behavior-Driven Development

… A FALSE SENSEOF SECURITY

Pict

ure

by S

alim

Virj

i, lic

ense

d un

der t

he C

C BY

-SA

2.0

Page 17: The concept of Behavior-Driven Development

WHAT TO TEST? UNITSWHAT TO TEST?

Page 18: The concept of Behavior-Driven Development

WHAT TO TEST? UNITSWHAT TO TEST? BEHAVIOR

Page 19: The concept of Behavior-Driven Development

BEHAVIOR

constituted by scenarios (descriptions of them)

Page 20: The concept of Behavior-Driven Development

BEHAVIOR

constituted by scenarios (descriptions of them)

acceptance criteria

User story As a ... I want … So that ...

extract

Page 21: The concept of Behavior-Driven Development

BEHAVIOR

constituted by scenarios (descriptions of them)

acceptance criteria

User story As a ... I want … So that ...

extract

describe in DSL executable→

Page 22: The concept of Behavior-Driven Development

BEHAVIOR

constituted by scenarios (descriptions of them)

acceptance criteria

User story As a ... I want … So that ...

extract

describe in DSL executable→

Gherkin:Given a preconditionWhen an event occurredThen an outcome is achieved

Page 23: The concept of Behavior-Driven Development

BEHAVIOR

constituted by scenarios (descriptions of them)

acceptance criteria

User story As a ... I want … So that ...

extract

describe in DSL executable→

Gherkin:Given a preconditionWhen an event occurredThen an outcome is achieved

tool

execute