Gherkin and Testing Framework Evaluation

Overview

Evaluation of Gherkin (Given/When/Then) syntax and alternatives for the organization’s pseudocode initiative. Originally compared with IEC 61131-3 Structured Text (removed as out-of-scope), then pivoted to evaluating alternatives that could replace or complement Gherkin.

Gherkin Strengths

  • Natural language readable by non-technical stakeholders
  • Given/When/Then maps to precondition/action/outcome
  • Strong communication bridge between Business Analysts and Developers

Gherkin Weaknesses

  • Tax on Prose — Maintenance cost of natural language parsed by regex
  • Linear structure — Poor at expressing combinatorial logic (50 lines for what a decision table shows in 5)
  • JSON/XML clumsiness — Data payloads look messy in feature files

Alternative Evaluation

ToolVerdictBest For
Robot FrameworkExcellent alternativeComplex/math-heavy logic — tabular inputs superior to text
Karate DSLStrong additionAPI-heavy data flow — native JSON support
Pytest-bddRisky for pseudocode100% developer teams only — loses business-readable layer
Mabl/AI RecordersRemove from scopePost-implementation validation, not pre-implementation design
Decision TablesStrong additionCombinatorial logic — cleaner than multiple Gherkin scenarios
Mermaid.js flowchartsVisual pseudocodeHappy path + error paths in single visual file

Critical Distinction: Specification vs. Execution

The pseudocode initiative is about defining logic before coding (specification), not testing after implementation (execution). This eliminates Mabl, Functionize, and pure code-based frameworks from consideration.

LevelFormatAudience
Level 1Gherkin / Natural language behaviorBusiness Analysts, PMs
Level 2Logic flow / Pseudocode / Decision tablesTechnical leads
Level 3Compiled code (ST, Python, etc.)Developers

Decision Matrix

Team CompositionRecommended Tool
Mixed (Dev + Product)Gherkin with strict style guides
Complex logic/mathRobot Framework
Data flow (API)Karate DSL
100% DevelopersPytest / JUnit