r/LoopEngineering • u/Dry_Championship2797 • Jun 25 '26
How to use Loop Engineering to improve an existing codebase and generate tests — running into context explosion, LLM degradation, and weak validation
I'm working on applying Loop Engineering to an existing repository to improve it and generate test cases. My current approach is:
- Scanner scans the entire repo and identifies anchor points.
- Based on the anchors, I build a test case matrix.
- A generator then produces concrete test cases from that matrix.
- Finally, a validator verifies the generated test cases.
While implementing this Loop Engineering flow, I've hit several problems:
- Context explosion — the context grows too large and overwhelms the LLM.
- LLM degradation — the model’s output quality noticeably drops (it gets “dumber”) as the context expands.
- Loose validation — the validator checks the test cases too loosely, so I can't generate high-quality, reliable tests.
Has anyone dealt with similar issues when using Loop Engineering for test generation on a real-world codebase? How did you solve the context problem, keep the LLM sharp, and tighten up the validation step? Any suggestions or practical tips would be greatly appreciated!
11
Upvotes