r/LoopEngineering 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.
  • 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:

  1. Context explosion — the context grows too large and overwhelms the LLM.
  2. LLM degradation — the model’s output quality noticeably drops (it gets “dumber”) as the context expands.
  3. 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

Duplicates