0% found this document useful (0 votes)
8 views10 pages

Gherkin Coding Standard

Uploaded by

s810531111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views10 pages

Gherkin Coding Standard

Uploaded by

s810531111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

2024/11/27 下午6:58 Gherkin Coding Standard

Gherkin Coding Standard


Version: 1.9
Author: Paul Jansen (TIOBE): [email protected]
Issuer: TIOBE

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 1/10
2024/11/27 下午6:58 Gherkin Coding Standard

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 2/10
2024/11/27 下午6:58 Gherkin Coding Standard

Change History
1.10 2024-05-29
Paul Jansen (TIOBE): - Improved synopsis of rule 'LargeScenario'.
1.9 2023-03-22
Paul Jansen (TIOBE): - Created initial version in TIOBE coding standard
viewer format.

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 3/10
2024/11/27 下午6:58 Gherkin Coding Standard

Features
Copyright
Synopsis Every Feature file should contain a copyright statement
Level 2
Category Features
Status Checked

FeatureDescription
Synopsis Each Feature should have a description
Level 3
Category Features
Status Checked

NoFeatureStartComments
Synopsis A Feature should not start with a comment
Level 8
Category Features
Status Checked

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 4/10
2024/11/27 下午6:58 Gherkin Coding Standard

General
ToDo
Synopsis Don't leave any TODOs in a test script
Level 6
Category General
Status Checked

WordsSpacing
Synopsis Remove redundant spaces
Level 9
Category General
Status Checked

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 5/10
2024/11/27 下午6:58 Gherkin Coding Standard

Scenarios
BackgroundOnlyGivenNoParameters
Synopsis Backgrounds should only contain Given Steps
Level 2
Category Scenarios
Status Checked

BackgroundsOnlySteps
Synopsis A Background should only contain Given Steps
Level 2
Category Scenarios
Status Checked

EmptyLineScenarios
Synopsis Make sure there is at least one empty line between Scenarios
Level 8
Category Scenarios
Status Checked

GivenAfterWhenOrThen
Synopsis There should be no Given after a When or a Then
Level 3
Category Scenarios
Status Checked

LargeScenario
Synopsis Scenarios should be too large
Level 4
Category Scenarios
Status Checked

MaxStepLength
Synopsis A Step should not be too large
Level 5
Category Scenarios
Status Checked

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 6/10
2024/11/27 下午6:58 Gherkin Coding Standard

NoAndOrButInSteps
Synopsis A Step should not contain "and" or "but"
Level 2
Category Scenarios
Status Checked

NoKeywordStartComments
Synopsis A Step comment should not start with a keyword
Level 3
Category Scenarios
Status Checked

NoRepeatingSetupSteps
Synopsis Create a Background for repeated setup Steps
Level 3
Category Scenarios
Status Checked

NoScenarioStartComments
Synopsis There should be no comments before a Scenario
Level 8
Category Scenarios
Status Checked

OnlyOneScenario
Synopsis A Scenario Outline should have more than one Scenario
Level 2
Category Scenarios
Status Checked

StepsBelongingToBackground
Synopsis Don't repeat Background Steps in a Scenario
Level 2
Category Scenarios
Status Checked

SubsequentGivensWhensThens
https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 7/10
2024/11/27 下午6:58 Gherkin Coding Standard

Synopsis There should be no subsequent Givens, Whens or Thens


Level 3
Category Scenarios
Status Checked

ThenAfterWhen
Synopsis There should be a Then after a When
Level 4
Category Scenarios
Status Checked

WhenAfterGiven
Synopsis There should be a When after a Given
Level 3
Category Scenarios
Status Checked

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 8/10
2024/11/27 下午6:58 Gherkin Coding Standard

Tables
DifferentValuesDatatable
Synopsis Columns with the same data have no use
Level 2
Category Tables
Status Checked

EmptyCell
Synopsis Don't leave empty cells in a Table
Level 2
Category Tables
Status Checked

NoIdenticalDataTableRow
Synopsis Tables should not contain identical rows
Level 1
Category Tables
Status Checked

TablesOutline
Synopsis Outline Tables nicely
Level 7
Category Tables
Status Checked

UseAllTableHeaders
Synopsis Make sure all Table headers are used
Level 2
Category Tables
Status Checked

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVlW… 9/10
2024/11/27 下午6:58 Gherkin Coding Standard

Literature

https://csviewer.tiobe.com/#/ruleset/rules?status=CHECKED,UNCHECKED&tagid=-pV-U1acQxaAqZM6A2hWag&setid=w9D93ap9SnGxHckVl… 10/10

You might also like