sdet-roadmap

🤖 AI-Assisted Testing

Status Level Duration

Most QA roadmaps don’t have this module yet. In two years, every one of them will. Might as well learn it properly now instead of panic-learning it later.


📑 Table of Contents


🎭 Two Very Different Skills, One Module

This module covers two things that get lumped together as “AI testing” but are actually opposite directions of the same relationship:

graph LR
    A[AI-Assisted Testing] --> B["Using AI TO TEST<br/>(AI as your tool)"]
    A --> C["Testing AI ITSELF<br/>(AI as the thing under test)"]

    B --> B1[Generate test cases]
    B --> B2[Generate Playwright code]
    B --> B3[Triage defects]

    C --> C1[Test a chatbot]
    C --> C2[Test fraud detection]
    C --> C3[Test AI dispute resolution]

    style B fill:#cfe2ff
    style C fill:#ffeaa7

The first half (AI as your tool) makes you faster. The second half (testing AI as the product) makes you valuable — it’s a genuinely rare skill right now, and it’s only going to become more common as more products ship AI features. Both halves matter. Don’t skip the second one because the first one is more immediately gratifying.


⚖️ Where AI Actually Helps (and Where It Confidently Lies)

Let’s kill the hype early, because an SDET who trusts AI output blindly is more dangerous than one who ignores AI entirely — at least the second one knows what they don’t know.

AI is genuinely good at AI is genuinely bad at
First-draft boilerplate (a test skeleton, a POM class shape) Knowing your app’s actual business rules without being told
Brainstorming edge cases you didn’t think of Knowing which edge cases actually matter for this system
Explaining an unfamiliar error message Confirming a fix is genuinely correct vs. just plausible-looking
Summarizing/clustering a big batch of bug reports Deciding severity/priority — that needs business context
Converting a rough idea into clean Gherkin/test-case format Generating realistic domain data (an AI-guessed “valid IFSC code” often isn’t)

[!IMPORTANT] AI-generated content is confident by default, correct only sometimes. It doesn’t hedge the way a junior QA engineer who’s unsure would. A junior engineer says “I think this might work, not 100% sure.” An LLM says “Here is the correct test case” with identical confidence whether it’s right or completely fabricating a method that doesn’t exist. Treat every AI output as a first draft from a fast, occasionally-wrong intern — not as finished work.


📝 Generating Test Cases From a Requirement

Bad prompt (too vague, gets you generic filler):

Write test cases for a login page.

Good prompt (specific, gives the AI the actual constraints to reason about):

Write test cases for a login form with these rules:
- Email field: required, must be valid email format
- Password field: required, 8-16 characters
- Account locks for 15 minutes after 3 failed attempts
- "Remember me" checkbox persists session for 30 days

Cover: positive cases, negative cases, boundary values for the lockout counter,
and at least 2 security-related scenarios (SQL injection attempt, XSS in email field).
Format as a table: ID, Scenario, Steps, Expected Result.

The difference isn’t the tool — it’s you supplying the actual business rules from the requirement. This is exactly the Equivalence Partitioning / Boundary Value thinking from Module 01 — AI doesn’t replace that skill, it executes it faster once you’ve told it what the boundaries actually are. An AI that wasn’t told “3 attempts” and “15 minutes” has no way to know those are the numbers that matter — it’ll guess plausible-sounding ones instead, and plausible-sounding is not the same as correct.

The step you’re not allowed to skip: read every generated test case against the actual requirement before it goes anywhere near your test suite. AI reliably hallucinates plausible edge cases that don’t apply to your system, and just as reliably misses the one genuinely weird edge case a human who’s used the actual product would catch immediately.


🎭 AI-Assisted Playwright Code

Same discipline, applied to code instead of test case tables.

Reasonable use — generate a first-draft page object from a rough description:

Generate a Playwright TypeScript Page Object class called BeneficiaryPage.
It extends a BasePage class that already provides navigate(), click(), fill().
Fields: beneficiary name, account number, IFSC code, a "Save" button.
Use getByLabel as the primary locator strategy with a data-testid fallback,
matching this pattern: [paste one example locator from your own codebase]

You’ll get something like 80% correct — right shape, plausible method names, probably wrong or outdated locator syntax, definitely no idea what your app’s actual field labels are. That’s fine. That’s what a first draft is for.

What you do NOT do: paste that output straight into your framework and commit it. Every AI-generated test needs the same review a human’s first draft would get:

