Given-When-Then

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

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. It derives its name from the three clauses used, which start with the words given, when and then. 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.

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. It derives its name from the three clauses used, which start with the words given, when and then. 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. GIVEN that the inventory contains 10 units of steel AND the inventory contains 30 units of copper WHEN we consume 2 units of steel AND we consume 10 units of copper AND we purchase 5 units of steel THEN the inventory should contain 13 units of steel AND the inventory should contain 20 units of copper AND the purchase of 5 units of steel should be registered in the expenses list

References

Text derived from https://en.wikipedia.org/w/index.php?oldid=1341102894 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

4 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.