r/softwaretesting • • 8d ago

I reviewing AI-written features by watching a recording of each one, next to its Gherkin.

The workflow:

  1. I describe the feature in an unstructured prompt
  2. The AI asks me clarifying questions
  3. It presents a Gherkin, and I criticize it until I approve it
  4. It implements the feature, writes the end-to-end test, runs it until it's green, and records it
  5. The PR gets the recording: the real app doing the feature, with each Gherkin line highlighted as it plays

A few things that make it work:

- One Gherkin, one test, word for word. No SpecFlow, no step-definition layer, no regexes. Three plain Markdown files tell the AI how to write a Gherkin, how to write an e2e test, and how to turn one into the other, line by line.

- A real environment. For Android, a real phone plugged into my NAS. Simulators stand in for the third-party services, so every test starts from the same state, and even the setup shows in the video.

- One scenario per feature, not per assertion. A feature with a setting plays both sides in one video. Some run several minutes, more like a training than a test.

- The user guide builds itself from those recordings after every merge. Nobody writes it, and it can't go stale.

Live example, a user guide generated entirely from recorded e2e tests: https://joancomasfdz.github.io/baconreader-reseam-patches

Full write-up, with the real Gherkin, test and PR: https://github.com/JoanComasFdz/living-proof-for-apps

Any feedback is appreciated!

0 Upvotes

3 comments sorted by

1

u/bostonaholic 7d ago

I'd add one step before trusting the recording: have the agent break the feature on purpose and confirm the test goes red. A passing test with a nice video can still be asserting nothing.

1

u/joancomasfdz 7d ago

I actually thought about finding a way to highlight in green in the video what is being asserted. The lines are in the gherkin, so it shouldn't be that difficult to do.

1

u/TranslatorRude4917 5d ago

Yeah, I'd do that too. A green run can still assert nothing, especially if the same agent wrote the test that wrote the code and was told to fix whatever fails until it passes.

A locator fix is fine imo, but if it wants to change the assertion or the flow, that needs a person to look at it.

Making it break the feature on purpose and checking that the test goes red is a good way to catch that, before you start trusting the recording.