AI Debugging

AI-Powered Debugging: From 30 Minutes to 2 Per Failure

The biggest time sink is not writing code or fixing bugs. It is the context switching between reading error logs, finding the relevant file, and tracing back to the root cause.

0

Generates standard Playwright files you can inspect, modify, and run in any CI pipeline.

Open-source test automation

1. The Debugging Drag Problem

Debugging drag is the cumulative time lost to investigating test failures. It includes reading the error output, opening the relevant source file, understanding the application state at failure time, and determining whether the failure represents a real bug or a test issue. For a single failure, this process typically takes 15 to 30 minutes.

Multiply that by the number of failures a team investigates per week and the total hours become significant. A team with 10 test failures per week spends 2.5 to 5 hours just diagnosing failures before any fix work begins. This is time that produces no new features, no new tests, and no forward progress.

2. Context Switching as the Real Cost

The time spent reading the error message is small. The real cost is the context switching: moving from your current task to the failure investigation, loading the relevant code into your mental model, understanding the test's intent, and then switching back to your original task. Each switch carries a cognitive overhead that research estimates at 15 to 25 minutes of recovery time.

AI agents can absorb this context switching cost because they do not have an ongoing task to context-switch away from. An AI agent can receive a failing test, read the error output, examine the relevant source files, check the recent git history, and produce a diagnosis in about two minutes without losing focus on anything else.

Tests with built-in diagnostics

Assrt generates Playwright tests with trace recording and network logging for instant failure diagnosis.

Get Started

3. AI Diagnosis: Test Wrong or Code Wrong?

The first question when a test fails is whether the test needs updating or the code has a bug. This distinction matters because the actions are completely different: updating a test is a maintenance task while fixing a bug requires understanding the intended behavior and correcting the implementation.

AI agents can make this determination by comparing the test's assertions against the current UI state and recent code changes. If the test expects a button labeled "Submit" and the button now says "Save," a quick git log check reveals whether this was an intentional change. If the label change appears in a recent commit with a descriptive message, the test needs updating. If there is no related commit, the label change may be an unintended side effect.

4. Building Effective Failure Context

The quality of AI diagnosis depends on the context provided. A minimal context package includes: the test file with the failing assertion highlighted, the error output and stack trace, a screenshot or DOM snapshot at failure time, and the git diff of files touched by the test in the last 5 commits.

Richer context improves diagnosis accuracy. Adding the network request/response log, the browser console errors, and the test's natural language description (if available) gives the AI enough information to diagnose most failures without any human investigation. The investment in collecting this context pays for itself many times over in reduced debugging time.

5. Integrating AI Debugging into CI

The most effective integration point is as a CI step that runs immediately after a test failure. The step collects the failure context, sends it to an AI agent for diagnosis, and adds the diagnosis as a comment on the PR. By the time a developer looks at the failed build, the diagnosis is already waiting for them.

This approach transforms the failure investigation from an active task (developer must investigate) to a passive one (developer reviews the AI's diagnosis). In most cases, the diagnosis is accurate enough to guide the fix directly. In the remaining cases, it at least narrows the investigation to the right area, saving the developer from starting their diagnosis from scratch.

Ready to automate your testing?

Assrt discovers test scenarios, writes Playwright tests, and self-heals when your UI changes.

$npx @assrt-ai/assrt discover https://your-app.com