Code Health in LLM-Based Test Generation: Effectiveness and Token Efficiency
Source
arxiv.org
Author
Freya Wirdemann, Markus Borg, Nadim Hagatulah, Adam Tornhill
Date
Context
Code maintainability appears to carry a modest signal about how effective AI-generated tests will be. A study spanning Python, Java and C++ compared test effectiveness across levels of a maintainability measure called CodeHealth. The authors report a weak but consistent relationship, alongside a negative correlation between CodeHealth and the number of input tokenThe chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.Full definition → needed to represent the code. This connects the condition of the source code with both testing results and input size. The reported correlations do not establish how much refactoring would improve tests or reduce a particular system's bill.
Terms in this piece · Glossary
token — The chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.
LLM — A large language model — the neural network behind tools like Claude and ChatGPT, trained on huge amounts of text to predict what comes next.