Unit 9 / 11

Quality Assurance (QA), Debugging and Automated Testing

Gains:

  • Ability to understand functional, regression, edge case and crash test layers and produce test scenarios and edge case lists with artificial intelligence
  • Ability to accelerate debugging by writing automatic test code with artificial intelligence and extracting patterns in log and crash analysis
  • Being able to understand that error diagnosis of artificial intelligence is not evidence but hypothesis, the cause must be proven with logs and reproduction, and the importance of the error report being reproducible.

When a game is released, players play it in ways the developer didn't imagine: getting stuck in walls, exploiting inventory, reaching impossible places, triggering crashes. Quality assurance (QA — quality assurance); It is the process of systematically testing the game before release and finding and fixing errors (bugs), crashes, instabilities and bad experiences. This is one of the most labor-intensive but critical links in game production. AI accelerates QA at many points: test case generation, bug report analysis, log review, automatic test code writing, debugging, and refining production steps. But AI does not replace a human tester's intuition and evaluation of the game feel.

In this unit you will learn how to use AI in QA and debugging; You will learn test scenario design, log analysis, automatic test writing and error reporting discipline.

Layers of QA and place of AI

QA is multi-layered. Functional testing: does the feature work (does the door open, does the recording load). Regression testing: did the new change break what was working before? Edge case testing: unusual inputs (reset inventory, two keys at once, borderline values). Performance/crash testing: is the game stable. Gameplay/experience test: fun, intuitive. AI is strong in the first four: generating scenarios, listing edge cases, writing test code, analyzing logs. The last—experience—belongs to man.

QA flow step by step:

  1. Generate test cases (functional and edge case list with AI).
  2. Write automated testing (code for repetitive checks).
  3. Run and collect (log errors, logs, crashes).
  4. Analyze (examine log and error pattern with AI).
  5. Report and verify (clear, reproducible bug report; test fix).
Hint: It's hard to find edge cases because the designer plays his game "right." Ask the AI ​​"what would a player try if they wanted to break this system?" List exploits and edge cases.

Automatic testing: leave the repetition to the machine

Manually testing the same things in every release is tiring and error-prone. Automated testing puts these checks into code: does a function return the correct result every time it is called, is a system in the expected state. Unity and Unreal offer testing frameworks; AI is fast at writing these tests. It's especially valuable for regression: if a change breaks something that was working before, the test goes red. Review the tests the AI ​​produces, making sure they check for what is truly meaningful — a blank test is worse than no test.

Caution: In debugging, AI sometimes produces a made-up explanation as a "probable cause" (hallucination). Don't accept the cause of a bug just because the AI ​​told you so; Prove the cause by logging, reproducing, and testing. Misdiagnosis delays finding the right one.

Reproduction: the heart of debugging

The first requirement to fix a bug is to reproduce it reliably. A bug described as "happens sometimes" cannot be fixed because you cannot verify whether the fix worked. So the most valuable work of debugging is narrowing down the exact conditions under which the bug occurs (which steps, which situation, what timing). AI helps narrow this down: you can give the symptoms and partial reproduction steps and say “suggest conditions and narrowing strategy that might trigger this behavior.” But you actually do the narrowing by running the game; AI generates hypotheses, you eliminate them.

Especially timing-related (race condition) and memory state-related errors are insidious; these only occur in a particular sequence or load. For such errors, it is critical to add timestamp and status information to the log; The AI ​​can analyze this rich log and see the pattern (“the error always happens when these two events happen recently”). Remember the golden rule of debugging: first understand, then fix. Correction without understanding hides the error but does not solve it and often creates a new error elsewhere.

three mini cases

Case 1 — Edge case hunting. In an RPG, the team tested the inventory system in "normal" gameplay and thought it was solid. They had the AI ​​say "try to crack this inventory" and generated 30 edge case scenarios; 4 of these were true errors (0 weight item splitting, simultaneous disposable). Corrected before publication.

Case 2 — Log analysis resolved the crash. A game was randomly crashing; crash logs were hundreds of lines. When the AI ​​was given the logs and asked for the pattern, it was revealed that the crash always occurred at a specific scene transition and low memory. With this clue, the programmer found the memory leak; The crash rate dropped to zero.

Case 3 — Return from misdiagnosis. A programmer trusted the AI's explanation that "this error is caused by this function" and tinkered with it for half a day; no results came out. When he clarified and logged the production steps again, the error was in a completely different place. Lesson: Diagnostics of AI are hypotheses, not proof.

Four copyable templates

1) Edge case/exploitation scenario generation:

Your role: malicious QA tester. I describe the following system: [system, rules]. Task: list 20 edge case scenarios that will try to break, exploit, or throw this system into an unexpected state. For each: what to try, expected outcome, possible error.

2) Automated test writing:

Engine: [Unity 2022.3 / Unreal 5.3]. Test framework: [specify].Write automated tests for the following function/system: [description/code].Include normal case, limit case, and faulty input.Make sure each test verifies something truly meaningful; Writing empty/meaningless tests.

3) Log/crash analysis:

Below are the crash/error logs of the game: [log].Task: mark recurring patterns, common conditions (scene, memory, timing), and possible root causes.Present each cause as a "hypothesis to be proven"; speak clearly. Also tell me how to verify.

4) Bug report clarification:

Make the following vague error report clear and reproducible: [raw report]. Output: title, step-by-step reproduction, expected result, actual result, frequency, environment. If there is missing information, list what information is needed.

Weak prompt / Strong prompt

Weak prompt:

There is a bug in my game, fix it.

No context, no log, no reproduction; AI is predictive and the risk of hallucinations is high.

Powerful prompt:

There is a bug in my Unity 2022.3 game: the inventory sometimes doubles when the player performs a quick save-load. Reproduction: [steps].Related code: [paste]. Log: [paste].Task: list possible root causes as hypotheses to be proven, give how to verify and possible fix for each.Make up a non-existent cause; If you're not sure, let me know.

Reproduction, code, log and "present as hypothesis" request make the diagnosis reliable.

QA layer table

layer

What does it test?

AI contribution

human share

functional

Does the feature work?

Script, test code

Admission decision

regression

Is the old thing broken?

automatic test

Scope decision

extreme case

unusual input

Script production

priority

Crash/performance

determination

Log analysis

Root cause confirmation

Experience

entertainment, intuition

limited

completely human

Common mistakes

  • Just testing "normal" gameplay. Edge cases explode after release.
  • Mistaking AI diagnosis as proof. Why is proven by log and testing.
  • Writing empty automated tests. Meaningless testing gives the illusion of confidence.
  • Vague bug report. A non-reproducible error cannot be corrected.
  • Skipping regression testing. Each correction may cause new errors.

In summary

QA is the discipline that makes the game ready for the player. AI; generates edge case scenarios, writes automated tests, analyzes logs and clarifies error reports. But their diagnoses are hypotheses, the evaluation of experience is human, and every correction requires retesting. Replicate the "who can break this and how" reflex with AI; You collect the evidence.

Application task

Choose a system from your game. Have 20 scenarios generated with the “edge case/exploitation scenario generation” template and actually test the 5 riskiest. Create a reproducible report for a bug you find with the "Bug report refinement" template.

checklist

  • [ ] I created an edge case with "Who can break this and how?"
  • [ ] Wrote and reviewed automated testing for recurring checks.
  • [ ] I considered the AI ​​diagnosis as a hypothesis and proved it with log/test.
  • [ ] I reported errors reproducibly.
  • [ ] I retested each fix for regression.