Behavior Driven Development for Plugin Writers - AtlasCamp 2011

1,353 views

Published on

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

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,353
On SlideShare
0
From Embeds
0
Number of Embeds
175
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Behavior Driven Development for Plugin Writers - AtlasCamp 2011

  1. 1. BDD for plugin writers... and giving your tests to Atlassian to run?!Josh GrahamSaaS Architect, Atlassianjgraham@atlassian.com@delitescere 2
  2. 2. Plugins are awesome 3
  3. 3. Plugins are challenging 4
  4. 4. Plugins are rewarding 5
  5. 5. Easier 6
  6. 6. Safer 7
  7. 7. BDDBehavior Driven Development 8
  8. 8. Overheard“ BDD = TDD + ” natural domain language #atlascamp @delitescere 10
  9. 9. Overheard“ BDD = Conversations that create software ” #atlascamp @delitescere 11
  10. 10. Outside-in 12
  11. 11. Collaboration QA Developer Business Owner User 13
  12. 12. Stakeholders• Devs • other systems, units of code...• BAs• QAs• Business Sponsors• Tech Writers• Users• Support 14
  13. 13. “ 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
  14. 14. “ If you’re not having conversations, you’re not doing BDD. ” Liz Keogh, BDDiva 16
  15. 15. Traceability class Issue { public Issue transition(Action action) { currentState = workflow.transition(this, action); } }Given an issue existsAnd that issue is in the Open stateWhen I perform the Close action on that issueThen that issue is in the Closed state 17
  16. 16. Business Outcomes 18
  17. 17. Plugin Developers• Executable specification of system behavior• Easily find regressions• Test forward / backward compatibility• Atlassian can run your tests?! 19
  18. 18. 20
  19. 19. BDD• Given / When / Then• Abstract • Domain’s ubiquitous language • Page Objects (if available) • HTML• A result of conversations 21
  20. 20. Consumers rule!• Consumer-Driven Contracts – Ian S. Robinson• A new approach to integration• Apply to plugins• Atlassian runs your tests?! 22
  21. 21. The Contract 23
  22. 22. Sharing a contract repoAtlassian Contract Your Plugin .git .git .git submodule submodule
  23. 23. Commit testsAtlassian Contract Your Plugin .git .git .git submodule submodule
  24. 24. Negotiate contractAtlassian Contract Your Plugin .git .git .git submodule submodule
  25. 25. Check contract violationAtlassian Contract Your Plugin .git .git .git submodule submodule
  26. 26. Commit changed testsAtlassian Contract Your Plugin .git .git .git submodule submodule
  27. 27. Renegotiate contractAtlassian Contract Your Plugin .git .git .git submodule submodule
  28. 28. Custom plugins? 30
  29. 29. 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 ” #atlascamp @delitescere 31
  30. 30. Overheard“ Consumer-Driven Contracts are some crazy awesome! jgraham@atlassian.com ” #atlascamp @delitescere 32
  31. 31. ✴ Object Design book http://www.amazon.com/Object-Design-Roles-Responsibilities- Collaborations/dp/0201379430✴ Domain Driven Design site http://www.domaindrivendesign.org✴ Using Mocks and Tests To Design Role-Based Objects article http://static.mockobjects.com/files/usingmocksandtests.pdf✴ Introducing BDD blog http://dannorth.net/introducing-bdd/✴ Consumer-Driven Contracts article http://martinfowler.com/articles/consumerDrivenContracts.html and http://iansrobinson.com/category/consumer-driven-contracts/✴ Rest In Practice site http://restinpractice.com/ 33
  32. 32. Cheers, big ears Josh Graham SaaS Architect, Atlassian jgraham@atlassian.com @delitescere

×