Optivem Journal

Optivem Journal

Automated Testing

Stop Writing Fragile Gherkin

The Gherkin maintenance nightmare and how to solve it

Valentina Jemuović's avatar
Valentina Jemuović
Mar 06, 2026
∙ Paid

If you’ve ever written acceptance tests in plain-text Gherkin, you probably had the same thought I did:

“This looks clean… so why is it so painful to maintain?”

Gherkin was supposed to let product owners write specifications.

But in reality?

Almost never happens.

Developers write the .feature files.
Developers maintain them.
Developers debug them at runtime.

Most teams follow the usual setup: they write Gherkin scenarios in .feature files using Cucumber (Java), SpecFlow (.NET) or Cucumber.js (TypeScript).

At first glance, it looks great:

English sentences.
Given / When / Then.

But…

⚠️The Hidden Cost of Textual Gherkin

Scenario files look readable, but become a maintenance burden:

Scenario: Calculate base price as product of unit price and quantity
  Given a product with unit price $20.00
  When an order is placed for that product with quantity 5
  Then the order placement should succeed
  And the order base price should be $100.00

Duplication everywhere

That sentence in the .feature file?

You repeat it again in step definitions (“glue code“).

Change one word?
Now you change it in multiple places:

  • Change it in the step definition

  • Change it in all affected test scenarios

Typos = runtime failure

Misspell a word?

You won’t know until you run the test.

The compiler doesn’t help you.

Your IDE doesn’t help you.

You only find out after everything compiles… and then fails.

You’re on your own.

No auto-complete.
No “what comes next?”
No guardrails.

You have to remember exact sentences.

And nothing prevents you from:

  • Writing two When steps

  • Writing steps that don’t exist

  • Mixing domain concepts accidentally

It’s fragile by design.


Want to skip the pain and go straight to the solution?

I’m running a live workshop where we build acceptance tests that are compile-time safe, IDE-guided, and refactor-proof — no .feature files, no glue code.

Join the workshop →

Limited spots. Register now with the early bird discount - 100 EUR off with code EARLYBIRD100


💡What Changed Everything for Me

Instead of writing English sentences and matching them with strings…

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2026 Valentina Jemuović, Optivem · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture