BXUP Track progress & test yourself — free
QA & Testing · Module · ~10 min read
QA & TESTING · MODULE

Test Data, Environments & Non-Functional Testing with AI

Test data is where QA meets the law: a production extract pasted into a public chatbot is a compliance incident, not a shortcut. This module builds the privacy-safe pipeline — PII masking before any prompt, schema-constrained synthetic data, adversarial datasets — then applies calibrated trust to accessibility, i18n, performance and compatibility testing with AI.

Two forces make this module first-class rather than an appendix. India's DPDP Act 2023 and its 2025 Rules put real penalties — up to ₹250 crore — behind personal-data mishandling, and GDPR has enforced the same discipline in Europe for years; production-derived test data is squarely in scope. Meanwhile the services reality is that testers on client accounts often may not paste client data into public AI tools at all, per contract. The engineers who can generate realistic, schema-valid, legally clean test data — and who know exactly what may enter which tool — are solving a problem their whole account has.

The scenario — the extract that almost became an incident

  1. TUESDAY

    Meera — senior QA on a payments integration project at a services company, client is a mid-size lender — needs realistic loan-application data for edge-case testing. The staging database is stale. A teammate offers the pragmatic shortcut everyone has seen: "grab a production extract, scrub the obvious columns."

  2. TUESDAY, 15:40

    The extract has 12,000 rows. Names and PANs are in the obvious columns — but PII is also inside free-text fields: phone numbers in agent notes, an Aadhaar number typed into a comments field, email addresses in dispute descriptions. Column-level scrubbing misses all of it.

  3. 15:55

    A junior on the team, trying to be helpful, pastes 50 raw rows into a public chatbot to "generate more like these." Meera catches it in review. Client personal data has now left the approved boundary — a reportable event under the client contract, and DPDP exposure for real.

  4. THE REBUILD

    The team builds the pipeline this module teaches: Microsoft Presidio scans every field — free text included — and masks findings; anything sensitive that needs LLM processing runs on a local model via Ollama; synthetic data is generated to the Pydantic schema and validated in a loop; and a one-page decision tree says what may enter which tool, signed by the account lead.

  5. FRIDAY

    The synthetic dataset is better than the extract: referential integrity intact, distributions realistic, plus the edge cases production rarely coughs up on demand — Unicode names, leap-day birthdates, boundary-length address fields. And nothing in it maps to a real human.

The near-miss is the norm, not the outlier: column-level thinking about PII, helpful juniors, and public tools one paste away. The fix is not vigilance — vigilance doesn't scale — it is a pipeline where the safe path is also the easy path.

What You'll Learn

  • Schema-constrained synthetic datarealistic relational datasets with referential integrity, distributions and locales, generated to a Pydantic/SQL schema and validated in a loop (UC-27).
  • Privacy-safe pipelinesPII discovery including free-text fields, masking before any prompt, local models for sensitive steps, and the per-tool data decision tree (UC-28).
  • Adversarial datasetsmalformed payloads, Unicode/RTL/emoji, boundary dates and oversized inputs, generated systematically and tagged by risk (UC-29).
  • Mocks and environmentscontract-accurate fakes from specs or recorded traffic, plus compose stacks and CI files scaffolded and explained line by line (UC-30, UC-31).
  • Accessibility with calibrated trustthe three-layer protocol: scanner, AI explanation with WCAG citations, and the manual pass automation cannot replace (UC-32).
  • i18n, compatibility and performancepseudo-localization with vision-model layout checks, analytics-driven device matrices, and k6/JMeter scripting with honest result interpretation (UC-33, UC-35, UC-34).

The data pipeline — masking first, generation second

The pipeline has a strict ordering, and the ordering is the compliance argument: nothing derived from production touches an external model until PII detection and masking have run.

  1. Discover. Presidio-class scanners detect PII by type — names, phones, emails, government IDs, cards — across every field, because the free-text columns are where column-level scrubbing dies. Tune recognizers for your locale's identifiers (PAN, Aadhaar, IFSC in India) and review detection samples; scanners have both misses and false alarms.
  2. Mask or pseudonymize. Replacement values keep format validity (a masked phone still looks like a phone) so downstream validation doesn't choke. Pseudonymization — consistent fake identities — preserves referential integrity across tables when tests need the same "customer" in orders and disputes.
  3. Route by sensitivity. Anything still sensitive after masking, or too risky to send out at all, runs on a local model (Ollama-class) inside the boundary. Local models are weaker; for masking review, format transformation and structured generation they are entirely sufficient — matching model strength to data sensitivity is the skill.
  4. Generate synthetic, validate in a loop. With the schema as ground truth (Pydantic models or SQL DDL), the LLM generates rows; the validator rejects violations; rejects loop back with the error attached. Faker and SDV supply statistical volume; the LLM's edge is coherent realism — plausible line items that match totals, dispute notes that read like the dispute — plus on-demand edge cases.

The decision tree — the artifact auditors and account leads actually want — fits in one table:

Data classPublic AI toolsEnterprise/approved endpointLocal modelNotes
Raw production dataNeverNeverOnly inside the client boundary, if contract allowsPresidio scan first, always
Masked/pseudonymized extractNoWith client sign-offYesMasking must be verified, not assumed
Fully synthetic dataYesYesYesProvenance documented — "synthetic" must be provable
Client requirements & defect textPer client contractUsually yesYesFree text carries PII too — scan it
Warning

PII lives in free-text fields — agent notes, comments, descriptions — not just in labeled columns. A masking step that only touches the schema-obvious columns produces an extract that looks clean and isn't, which is more dangerous than raw data because people stop being careful with it.

Adversarial data and mocks — engineering the inputs that break things

Realistic data proves the happy path; adversarial data finds the bugs. Generate it by category with risk tags, not as a grab bag — coverage claims need structure:

  • Encoding hostilesUnicode beyond ASCII, RTL scripts, emoji, zero-width characters, normalization traps; the big-list-of-naughty-strings corpus plus LLM-generated variants targeted at your fields.
  • Boundary dates and numbersleap days, DST transitions, epoch edges, century boundaries; zero, negative-zero, max-int neighbors, float precision traps on money fields.
  • Structural malformationtruncated JSON, wrong types, missing required fields, duplicate keys, oversized payloads — aimed at your parsers' error handling, which is where malformation bugs actually live.
  • Property-based backupHypothesis-class tools generate what example thinking never will; the LLM helps you write generators and invariants, and the tool does the exploring.

Environment dependence, meanwhile, is a top flake cause from Module 4 — and mocks are the fix. WireMock/MSW/Prism fakes generated from OpenAPI specs or recorded traffic give you deterministic dependencies, and the mock must track the contract: a mock that drifts from the real API converts integration bugs into "passing" tests. Regenerate from the current spec on a schedule, and keep one real-integration path in the pipeline as the drift alarm. The same codegen discipline scaffolds docker-compose test stacks and CI workflow files — with every line explained, because an environment nobody understands is an outage nobody can fix. If the agent writes your compose file, the agent also writes the line-by-line commentary, and you read it (UC-30, UC-31).

Accessibility — the calibrated-trust exemplar

Accessibility testing is where this track's central skill — knowing exactly how much to trust an automated layer — shows up in its purest form, because the numbers are published and stark: automated scanners catch only roughly 30–40% of WCAG issues. Practitioner consensus, not vendor pessimism. The protocol that respects those numbers has three layers:

LAYER 1 + 2

Scanner, then AI explanation

axe-core or Pa11y scans every page state — cheap, fast, in CI. Then the LLM turns each violation into something actionable: the WCAG criterion cited, why it matters to a real user, a suggested fix in your framework's idiom. This is where AI genuinely helps: a scan report developers understand gets fixed; a wall of rule IDs gets ignored.

LAYER 3

The human pass

Keyboard-only navigation: every interaction reachable, focus visible, no traps. Screen-reader walkthrough: does the experience make sense — reading order, announcements, context? Scanners verify attributes exist; they cannot verify the page is usable. A logical-seeming DOM can be an incomprehensible listening experience, and only a human at the controls finds that out.

