Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metrics
Fuente:
arXiv
Saved in:
| Main Authors: | , , , |
|---|---|
| Format: | Preprint |
| Published: |
2026
|
| Subjects: | |
| Online Access: | |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| _version_ | 1866915708656418816 |
|---|---|
| author | Borg, Markus Hagatulah, Nadim Tornhill, Adam Söderberg, Emma |
| author_facet | Borg, Markus Hagatulah, Nadim Tornhill, Adam Söderberg, Emma |
| contents | We are entering a hybrid era in which human developers and AI coding agents work in the same codebases. While industry practice has long optimized code for human comprehension, it is increasingly important to ensure that LLMs with different capabilities can edit code reliably. In this study, we investigate the concept of ``AI-friendly code'' via LLM-based refactoring on a dataset of 5,000 Python files from competitive programming. We find a meaningful association between CodeHealth, a quality metric calibrated for human comprehension, and semantic preservation after AI refactoring. Our findings confirm that human-friendly code is also more compatible with AI tooling. These results suggest that organizations can use CodeHealth to guide where AI interventions are lower risk and where additional human oversight is warranted. Investing in maintainability not only helps humans; it also prepares for large-scale AI adoption. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2601_02200 |
| institution | arXiv |
| publishDate | 2026 |
| record_format | arxiv |
| spellingShingle | Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metrics Borg, Markus Hagatulah, Nadim Tornhill, Adam Söderberg, Emma Software Engineering Artificial Intelligence We are entering a hybrid era in which human developers and AI coding agents work in the same codebases. While industry practice has long optimized code for human comprehension, it is increasingly important to ensure that LLMs with different capabilities can edit code reliably. In this study, we investigate the concept of ``AI-friendly code'' via LLM-based refactoring on a dataset of 5,000 Python files from competitive programming. We find a meaningful association between CodeHealth, a quality metric calibrated for human comprehension, and semantic preservation after AI refactoring. Our findings confirm that human-friendly code is also more compatible with AI tooling. These results suggest that organizations can use CodeHealth to guide where AI interventions are lower risk and where additional human oversight is warranted. Investing in maintainability not only helps humans; it also prepares for large-scale AI adoption. |
| title | Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metrics |
| topic | Software Engineering Artificial Intelligence |
| url | https://arxiv.org/abs/2601.02200 |