Behat (computer science)
   HOME

TheInfoList



OR:

Behat is a test framework for behavior-driven development written in the PHP programming language. Behat was created by Konstantin Kudryashov and its development is hosted on
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continu ...
.


Purpose

Behat is intended to aid communication between developers, clients and other stakeholders during a software development process. It allows the clear documentation of testable examples of the software's intended behaviour. Behat test scenarios are written with
Gherkin A pickled cucumber (commonly known as a pickle in the United States and Canada and a gherkin in Britain, Ireland, South Africa, Australia, and New Zealand) is a usually small or miniature cucumber that has been pickled in a brine, vinegar, or ...
, a business-readable domain-specific language following defined patterns.


Benefits

Tests can be run at any point new code is introduced into a codebase to confirm no regressions within the existing test coverage are introduced. It can be integrated with
Selenium Selenium is a chemical element with the symbol Se and atomic number 34. It is a nonmetal (more rarely considered a metalloid) with properties that are intermediate between the elements above and below in the periodic table, sulfur and tellurium, ...
and other browser emulators to generate screenshots of failures. Like other BDD frameworks, Behat scenarios are a series of Given, When, and Then steps that explain a business case. The definition of these steps exist within method
annotations An annotation is extra information associated with a particular point in a document or other piece of information. It can be a note that includes a comment or explanation. Annotations are sometimes presented in the margin of book pages. For anno ...
of a class that extends the BehatContext.BDD With Behat - Tuts+ Code Tutorial
Code.tutsplus.com (2013-12-23). Retrieved on 2015-03-19.


Examples

The preconditions after "Given" correspond to the PHP method name to execute: Feature: Function to test description Free text Scenario: Scenario 1 Given preconditions When actions Then results Scenario: Scenario 2 ...


References


External links

* Free software programmed in PHP PHP Software using the MIT license Free software testing tools {{compu-prog-stub