Each test in Gherkin files has a unique identifier following this format:
@TestID: [CATEGORY]-[SUBCATEGORY]-[SEQUENCE]
| Category | Prefix | Description |
|---|---|---|
| Arrays | ARR |
Array handling and operations |
| Edge Cases | EDG |
Edge cases and error conditions |
| Formatter | FMT |
Formatting and output styles |
| Integration | INT |
End-to-end integration tests |
| Lexer | LEX |
Tokenization and lexical analysis |
| Multi-line Strings | MLS |
Multi-line string handling |
| Numeric Properties | NUM |
Numeric property handling |
| Parser | PRS |
Parsing functionality |
| Performance | PRF |
Performance and benchmarks |
| Serializer | SER |
Serialization operations |
| Validator | VAL |
Schema validation |
Common subcategories include:
BASIC- Basic functionalityCOMPLEX- Complex scenariosERROR- Error handlingEDGE- Edge casesNESTED- Nested structuresVALID- Validation scenariosPERF- Performance specificFORMAT- Formatting specific
@TestID: ARR-BASIC-001- Basic array parsing@TestID: VAL-NESTED-005- Nested validation scenario@TestID: FMT-PRETTY-002- Pretty formatting test
[Fact]
public void Should_Parse_Simple_Array()
{
// @TestID: ARR-BASIC-001
// Scenario: Parse simple array
// Test implementation
}test('should parse simple array', () => {
// @TestID: ARR-BASIC-001
// Scenario: Parse simple array
// Test implementation
});def test_parse_simple_array():
"""
@TestID: ARR-BASIC-001
Scenario: Parse simple array
"""
# Test implementationIn Gherkin files, the test ID appears as a comment above each scenario:
# @TestID: ARR-BASIC-001
# Tests basic array parsing with numeric elements
Scenario: Parse simple array
Given I have a TON string "[1, 2, 3]"
When I parse the string
Then I should get an array with 3 elementsWhen working with tests:
- Always preserve Test IDs when modifying tests
- Reference Test IDs in commit messages when fixing tests
- Use Test IDs for cross-referencing between Gherkin and implementation
- Ensure Test ID consistency across all language implementations
- Never duplicate Test IDs - each must be unique
Test IDs should be tracked to ensure uniqueness. When adding new tests:
- Check existing IDs in the category
- Use next sequential number
- Document new ID in Gherkin file first
- Reference in all implementations
- Traceability - Easy to trace from requirement to implementation
- Cross-reference - Link tests across different languages
- Debugging - Quickly identify which specification failed
- Documentation - Clear test purpose identification
- Automation - Can be used for test filtering and reporting
- Test IDs must be unique across entire test suite
- Format must follow:
[A-Z]{3}-[A-Z]+-[0-9]{3} - Must appear in both Gherkin and implementation
- Sequential numbering within category/subcategory
© 2024 DevPossible, LLC. All rights reserved.