Given-When-Then Explained
Given-When-Then (GWT) is a semi-structured way to write down test cases. They can either be tested manually or automated as browser tests with tools like Selenium and Cucumber.[1] [2]
It derives its name from the three clauses used, which start with the words given, when and then.[3] Given describes the preconditions and initial state before the start of a test and allows for any pre-test setup that may occur. When describes actions taken by a user during a test. Then describes the outcome resulting from actions taken in the when clause.
The Given-When-Then was proposed by Dan North in 2006, as part of behavior-driven development.[4]
See also
Notes and References
- Book: Percival, Harry . Test-Driven Development with Python: Obey the Testing Goat: Using Django, Selenium, and JavaScript . 2014-06-11 . "O'Reilly Media, Inc." . 978-1-4493-6517-2 . en.
- Book: Pugh, Ken . Lean-Agile Acceptance Test-Driven Development: Better Software Through Collaboration . 2010-12-22 . Pearson Education . 978-0-321-71944-7 . en.
- Web site: Perryn Fowler's Weblog. Fowler. Perryn. 24 November 2009. 14 August 2014. https://archive.today/20140814232159/http://www.jroller.com/perryn/entry/given_when_then_and_how. 14 August 2014. dead.
- Web site: Using "Given-When-Then" to Discover and Validate Requirements. Gorman. Mary. Ellen Gottesdiener . 9 December 2012. 14 August 2014.