The deliverable format is the discipline: an a11y report that explicitly separates scanner-caught from human-caught findings. It keeps the team honest about what automation buys, builds the case for manual testing time with evidence, and — in India — maps to rising enforcement of accessibility requirements for government and financial services work.

Note

"We run axe in CI, so we're covered" is the accessibility equivalent of "the suite is green." You are covered for the ~30–40% of issue classes scanners can see. The remaining majority is keyboard traps, focus chaos and reading-order nonsense — findable only by hands and ears.

i18n, compatibility and performance — the same shape three times

Three specialist lanes, one recurring pattern — AI shortens the mechanical ends, humans own the judgment in the middle:

  • i18n/l10npseudo-localization ("Ẅêļçöɱê ţö ÐïšþàţçĥĤûƀ~~~") flushes out truncation, overflow and hardcoded strings before any real translation exists; vision models then scan screenshots across locales for layout breakage — genuinely new capability, since layout-at-scale defeated automation before. Cultural appropriateness of translated strings escalates to native speakers; a vision model can see the overflow, not the offense (UC-33).
  • Compatibility matricesfeed real usage analytics to the model and get a risk-ranked browser/device matrix with rationale: full coverage where users are, smoke coverage on the long tail, explicit exclusions with evidence. The matrix defends itself in front of stakeholders because every row cites usage share (UC-35).
  • Performancek6/JMeter scripts generated from user journeys (an afternoon's scripting becomes an hour), then the honesty rule on the analysis side: the LLM reads latency distributions and proposes bottleneck hypotheses, each verified against APM data before it enters a report. "p95 degrades above 200 VUs, consistent with pool exhaustion — confirmed: pool metric saturates at 200" is a finding; without the confirmation clause it is a guess that will misdirect an engineering sprint (UC-34).

Where this lands in your week

  • In test-data workthe Presidio-scan-first pipeline is the default path; synthetic generation is validated in a loop; the decision tree hangs where the team can see it, signed.
  • In environment workmocks regenerate from current specs on schedule; one real-integration path stays live as the drift alarm; every generated compose and CI line has its explanation.
  • In a11y practicescan in CI, AI-explained reports to developers, and the manual keyboard/screen-reader pass on every significant release, with findings labeled by which layer caught them.
  • In specialist lanespseudo-loc before translation, analytics-argued device matrices, and perf hypotheses that carry their APM confirmation or don't ship.
Key Takeaway:

Mask before you prompt, validate what you generate, and calibrate trust per layer: scanners catch a minority of a11y issues, mocks drift unless re-anchored, and perf hypotheses are guesses until APM confirms them. The pipeline where the safe path is the easy path — Presidio, local models for the sensitive step, schema-validated synthesis — is what keeps test data useful and legal at once.

Try it now

  1. Scan something you trusted. Run Presidio (or any PII scanner) over a test dataset you believed was clean — include free-text fields — and count the findings. Mask them and note which ones column-level scrubbing would have missed.
  2. Generate schema-valid hostiles. Define one Pydantic model from your product, then have an LLM generate 30 rows mixing realistic data with edge cases — Unicode names, boundary dates — and run the validation loop until all 30 pass.
  3. Split one a11y report. Run axe-core on a page you own, have AI explain each violation with its WCAG citation, then do a ten-minute keyboard-only pass and list what you found that the scanner did not.

Take this into Lab 08 (privacy-safe test data factory) — the fake production extract has an answer key of planted identifiers — and Lab 10 (accessibility with calibrated trust), where finding the seeded scanner-invisible bugs is the pass condition. Companion playbooks: pb-24 through pb-33.

This is the free reading view. Open BXUP to track your progress, run the hands-on labs, and prove it with original, exam-pattern assessments.
© Anvi Innovate · BXUP — Be Exponentially Upskilled · BXUP is an independent learning platform, not affiliated with or endorsed by AWS, Microsoft, Google, NVIDIA, IBM, Salesforce, Databricks, Oracle or Anthropic. All trademarks belong to their respective owners. · bxup.in