graph LR
    A[AI generates code] --> B{Does it even compile?}
    B -->|No| A
    B -->|Yes| C{Do the locators match<br/>the REAL app?}
    C -->|No| D[Fix locators against real DOM]
    D --> E{Does the assertion<br/>test something real?}
    C -->|Yes| E
    E -->|No, it's checking nothing meaningful| F[Rewrite the assertion]
    E -->|Yes| G[✅ Now it's ready to commit]
    F --> G

    style A fill:#fff3cd
    style G fill:#d4edda

That middle step — “does the assertion test something real” — is where AI output fails most often and most dangerously. AI happily generates a test that passes because it’s checking expect(true).toBe(true) in spirit, even if it’s dressed up as expect(response.status()).not .toBe(999). A passing test that isn’t actually verifying anything meaningful is worse than no test — it gives false confidence.


🔍 AI-Assisted Defect Triage

With a big batch of bug reports (say, after a large regression run), AI is genuinely useful for:

Given these 5 bug titles and descriptions, group them by likely root cause
and suggest which ones might be duplicates:
1. "Refund button disabled after page refresh"
2. "Settlement amount shows NaN for INR transactions over ₹1,00,000"
3. "Refund fails silently when clicked twice quickly"
4. "Export button greyed out on Firefox only"
5. "Double-click on refund creates two refund records"

A competent AI will likely flag #3 and #5 as probably the same root cause (a missing debounce/idempotency check on the refund button) even though they were reported with different titles by different testers. That’s a genuinely useful triage assist — it turns 40 raw reports into maybe 12 real root-cause clusters before a human spends an hour doing the same grouping by hand.

What it can’t do: decide business severity. “Is this P1 or P2” depends on revenue impact, user volume, and business priorities AI doesn’t have visibility into — that’s still a human (or Product) call, exactly as covered in Module 01’s Severity vs. Priority section.


🧠 Testing AI-Driven Features (The Harder Half)

Now flip the relationship: the feature itself uses AI or ML. A fraud-detection system, a support chatbot, a recommendation engine. Testing these is genuinely different from testing a deterministic feature, for one core reason:

A traditional feature gives the same output for the same input, every time. An AI feature might not — and “might not” is exactly the thing you now have to test for, instead of ignoring.

This breaks the assumption baked into almost every test you’ve written so far in this roadmap: “same input → same expected output → simple toBe() assertion.” You need a different mental model:

Traditional feature testing AI feature testing
Exact output match Output within an acceptable range/category
One test run is representative May need multiple runs to catch inconsistency
Bug = wrong output Bug = wrong output OR unjustified low-confidence OR silent overconfidence
Pass/fail is binary Also test: does it escalate to a human when it should?

🏦 Real Example: Testing a Shared AI Dispute Engine

Here’s a real, concrete case — an AI-powered dispute/support resolution engine (ai-dispute-resolution-engine) that sits as the shared final destination for support issues raised from five different fintech products (Collection, Payout, Connected Banking, BBPS, Reseller). Instead of five separate chatbots, one shared AI layer handles all of them — which is efficient, but creates a very specific testing problem:

A regression in intent recognition found only through Payout-originated tickets could just as easily be silently degrading Collection, Connected Banking, BBPS, and Reseller’s support quality too — if nobody explicitly tests it per originating product.

That single sentence is the entire testing philosophy for shared AI systems in one line. Here’s what the actual test dimensions look like for a system like this:

1. Intent recognition accuracy — does it understand what’s actually being asked?

Input: "why is my payout stuck"
Expected category: Transaction Status
Input: "the commission I got for this merchant looks wrong"
Expected category: Commission / Revenue Dispute

2. Cross-product consistency — same question, different origin, same quality of answer:

Same "transaction stuck" question, raised from Collection AND from Payout AND from BBPS
→ all three should classify and resolve with equivalent quality, not just "it worked for
   whichever product QA happened to test with"

3. Escalation behavior — does it know when to admit it doesn’t know?

A genuinely ambiguous or high-stakes query (e.g. a large commission dispute) should
escalate to a human agent rather than the AI confidently guessing — test that the
escalation path actually fires, not just that the AI attempts an answer every time.

4. Context retention — does it remember the last 3 messages, or is it goldfish-brained?

Message 1: "My transaction TXN-4471 is stuck"
Message 2: "when was it initiated?"
             ^ Does the AI still know we're talking about TXN-4471, or did it forget?

5. Non-determinism tolerance — run the same input 5 times, does the category stay stable even if exact wording varies?

Same input, 5 runs → intent category should be identical all 5 times, even if the
AI's exact response phrasing legitimately varies run to run.

That last point is the crux of the whole module: you’re not testing for identical text anymore — you’re testing for a stable, correct classification underneath text that’s allowed to vary. Get comfortable writing assertions like “response category is one of these 3 valid values” instead of “response equals this exact string.”


✅ A Practical AI-Feature Testing Checklist

Use this whenever you’re handed an “it has AI in it” feature to test:


✍️ Hands-On Exercise

  1. Pick any requirement from a project you’ve worked with in this roadmap (or write a short one yourself — 5-6 sentences describing a feature). Use an AI tool to generate test cases from it, then mark up the output: which cases are genuinely useful, which are generic filler, which miss something a human tester would have caught immediately?
  2. Use AI to generate a Playwright test for a page you already automated in Module 03 or 05. Run it. Count how many lines you had to fix before it actually passed against the real app.
  3. Design (on paper — you don’t need a real AI chatbot to do this exercise) a test plan for “does this support chatbot escalate to a human when it should?” — write at least 5 concrete scenarios that should trigger escalation, and explain why each one is a legitimate escalation trigger rather than something the AI should attempt to answer itself.

⚠️ Common Mistakes

Mistake Why It Bites You Fix
Committing AI-generated tests without review Locators/assertions often don’t match reality or check nothing meaningful Treat every output as a first draft, review like a human’s PR
Testing an AI feature with exact-string assertions Fails on legitimate response variation, becomes a maintenance nightmare Assert on category/intent/range, not exact text
Only testing the happy path for an AI feature Misses exactly the failure modes AI is prone to (overconfidence, drift) Explicitly test escalation, ambiguity, adversarial input
Trusting an AI severity/priority suggestion as final AI has no visibility into real business impact Human review for anything business-impact-related
One test run “proving” an AI feature works Non-deterministic systems can pass once and fail the next run Run repeatedly, assert on stability, not a single pass

🎓 Next Steps

You’ve now got the full modern SDET toolkit — manual foundations, API, UI automation, framework architecture, CI/CD, and AI literacy on both sides of the relationship. Last stop: put all of it together into real, portfolio-ready projects.

Next Module: → 10-real-world-projects


⬆ Back to Top 🏠 Main README