Gherkin メモ
「Gherkin」(ガーキン)というプログラムの書き方が紹介されていました。
考え方が良さ気なので、後で調べてみようと思います。(備忘録)
・Gherkinは期待された動作を理解する良い助けになる
Gherkinはテストのための記法の1つで、「こういう状態のとき、こういう動作を行えば、こうなることが期待される」という形式で記述していくものです。
ビアソンさんは「たとえ実際にテストでは使わなくとも、Gherkinを書くことでアプリがどういう動作を期待されているのか理解しやすくなる」と述べています。
### Gherkin is your friend to understand expectations
Gherkin is a test description format which points "Given that the system is in a certain state, When something happens, then this is expected".
Even if you don't use any testing tool that reads Gherkin, it will give you a good understanding of what it is expected from the app.
Gherkinの発音、読み方
gherkinとは
(酢漬け用)小キュウリ、ガーキン
Gherkin
ガーキンは、ピクルスとかに使われている小さいキュウリでした。
Gherkinの資料
Google検索
ドキュメント
使い方など
Gherkinは、Ruby、Railsの文化から発祥したようですが、他の言語でも取り入れられているようです。
PHPとかでもライブラリーがありました。
Behat Gherkin Parser
This is the php Gherkin parser for Behat. It comes bundled with more than 40 native languages (see i18n.php) support & clean architecture.
印象
- いろいろ準備が必要そうで、ちょっと面倒くさいかも?
- 実際にテストで使わなくても、コメントの書き方としてはありかも?
- 作者: Jonathan Rasmusson,玉川紘子
- 出版社/メーカー: オライリージャパン
- 発売日: 2017/09/21
- メディア: 単行本(ソフトカバー)
- この商品を含むブログ (2件) を見る