The spec to add test for this application #

this is a specification for testing the application.

Test Coverage Requirements #

  1. we care test quality more than metrics, we can accept lower branch coverage as long as critical paths are tested, the minimum acceptable coverage can be downgraded to about 90%.
  2. we still ensure every function is tested, unless it is intentionally excluded (e.g., auto-generated code or internal implementation details), or the function doesn't actually need testing.

Testing Strategy #

To achieve the above coverage requirements, we will implement the following testing approach:

  1. ensure our test can break down into different categories, for example:
    • 'native': the test for native-specfic functionality, like windows, macos, linux window operations
    • 'runtime': the test for runtime-specific behavior, including memory management, concurrency, and platform-specific optimizations
    • 'render': the test for rendering and graphics-related functionality, ensuring visual accuracy and performance
    • 'ui': the test for user interface components, including layout, interaction, and visual consistency
    • 'scene': the test for scene management, object interactions, and logic
  2. ensure each category has a comprehensive test suite covering all critical paths and edge case.
  3. prioritize testing critical paths and high-risk areas first, then expand to cover edge cases and less critical paths

the test you write should be maintainable, readable, and focused on verifying behavior rather than implementation details.

avoid chasing 100% code coverage at the expense of test quality and maintainability.

Step #

  1. check what category we need to break down, and write them to docs/test/coverage_plan.md for future sub-agent usage.
  2. what specific logic inside the category, what logic may not be cared in user code.
  3. identify the critical paths and edge cases that require testing coverage4. design test cases that verify behavior rather than implementation details.

in each step end, you should ask user it is appropriate or what needs to be adjusted.

and note, what you write may fail because in previous code don't care about these scenarios, first report to user about this and don't just change the tests to fix the test failures.