49 / 108 · 03 Agentic Testing Architectures · The Critic-Actor Pattern← prev⊞ allnext →☰ Read as one page
6.8Variant: The Three-Agent Pipeline
For even higher quality, add a third agent -- the Specifications Analyst:
+------------+ +----------+ +----------+
| SPEC |------→| ACTOR |------→| CRITIC |
| ANALYST | | (writes | | (reviews |
| (extracts | | tests) |←------| tests) |
| test | +----------+ +----------+
| scenarios)|
+------------+
The Spec Analyst reads the specification and outputs a structured list of test scenarios before the Actor writes any code. This prevents the Actor from missing scenarios that the Critic would later identify as gaps.
class SpecAnalyst:
def analyze(self, spec: str) -> list[TestScenario]:
return self.llm.generate(f"""
Analyze this specification and enumerate every testable scenario:
{spec}
For each scenario:
- Category: happy_path | error | boundary | security | performance
- Description: one sentence
- Input: what data to use
- Expected outcome: what should happen
- Priority: must_have | should_have | nice_to_have
""")