Skip to content

docs: Behat and AI#216

Merged
acoulton merged 2 commits intoBehat:v3.xfrom
carlos-granados:behat-and-ai
Feb 17, 2026
Merged

docs: Behat and AI#216
acoulton merged 2 commits intoBehat:v3.xfrom
carlos-granados:behat-and-ai

Conversation

@carlos-granados
Copy link
Contributor

Adds a documentation page explaining how Behat can be useful when using AI and which points to the new MCP server

behat_and_ai.rst Outdated
Human Review and Iteration
--------------------------

Generated scenarios should be reviewed to ensure they accurately represent the intended behaviour.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure here whether you mean scenarios (e.g. .feature files) or the implementation of steps (e.g. in context files)?

But I think maybe we need a stronger note of caution that Behat (or any testing tool) only adds value if the tests are sufficiently robust to prove the behaviour the scenario is claiming.

Maybe something more like:

Suggested change
Generated scenarios should be reviewed to ensure they accurately represent the intended behaviour.
As with any specification or testing tool, generated scenarios and assertions should be reviewed carefully. It is critical to ensure that both the human-readable scenarios the executable step definitions accurately represent the intended behaviour. They also need to be robust enough to prove that the actual behaviour matches the expectations, even if the implementation changes.

Copy link
Contributor

@acoulton acoulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @carlos-granados this is helpful, and good to highlight the benefits Behat (and BDD) can bring to agentic development.

Just a couple of notes of caution from me, to make sure users are clear on the limits of what Behat itself (/Behat + and AI) will do for you "out of the box".

behat_and_ai.rst Outdated
Maintaining Behaviour Over Time
-------------------------------

Behat ensures that behaviour remains stable as code changes. AI agents can safely modify or refactor code,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again here I think the claim is maybe a bit too strong: Behat won't protect you from an AI refactoring if your scenario & step definitions are too loose - or might add a lot of complication if they are too coupled to implementation details.

Maybe something more like:

Suggested change
Behat ensures that behaviour remains stable as code changes. AI agents can safely modify or refactor code,
With well-designed scenarios and step definitions, Behat ensures that behaviour remains stable as code changes. AI agents can safely modify or refactor code,

@carlos-granados
Copy link
Contributor Author

@acoulton good suggestions, updated

@acoulton acoulton merged commit 29e9e41 into Behat:v3.x Feb 17, 2026
4 checks passed
@acoulton
Copy link
Contributor

Thanks @carlos-granados

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments