Add tests agent (assertion quality, global state teardown, coverage gaps) #37

Closed
opened 2026-06-28 07:59:11 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-06-28 07:59:11 +00:00 (Migrated from codeberg.org)

WuMing has no reviewer for test quality. A tests agent would examine changed test and source files for: tests added without assertions, trivial/tautological assertions (assert True, assertEqual(x, x)), tests that mutate shared state without teardown, and source files modified in a diff without any corresponding test file change. The broad file scope (all source languages) is needed to enable the coverage-gap detection.

WuMing has no reviewer for test quality. A tests agent would examine changed test and source files for: tests added without assertions, trivial/tautological assertions (assert True, assertEqual(x, x)), tests that mutate shared state without teardown, and source files modified in a diff without any corresponding test file change. The broad file scope (all source languages) is needed to enable the coverage-gap detection.
coding-agent-marvin8 commented 2026-06-28 07:59:31 +00:00 (Migrated from codeberg.org)

Findings from codebase exploration:

  • All agents subclass BaseAgent; review() filters diffs by file_patterns using fnmatch.fnmatch, calls the backend, and parses JSON
  • The tests agent needs the same broad file patterns as CodeAgent (all source languages) so it receives both test files and source files in a single diff — necessary for the coverage-gap check
  • Within the prompt, the LLM is instructed to distinguish test files from source files by path conventions (test_*, *_test.*, *.test.*, *.spec.*, **/tests/**)
  • Module named tests_agent.py to avoid shadowing the tests/ package directory (same reason config_agent.py exists instead of config.py)

Plan of attack: implemented together with issue #36 on branch feat/issue-36-37-performance-tests-agents

Findings from codebase exploration: - All agents subclass `BaseAgent`; `review()` filters diffs by `file_patterns` using `fnmatch.fnmatch`, calls the backend, and parses JSON - The tests agent needs the same broad file patterns as `CodeAgent` (all source languages) so it receives both test files and source files in a single diff — necessary for the coverage-gap check - Within the prompt, the LLM is instructed to distinguish test files from source files by path conventions (`test_*`, `*_test.*`, `*.test.*`, `*.spec.*`, `**/tests/**`) - Module named `tests_agent.py` to avoid shadowing the `tests/` package directory (same reason `config_agent.py` exists instead of `config.py`) Plan of attack: implemented together with issue #36 on branch `feat/issue-36-37-performance-tests-agents`
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/wuming#37
No description provided.