OpenQAOpenQA
Brain

How the Brain Works

The Brain is the core of OpenQA - an autonomous system that thinks, plans, and executes tests without human intervention.

The Thinking Loop

OpenQA's Brain operates in a continuous loop of analysis, thinking, action, and learning:

┌───────────┐     ┌───────────┐     ┌───────────┐
│  ANALYZE  │ →→→ │   THINK   │ →→→ │    ACT    │
└───────────┘     └───────────┘     └───────────┘
     │                  │                  │
     │                  │                  │
     └──────────────────┴──────────────────┘
                    LEARN
1

ANALYZE

Understands your application through its description, URL, and optionally your codebase

2

THINK

Decides what tests are needed and what specialized agents to create

3

ACT

Generates tests, creates agents, and executes the test suite

4

LEARN

Reviews results, identifies patterns, and adjusts strategy for next iteration

What the Brain Does

1. Application Analysis

When you provide your SaaS configuration, the Brain:

  • Parses your application description to understand its purpose
  • Identifies key features and user flows
  • Detects potential risk areas (forms, payments, auth)
  • If a repo is connected, analyzes code structure and dependencies

2. Test Strategy Planning

Based on the analysis, the Brain creates a testing strategy:

  • Prioritizes critical paths (checkout, login, signup)
  • Identifies security-sensitive areas for penetration testing
  • Plans regression tests for known bug-prone areas
  • Schedules performance tests for heavy pages

3. Dynamic Agent Creation

The Brain creates specialized agents on-the-fly:

text
🧠 Brain: "I see this app has a checkout flow. Let me create a specialist."
     ↓
🤖 Creates: "Checkout Flow Tester" agent with custom prompt
     ↓
🧪 Agent generates: 5 tests for cart, payment, confirmation
     ↓
✅ Executes tests, reports 2 bugs found

4. Continuous Improvement

After each test session, the Brain:

  • Analyzes which tests failed and why
  • Identifies flaky tests and marks them for review
  • Discovers new areas to test based on findings
  • Updates its understanding of the application

Triggering the Brain

Manual Trigger

bash
# Start a full autonomous session
curl -X POST http://localhost:3000/api/brain/run

# Just analyze without running tests
curl -X POST http://localhost:3000/api/brain/analyze

Automatic Triggers

The Brain can be triggered automatically:

  • On merge - When code is merged to main branch
  • On deploy - After a successful CI/CD pipeline
  • On schedule - At regular intervals (configurable)

Brain API

EndpointDescription
POST /api/brain/analyzeAnalyze app, get suggestions without running
POST /api/brain/runStart full autonomous testing session
POST /api/brain/generate-testGenerate a specific test
POST /api/brain/create-agentCreate a custom specialized agent
POST /api/brain/run-test/:idExecute a specific test

Next Steps