behavior driven development for plugin writers - atlascamp 2011

Post on 27-Jan-2015

106 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

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

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

BDD for plugin writers

2

Josh GrahamSaaS Architect, Atlassianjgraham@atlassian.com

@delitescere

3

Plugins are awesome

Plugins are challenging

4

Plugins are rewarding

5

Easier

6

Safer

7

BDD

8

Behavior Driven Development

#atlascamp @delitescere

Overheard

BDD=

TDD+

natural domain language ”

10

#atlascamp @delitescere

Overheard

BDD

=

Conversations that

create software

11

Outside-in

12

Collaboration

13

Business Owner

DeveloperQA

User

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

• other systems, units of code...

Stakeholders

14

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

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

doing BDD.

Liz Keogh, BDDiva”

16

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);

}

}

Business Outcomes

18

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

Plugin Developers

19

20

• Given / When / Then• Abstract

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

• A result of conversations

BDD

21

• Consumer-Driven Contracts –Ian S. Robinson

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

Consumers rule!

22

The Contract

23

Sharing a contract repo

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Commit tests

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Negotiate contract

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Check contract violation

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Commit changed tests

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Renegotiate contract

Atlassian.git

Your Plugin.git

Contract.git

submodule submodule

Custom plugins?

30

#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

#atlascamp @delitescere

Overheard

Consumer-Driven Contracts are some

crazy awesome!jgraham@atlassian.com

32

✴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

Cheers, big ears

Josh GrahamSaaS Architect, Atlassian

jgraham@atlassian.com @delitescere

top related