How to Test Branching Narratives: Path Coverage, State Matrices, and Regression Testing
Testing branching narratives cannot rely on “playing through every ending once.” An ending may be reached through multiple states, and the same node can produce errors depending on relationships, evidence, and resources. A practical approach is layered coverage: automatically check the graph structure first, then test key state combinations, and finally use representative paths to verify the complete audiovisual experience.

Introduction
Testing branching narratives cannot rely on “playing through every ending once.” An ending may be reached through multiple states, and the same node can produce errors depending on relationships, evidence, and resources. A practical approach is layered coverage: automatically check the graph structure first, then test key state combinations, and finally use representative paths to verify the complete audiovisual experience.
Layer One: Static Structure Checks
Without running the game, check that node IDs are unique, all exits exist, non-ending nodes have exits, non-opening nodes have entrances, variable types are correct, and localization keys and media references are complete. Report isolated nodes, dead ends, obviously impossible conditions, and states that are never read.
Static checks are fast and suitable for running on every commit. They cannot prove that the story is engaging, but they can catch many spelling and reference errors before testers watch the videos.
Layer Two: State Transition Unit Tests
For each option, verify its preconditions, resulting writes, and destination node. Given a known initial state, submit a choice and assert that relationships, evidence, resources, and world state change correctly; repeated submissions do not grant rewards again; and timeouts and no input follow the prescribed routes.
Test complex named rules separately. For example, test can_publish_truth for missing evidence, low trust, insufficient resources, and all requirements being met. Boundary values are particularly important: one step above and below a relationship threshold, resources at 0 and 1, and a set missing exactly one item.
Layer Three: Reduce Combinations with Pairwise Coverage
Testing every combination of all variables is usually impractical. First identify variables that jointly affect the same node, then use pairwise or risk-based combinations to ensure that every pair of important values appears together at least once. For high-risk areas such as endings, payments, save migration, and irreversible states, add three-way combinations or exhaustive testing.
Each row in the state matrix represents one test case and lists initial values, the path, expected visible options, media variants, final state, and ending. Do not simply write “test low trust”; provide reproducible values and a version.
Layer Four: End-to-End Verification of Representative Paths
At a minimum, cover the fastest main-story path, maximum evidence, minimum relationship levels, resource depletion, timeouts throughout, assist mode, chapter jumps, and migration of old saves. Watch each path in full to check narrative causality, performances, subtitles, audio, and seamless transitions—issues that unit tests cannot detect.
Generate a visitation log for each path and compare it with the expected node sequence. When a deviation occurs, you should be able to locate the first divergence instead of discovering an incorrect result only at the ending.
Defect Reports Must Include State
Reports should include the build version, platform, language, save version, starting node, key variables, steps performed, actual and expected results, media IDs, logs, and screenshots or screen recordings. Simply saying “Chapter Three led to the wrong ending” makes the issue almost impossible to reproduce.
Provide a debug panel that exports anonymous state snapshots, while ensuring that live player data complies with privacy constraints. Testing tools may jump directly to nodes, but testers still need to enter periodically through the actual preceding paths, because jumping may skip state writes.
Determine Regression Scope from the Impact Graph
When changing a node’s exits, test all representative states entering that node and key downstream routes; when changing a shared video, check every path that references it; when changing a foundational variable, expand testing to every node that reads it. Maintain traceability between “nodes—variables—assets—tests” to automatically suggest a regression test set.
Do not retest only the route where the defect occurred. Fixes often move an error to another entry point, especially at path convergence points and during save restoration.
Establish Release Gates
Blocking issues include an unreachable main story, corrupted state, lost saves, black-screen freezes, and missing critical subtitles; define severity, priority, and criteria for allowing deferral before testing. Retain test reports, unresolved issues, and risk sign-off for every release candidate.
Coverage can be measured for nodes, options, state pairs, media, and endings, but the numbers are not quality itself. Visiting 100% of nodes does not mean every logical combination is correct; reports should also state the risks that remain uncovered.
Let Automation Handle Repetition and People Handle the Experience
A headless runner can quickly traverse nodes, inject states, verify assertions, and generate paths; device automation can test startup, downloads, and saves; human testing focuses on understanding options, continuity of performances, audiovisual pacing, and emotional causality. Do not make testers repeatedly watch the same ten minutes just to verify a Boolean value.
Manage Test Data and Save Samples
For each important version, retain a minimal set of saves: chapter entrances, just above and below key thresholds, depleted resources, before each major ending, and legacy modes. Label samples with their content version and expected results, and do not let testers modify them manually at will. After a build is complete, load them in batches to verify both migration and that hidden conditions have not drifted.
Keep test accounts, the analytics environment, and the live environment separate to prevent traversal scripts from contaminating player data. If logs and saves used for reproduction contain device or account information, de-identify them, manage authorization, and delete them according to the project’s privacy rules.
Next step: build a state matrix for one chapter, automatically check all nodes and options first, then select six representative paths for end-to-end viewing; associate every defect with the affected variables and regression test set.


