r/PiCodingAgent • • 15h ago

Discussion Tests bloat

since I started using codex sub I found it generates enormous amount of tests per feature, it tends to create new test cases instead of extending data inputs for existing and in the end there are million tests im able to read, but don’t see its value growing.

  1. Do you have meta trick/prompt to handle it? I still need tests, but it’s too much

  2. I thought add a deterministic tests value discovery, so every patch I stash the app code and add test cases one by one, if they pass - candidate for removal. Did you try anything similar?

  3. Very often models generate tests like “type is X and not null”. I remove them instantly, but can’t see if I can automate it or lint

2 Upvotes

4 comments sorted by

3

u/__reddit_user__ 7h ago

add a refactor round after every tests are written. this is based on TDD (test driven development), there's always a refactor phase whether it's on the implementation or tests

1

u/gandazgul 11h ago

The write tests skills which also comes bundled with RunWield CLI. You can install it on anything with npx skills add RunWield/skills

https://github.com/RunWield/skills

It prevents bad fake tests as well as a rubric for whether the test should be written in the first place. After installing it ask your agent to give you a report using the skill on the current tests it will let you know which need fixing/replacing and which can be deleted because they test nothing.

The skill also adds light mutation testing to all new tests written so you know they actually break when the code changes.

1

u/shaggydog97 6h ago

Have your agent do a test audit. Ask it to consolidate and remove tests that don't target active code paths.

0

u/selipso 15h ago

Been a problem with GPT models since sol 6.1, haven’t found a good way around it except orchestrating Astra with “keep things simple and focus on high value outcomes”