behavior driven development for plugin writers - atlascamp 2011

34

Upload: atlassian

Post on 27-Jan-2015

106 views

Category:

Technology


0 download

DESCRIPTION

For plugins or extensions that alter the UI or external behavior of Atlassian products, it is important to write acceptance tests that allow you to specify what you expect to see with the plugin or extension enabled and ascertain when upgrades in the products alter the behavior such that your plugin or extension no longer does what you expect it to do. Behaviour Driven Development is an approach that lets you quickly understand when you have introduced a bug, the desired behavior has changed underneath you, or the test (or some feature of your plugin) is no longer relevant.Joshua Graham, SaaS Architect

TRANSCRIPT

Page 1: Behavior Driven Development for Plugin Writers - AtlasCamp 2011
Page 2: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

... and giving your tests to Atlassian to run?!

BDD for plugin writers

2

Josh GrahamSaaS Architect, [email protected]

@delitescere

Page 3: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

3

Plugins are awesome

Page 4: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Plugins are challenging

4

Page 5: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Plugins are rewarding

5

Page 6: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Easier

6

Page 7: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Safer

7

Page 8: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

BDD

8

Behavior Driven Development

Page 9: Behavior Driven Development for Plugin Writers - AtlasCamp 2011
Page 10: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

#atlascamp @delitescere

Overheard

BDD=

TDD+

natural domain language ”

10

Page 11: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

#atlascamp @delitescere

Overheard

BDD

=

Conversations that

create software

11

Page 12: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Outside-in

12

Page 13: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Collaboration

13

Business Owner

DeveloperQA

User

Page 14: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

• Devs• BAs• QAs• Business Sponsors• Tech Writers• Users• Support

• other systems, units of code...

Stakeholders

14

Page 15: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

BDD is as much about the interactions between the

various people in the project as it is about the

outputs of the development process

Dan North, BDDiddy

15

Page 16: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

If you’re not having conversations, you’re not

doing BDD.

Liz Keogh, BDDiva”

16

Page 17: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Traceability

17

Given an issue existsAnd that issue is in the Open state

When I perform the Close action on that issue

Then that issue is in the Closed state

class Issue {

public Issue transition(Action action) {

currentState = workflow.transition(this, action);

}

}

Page 18: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Business Outcomes

18

Page 19: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

• Executable specification of system behavior• Easily find regressions• Test forward / backward compatibility• Atlassian can run your tests?!

Plugin Developers

19

Page 20: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

20

Page 21: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

• Given / When / Then• Abstract

• Domain’s ubiquitous language• Page Objects (if available)• HTML

• A result of conversations

BDD

21

Page 22: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

• Consumer-Driven Contracts –Ian S. Robinson

• A new approach to integration• Apply to plugins• Atlassian runs your tests?!

Consumers rule!

22

Page 23: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

The Contract

23

Page 24: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Sharing a contract repo

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Page 25: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Commit tests

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Page 26: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Negotiate contract

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Page 27: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Check contract violation

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Page 28: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Commit changed tests

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Page 29: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Renegotiate contract

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Page 30: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Custom plugins?

30

Page 31: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

#atlascamp @delitescere

Overheard

1) Have a conversation with your users about how

the plugin should behave

2) Write it as a spec

3) Give it to us

31

Page 32: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

#atlascamp @delitescere

Overheard

Consumer-Driven Contracts are some

crazy [email protected]

32

Page 33: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

✴Object Design bookhttp://www.amazon.com/Object-Design-Roles-Responsibilities-Collaborations/dp/0201379430

✴Domain Driven Design sitehttp://www.domaindrivendesign.org

✴Using Mocks and Tests To Design Role-Based Objects articlehttp://static.mockobjects.com/files/usingmocksandtests.pdf

✴ Introducing BDD bloghttp://dannorth.net/introducing-bdd/

✴Consumer-Driven Contracts articlehttp://martinfowler.com/articles/consumerDrivenContracts.html andhttp://iansrobinson.com/category/consumer-driven-contracts/

✴Rest In Practice sitehttp://restinpractice.com/

33

Page 34: Behavior Driven Development for Plugin Writers - AtlasCamp 2011

Cheers, big ears

Josh GrahamSaaS Architect, Atlassian

[email protected] @delitescere