Regression testing catches bugs introduced by new changes. In games, this includes functional regressions, performance regressions, and design regressions.
High-Frequency (Every Commit)
├── Unit Tests - Fast, isolated
├── Smoke Tests - Can game launch and run?
└── Critical Path - Core gameplay works
Medium-Frequency (Nightly)
├── Integration Tests - System interactions
├── Full Playthrough - Automated or manual
└── Performance Benchmarks - Frame time, memory
Low-Frequency (Release)
├── Full Matrix - All platforms/configs
├── Certification Tests - Platform requirements
└── Localization - All languages
# Run on every commit
def test_game_launches():
process = launch_game()
assert wait_for_main_menu(timeout=30)
process.terminate()
def test_new_game_starts():
launch_game()
click_new_game()
assert wait_for_gameplay(timeout=60)
def test_save_load_roundtrip():
launch_game()
start_new_game()
perform_actions()
save_game()
load_game()
assert verify_state_matches()
# Automated player that plays through content
class PlaythroughBot:
def run_level(self, level):
self.load_level(level)
while not self.level_complete:
self.perform_action()
self.check_for_softlocks()
self.record_metrics()
# Compare screenshots against baselines
def test_main_menu_visual():
launch_game()
screenshot = capture_screen()
assert compare_to_baseline(screenshot, 'main_menu', threshold=0.01)
performance_benchmark:
script:
- run_benchmark_scene --duration 60s
- collect_metrics
- compare_to_baseline
fail_conditions:
- frame_time_avg > baseline * 1.1 # 10% tolerance
- memory_peak > baseline * 1.05 # 5% tolerance
Maintain save files from:
def test_save_compatibility():
for save_file in LEGACY_SAVES:
load_save(save_file)
assert no_errors()
assert progress_preserved()
assert inventory_intact()
When a regression is found, identify the breaking commit:
git bisect start
git bisect bad HEAD # Current is broken
git bisect good v1.2.0 # Known good version
# Git will checkout commits to test
# Run test, mark good/bad
git bisect good/bad
# Repeat until culprit found
git bisect start HEAD v1.2.0
git bisect run ./run_regression_test.sh