Taming Chaos: Repeatable Testing (Part 3 of 4)

How to turn chaos into repeatable tests with universal BDD patterns: domain separation, quality rules, and automation from Jira to tests.

domingo, 17 de agosto de 2025 • 6 min read • Q2BSTUDIO Team

Artificial-Intelligence-

The Subtle Art of Herding Cats: How I Turned Chaos into a Repeatable Testing Process Part 3 of 4

In this installment, I explain how I validated the idea that universal BDD patterns work when implementation details are separated from observable human behavior. Here I present a practical summary, real examples, and lessons learned during the rollout of a workflow that goes from a Jira ticket to executable automated tests.

Universal principle: if two companies do the same thing, the BDD scenario is the same. Even if BMW and Mercedes implement configurators with different APIs and microservices, the user intent is the same: select packages, see the updated price, and detect conflicts. That is why tests should describe user intent, actions, and observable results, not system names or technical artifacts.

Common problem: scenarios contaminated by implementation. When Given When Then includes service names, endpoints, JSON, and component states, tests stop being transferable. Testers need to know the technical detail of each domain instead of focusing on human behavior.

Solution: universal scenarios centered on the person. Simple and reusable examples describe actions like selecting a premium package, seeing the updated total, receiving warnings about conflicts, and removing dependent options. These scenarios apply to any vehicle configurator, and the concrete implementation is handled separately through a domain configuration.

Domain separation: each company maintains its own mapping of values and endpoints. That mapping is not part of the BDD scenario but of the configuration layer that makes the same behavior run against BMW, Mercedes, Audi, or other systems. This separation makes it easier for testers and developers to understand requirements from the user's perspective.

Garbage in, garbage out. Many stories arrive poorly written: a single Then clause with dozens of results, mixing UI, business rules, service calls, and exceptions. That makes automation difficult and generates contradictory expectations. The response was to create a tool that first analyzes the ticket and applies quality rules before attempting to generate scenarios.

Full workflow implemented in Q2BSTUDIO: when a ticket arrives, four main steps are executed. Step 1: context extraction and minimal analysis to identify implicit requirements and positive and negative ones. Step 2: human-readable BDD generation following rules and gold standard examples. Step 3a: fitness assessment for automation with filters that include multi-step workflows and process validations and exclude unit tests or subjective UX checks. Step 3b: transformation of approved scenarios into code within a Test Automation Framework along with a report of necessary infrastructure, for example page objects and missing steps.

Context Smartness: so that the AI does not improvise, we load it only with rules and the minimal necessary context. It is not necessary to teach it the Given When Then syntax; the important thing is to guide the language toward observable results and human decisions. With this approach, the AI produces between 80 and 90 percent of the work and humans complete the final details.

State diagram in natural language: one of the problems detected is that language models do not know the concrete states of your application. Documenting states in plain text or with diagrams makes it easier for the agent to identify missing transitions and generate more complete tests. In Q2BSTUDIO we use flow descriptions and readable diagrams to validate paths and find edge scenarios that were not in Jira or in design.

Human quality controls: automation does not replace human responsibility. The system must offer options: accept the ticket as is, view suggested scenarios, rewrite applying single responsibility, or stop and ask for more information. The final decision is always made by a person.

Testing the system itself: we convert the rules into pseudo code and ask the agent to generate unit tests on good and bad examples. This way we maintain integrity when rules change and prevent the AI from degrading the process with context drift.

Observed gains: consistency in scenario writing, significant increase in speed in specification generation, creative detection of edge cases, and clearer documentation that serves as a source of truth. Additionally, onboarding of new members improves because behavior-centered scenarios are self-documenting.

Persistent challenges: domain drift when the AI introduces specific details into universal patterns, handling edge cases that require business knowledge, and the need to keep domain configurations updated as products evolve. Process or human communication problems are also not solved: if requirements arrive poorly, the AI cannot invent clarity.

Key lessons learned: 1 Domain separation prevents technical variability from masking business rules. 2 Human quality control cannot be automated; the AI improves what it receives but does not fix bad specifications on its own. 3 The human must retain the final say and validate changes.

Summarized practical guide for teams that want to replicate the approach in their organization: create gold standards from your best BDD scenarios, extract minimal rules and focus tasks by function, implement a Task 1 to Task 3b workflow with lazy loading of context, measure consistency between generated and manual scenarios, and refine rules based on real use.

How Q2BSTUDIO helps: We are a software development company for custom applications and custom software specialized in artificial intelligence, cybersecurity, and cloud services aws and azure. We offer business intelligence services, implement ai for companies, and AI agents that integrate with Power BI for visualization and decision-making. We work with clients to design AI agents that generate specifications, automate tests, and maintain traceability between requirements and code, all with an emphasis on security and scalability in the cloud.

Typical use cases we solve: BDD test automation for custom applications, CI CD pipeline integration with behavior-based tests, development of AI agents that analyze tickets and suggest steps, and business intelligence projects that combine operational data with Power BI visualizations to monitor quality and risk.

Moving toward Part 4: in the next installment I will share the discovery of Context Rot and how we detected performance degradation months before it was evident, the market paradox where simple solutions are ignored in favor of flashy tools, and lessons on AI reliability applicable to any team seeking consistency.

In summary: centralizing human behavior, separating domain configuration, applying quality rules, and maintaining human oversight makes it possible to turn chaos into repeatable and scalable processes. At Q2BSTUDIO we combine experience in custom development, artificial intelligence, and cybersecurity to help companies implement these workflows and leverage AI agents with security and performance in aws and azure cloud environments.

Author and final note: this article is based on practical testing and automation experience that demonstrated that universal BDD patterns work when kept free of technical details. If you want to implement a similar workflow or explore how to bring AI agents and Power BI to your organization, at Q2BSTUDIO we can help you design the right solution.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.