Skip to content

Test coverage gaps: PPU, APU, controllers, mappers, browser, state serialization #617

Description

@bfirsh

Summary

Current test coverage is limited to:

  • CPU instructions (cpu.spec.js)
  • Basic NES initialization and ROM loading (nes.spec.js)
  • Mapper 0 basics (mappers.spec.js)
  • nestest and AccuracyCoin ROM harnesses

Missing test files for:

  • PPU: register behavior, VRAM mirroring, sprite evaluation, scrolling, palette
  • APU: channel behavior, frame counter, mixer, sweep unit
  • Controllers: turbo button logic, clock(), strobe protocol
  • ROM parser: trainer ROMs, truncated data, NES 2.0 headers
  • Mappers 1-241: MMC1, MMC3, MMC5, etc. have zero unit tests
  • State serialization: no round-trip toJSON()/fromJSON() tests
  • Browser layer: Screen, Speakers, KeyboardController, GamepadController
  • GameGenie: decode/encode round-trip, invalid input handling

The highest-value additions would be:

  1. MMC3 IRQ counter unit tests (most complex and bug-prone mapper code)
  2. PPU register behavior tests
  3. State serialization round-trip tests
  4. APU sweep unit tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: hardComplex change spanning multiple subsystems or requiring deep NES knowledgeenhancementNew feature or capabilitypriority: mediumIncorrect behavior for specific games or edge cases

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions