Behavior-driven development: Difference between revisions

Content deleted Content added
Changed to goal to the user story example, so that it's clearer what the customer's motivation is
repair citation damage -- you can help, see WP:AGCR
Line 20:
At its heart, BDD is about rethinking the approach to [[unit testing]] and [[acceptance testing]] in order to avoid issues that naturally arise. For example, BDD suggests that unit test names be whole sentences starting with a conditional verb ("should" in English for example) and should be written in order of business value. Acceptance tests should be written using the standard agile framework of a [[user story]]: "Being a [role/actor/stakeholder] I want a [feature/capability] yielding a [benefit]". Acceptance criteria should be written in terms of scenarios and implemented in classes: [[Given-When-Then|Given [initial context], when [event occurs], then [ensure some outcomes] ]].
 
Starting from this point, many people developed BDD frameworks over a period of years, finally framing it in terms of a communication and collaboration framework for developers, [[quality assurance|QA]] and non-technical or business participants in a software project.<ref>{{Cite web |url=http://forums.pragprog.com/forums/95/topics/3035 |title=The RSpec Book – Question about Chapter 11: Writing software that matters |access-date=2009-08-09 |archive-url=https://web.archive.org/web/20091107220359/http://forums.pragprog.com/forums/95/topics/3035 |archive-date=2009-11-07 |url-status=dead }}</ref> During the "Agile specifications, BDD and Testing eXchange" in November 2009 in London, Dan North<ref>{{Cite web|author=Dan North|title=How to sell BDD to the business - {{pipe}} SkillsCast|url=https://skillsmatter.com/skillscasts/923-how-to-sell-bdd-to-the-business|access-date=2023-02-07|website=How skillsmatter.com|language=en|archive-url=https://web.archive.org/web/20101125022509/http://skillsmatter.com/podcast/java-jee/how-to -sell BDD -bdd-to -the -business |archive- {{pipe}} SkillsCast|languagedate=en2010-11-25}}</ref> gave the following description of BDD:
<blockquote>
BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters.</blockquote>
Line 28:
<ref>{{Citation|title=Interview with Liz Keogh & Dan North • GOTO 2013|url=https://www.youtube.com/watch?v=g5WpUJk8He4|language=en|access-date=2023-02-07}}</ref></blockquote>
 
Dan North created a BDD framework, [[JBehave (software)|JBehave]], followed by a story-level BDD framework for Ruby called RBehave<ref name="rbehave">D.North, [http://dannorth.net/2007/06/introducing-rbehave Introducing RBehave]</ref> which was later integrated into the [[RSpec]] project.<ref name="rbehave-integ">{{Cite web|author=Sean Miller|title=RSpec Adds Eagerly-Awaited RBehave Functionality for Integration Testing|url=https://www.infoq.com/news/2007/10/RSpec-incorporates-RBehave/|date=October 31, 2007|access-date=2023-02-07|website=InfoQ|language=en}}</ref> He also worked with David Chelimsky, Aslak Hellesøy and others to develop RSpec and also to write "The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends". The first story-based framework in RSpec was later replaced by [[Cucumber (software)|Cucumber]] mainly developed by [[Aslak Hellesøy]]. [[Capybara (software)|Capybara]], which is a part of the Cucumber testing framework is one such web-based test automation software.
 
==Principles of BDD==
Test-driven development is a software-development methodology which essentially states that for each unit of software, a software developer must:
 
* define a test set for the unit ''first'';
* make the tests fail;