Source Metadata for AI Agents
- Title: Benchmarking the Real-World Coding Performance of LLMs: Introducing BARE: A Large-Scale Maintainability Refactoring Benchmark of LLMs
- Author: BlueOptima
- Year: 2026
Benchmarking the Real-World Coding Performance of LLMs: Introducing BARE
Abstract
The practical value of large language models (LLMs) for enterprise software maintenance remains uncertain despite strong performance on popular coding benchmarks. We introduce the BlueOptima AI Refactoring Evaluation (BARE), which benchmarks 57 LLMs on maintainability-oriented refactoring tasks drawn from 4,276 real source code files spanning nine programming languages (C, C++, C#, Go, Java, JavaScript, PHP, Python, TypeScript), yielding 243,732 model-file evaluation pairs. Each output is assessed using a static validation pipeline covering syntax validity, function signature preservation, import integrity, variable-access correctness, unfinished-logic detection, comment preservation, and maintainability improvement measured through FLART score reduction.
The results reveal a substantial gap between benchmark-style coding performance and performance on realistic refactoring tasks. Even frontier models achieve overall success rates below 23%. Models perform well on syntactic and structural checks (typically exceeding 80%), but success rates plummet when refactorings must also improve maintainability without impairing other aspects of the code.
Performance varies dramatically across programming languages. JavaScript achieves 31.9% success versus C at 3.67%, an 8.67x difference. Performance across refactoring task types also varies widely, with localized function simplification substantially more tractable than architectural restructuring. Longitudinal analysis of model families reveals convergence among flagship proprietary models within a narrow 17–23% success band, with forecasting analysis indicating an asymptotic performance ceiling of approximately 20.8% for cloud-scale models, and no detectable temporal improvement among open-weight models. Cost-effectiveness analysis demonstrates that premium models, despite higher per-token costs, may offer superior total cost of ownership once developer review time for failed attempts is accounted for.
These findings suggest that conventional benchmark results are a poor proxy for real-world maintainability refactoring performance. LLMs should currently be deployed as tools requiring human intervention and validation within validation-heavy workflows rather than as autonomous refactoring agents. More broadly, the study argues for coding evaluations that better reflect authentic software maintenance tasks, realistic validation requirements, and the quality dimensions that determine production usefulness.
Introduction
LLMs have fundamentally transformed software development practices. GitHub Copilot alone serves over 20 million developers as reported by Microsoft (2025), while ChatGPT and similar tools process billions of coding queries monthly. This rapid adoption is largely driven by strong results on standardized coding benchmarks, where modern LLMs achieve high performance on widely used code generation evaluations such as HumanEval and related benchmark suites (Huynh et al., 2025). Yet beneath these headline numbers lies a critical question that practitioners increasingly confront: am I getting value from these significant investments in Generative AI? To answer this question, decision makers look to the coding benchmarks of LLMs to get beyond anecdotal accounts of developer experiences with the new technology, or to select a particular LLM vendor.
The Benchmark-Reality Divide
The gap between controlled evaluation and production deployment has grown conspicuous. The benchmarks most commonly cited to justify investment in LLM-assisted development have, in rapid succession, been shown to be saturated, contaminated, or structurally misaligned with the demands of enterprise software engineering. Understanding how each generation of evaluation has failed is essential context for interpreting the results of the present study.
HumanEval (Chen et al., 2021) and MBPP (Austin et al., 2021) evaluate isolated function generation from natural-language docstrings. HumanEval comprises 164 Python problems with a median length of nine lines, while MBPP roughly has 1,000 crowd-sourced problems of comparable simplicity. These benchmarks suffer from three fundamental deficiencies:
- Artificial Simplicity: They are predominantly oriented toward introductory algorithmic and data-science tasks and completely omit fourteen essential programming concepts including object-oriented design, graph algorithms, and system integration (Wang et al., 2024).
- Failure to Capture Production Requirements:
pass@k measures syntactic correctness on isolated functions but ignores maintainability, security, performance, and adherence to coding standards. - Data Contamination: Riddell et al. (2024) documented approximately 65% contamination of MBPP with publicly available solutions, while Xu et al. (2024) found pervasive benchmark leakage across multiple LLMs. By late 2024, frontier models had effectively saturated these benchmarks (e.g., o1-preview scored 96.3% on HumanEval), rendering them uninformative for distinguishing frontier capabilities.
Subsequent efforts attempted to address these deficiencies while retaining the single-function paradigm. Liu et al. (2023) augmented test suites in HumanEval+ and MBPP+, revealing that the original benchmarks had overestimated model capabilities by 12.6–28.9% due to insufficient test coverage and false-positive rates exceeding 30%. Yu et al. (2025) introduced HumanEval Pro and MBPP Pro, which require self-invoking code generation. This modest increase in inter-function dependency caused dramatic performance drops: o1-mini fell from 96.2% to 76.2%, a twenty-percentage-point decline. Yet these enhanced variants remain limited to single-file, algorithmic tasks that bear little resemblance to production software engineering.
SWE-bench (Jimenez et al., 2024) represented a paradigm shift toward realistic evaluation, drawing on 2,294 real GitHub issues requiring multi-file edits. SWE-bench Verified curated a human-validated subset of 500 instances. SWE-bench+ (Aleithan et al., 2024) collected post-training-cutoff instances to detect contamination, and SWE-bench Pro (Scale AI, 2025) extended evaluation to 1,865 long-horizon tasks across Python, Go, TypeScript, and JavaScript.
However, by early 2026, the top models—Claude 4.6 Opus (80.8%), Gemini 3.1 Pro (80.6%), and GPT-5.2 (80.0%)—were clustered within less than one percentage point on SWE-bench Verified. In February 2026, OpenAI’s Frontier Evals team published an audit concluding that SWE-bench Verified was both saturated and contaminated (OpenAI, 2026). The audit found verbatim gold patches and that 59.4% of the hardest unsolved problems had flawed test cases. OpenAI formally discontinued reporting SWE-bench Verified scores in favor of SWE-bench Pro, where models scoring ~80% on Verified achieve only around 23% on Pro under standardized scaffolding.
Other recent benchmarks include:
- LiveCodeBench (Jain et al., 2024; ICLR 2025): Continuously collects time-stamped problems from LeetCode, AtCoder, and CodeForces competitions after model training cutoffs.
- BigCodeBench (Zhuo et al., 2024; ICLR 2025): Targets practical programming tasks requiring composition of function calls across 139 libraries and seven domains.
- Terminal-Bench 2.0 (Merrill et al., 2026): Evaluates agentic coding in realistic command-line environments across 89 curated tasks.
Together, these developments illustrate a broader shift in the evaluation ecosystem away from static, single-function benchmarks toward continuously updated, contamination-resistant, multi-capability evaluations. To address these benchmarking challenges, we introduce the BlueOptima AI Refactoring Evaluation (BARE). BARE tests an operationally relevant question: can an LLM improve the maintainability of an existing production source file while preserving structural correctness?
The Maintenance Imperative
Maintainability—the ease with which software can be modified to correct defects, improve performance, or adapt to changing environments—directly influences operational efficiency, cost-effectiveness, and long-term success. Poor maintainability typically manifests through common structural flaws called anti-patterns, such as the "God Class" or "Functionality Overload".
Software maintenance dominates total cost of ownership, consuming 60–90% of lifecycle expenditure (Palomba et al., 2018). Technical debt represents 20–40% of an organization's entire technology estate value, with enterprises allocating approximately 30% of IT budgets to debt management.
Empirical findings highlight the operational impact of code quality:
- Low-quality code harbors 15 times more defects than high-quality code.
- Resolving issues in low-quality code demands 124% more development time with nine times longer maximum cycle times.
- Technical debt wastes up to 42% of developers' time (Tornhill & Borg, 2022).
- Empirical research from BlueOptima's Global Drivers of Performance: Quality (2024) across 43 enterprises and 36,000 developers confirmed static code-level predictors like design patterns/anti-patterns produced an $R^2 = 0.674$ correlation with downstream quality.
- Improving developer code quality from "Requires Improvement" to "Best" yielded cost savings of up to $58.62 per unit of coding effort—translating to over $1M in annual savings across a 100-person engineering team.
Fixing the Industry Blindspot
Existing coding benchmarks do not directly evaluate whether an LLM can improve maintainability while preserving structural correctness in an existing file. We assess 57 distinct LLMs across nine programming languages (Python, Java, JavaScript, TypeScript, C, C#, C++, Go, PHP) on real-world refactoring scenarios: extract method, extract variable, inline method, rename, simplify conditional, remove duplicate code, and introduce parameter object.
Our validation pipeline implements seven sequential checks:
- Syntax validation (compilation without errors)
- Function signature integrity (preservation of names, parameters, and return types)
- Import statement verification (no omitted dependencies)
- Variable access integrity (no references before assignment)
- Unfinished logic detection (no placeholder comments or incomplete implementations)
- Comment preservation (retention of meaningful documentation)
- FLART score reduction (measurable improvement in maintainability as assessed by BlueOptima's static analysis framework)
Only solutions passing all seven checks qualify as successful refactorings.
Key Contributions
- Large-Scale Empirical Evaluation: Assesses 57 LLMs across 9 languages and 243,732 refactoring attempts using a rigorous 7-check static validation pipeline.
- Heterogeneous Evolution Trajectories: Documents progress across model families, revealing that flagship models converge in a narrow 17–23% success band, while Meta Llama and Gemini Flash show performance regressions across versions.
- Language-Specific Performance Variation: Reveals an 8.6x difference between best- (JavaScript at 31.9%) and worst-performing languages (C at 3.67%).
- Economic Framework with Hidden Review Costs: Demonstrates that premium models with higher success rates achieve superior Total Cost of Ownership (TCO) once developer review time for failed attempts is factored in.
Method
Objective
The primary aim of this study is to assess the ability of 57 LLMs to successfully refactor source code files exhibiting software maintainability issues across 9 programming languages (C, C++, C#, Go, Java, JavaScript, PHP, Python, TypeScript). Maintainability issues were identified using BlueOptima’s HowToFix (HTF) service, which analyzes files across 26 static metrics covering volume, complexity, and interrelatedness. A file is classified as having a maintainability issue when it exceeds the 90th percentile threshold relative to historical population norms.
Caption: Illustration of static metric thresholds showing the maintainable range, warning risk zone (70th percentile), and maintainability issue zone (90th percentile).
Maintainability Issues Identified by HTF Service
- High Coupling: Classes or modules are overly dependent on each other. Reduces modularity, testability, and reusability; changes ripple across modules.
- High Cyclomatic Complexity: Excessive branching and independent execution paths. Harder to follow control flow, increases required test cases, and complicates maintenance.
- High Number of Complex Functions: Module contains too many functions with high complexity, deep nesting, or excessive parameters.
- High Number of Functions: Excessive functions in a module/class reduce clarity, structure, and navigation efficiency.
- Highly Complex / Nested Structure: Multiple layers of nested conditions, loops, or control flows. Increases cognitive load and risk of edge-case bugs.
- Long Complex Functions: Functions spanning many lines handling multiple responsibilities. Difficult to scan, modify, or isolate for unit testing.
- Low Structural Quality of File: Lacks clear structure or logical grouping of concerns. Impairs refactoring and reusability.
- Poor Code Readability: Lacks clarity due to inconsistent formatting, structure, or overly complex logic. Slows team collaboration and debugging.
Source file maintainability is evaluated using File-level ART (FLART) scores on a 0–1 scale, where higher values indicate lower maintainability.
LLM Selection for Evaluation
Models were selected based on practical availability (accessible via commercial APIs or open-source hubs released between January 2024 and March 2026) and economic viability. An enterprise cost ceiling was set at $90 per million tokens (combined input + output cost). Models exceeding this threshold (e.g., GPT-o1-Pro at $150 input / $600 output) were excluded.
Evaluated Language Models Profile
- Claude 3.5 Sonnet: Proprietary (Step-by-step) | Anthropic (USA) | 175B params | 200k Context | $3.00 Input / $15.00 Output
- Claude 3.7 Sonnet: Proprietary (Reasoning) | Anthropic (USA) | Unknown params | 200k Context | $3.00 Input / $15.00 Output
- Claude 4 Sonnet: Proprietary (Reasoning) | Anthropic (USA) | Unknown params | 1M Context | $3.00 Input / $15.00 Output
- Claude 4.5 Sonnet: Proprietary (Reasoning) | Anthropic (USA) | Unknown params | 200k Context | $3.00 Input / $15.00 Output
- Claude 4.5 Opus: Proprietary (Reasoning) | Anthropic (USA) | Unknown params | 200k Context | $5.00 Input / $25.00 Output
- Claude 4.6 Opus: Proprietary (Reasoning) | Anthropic (USA) | Unknown params | 1M Context | $5.00 Input / $25.00 Output
- Claude 4.6 Sonnet: Proprietary (Reasoning) | Anthropic (USA) | Unknown params | 1M Context | $3.00 Input / $15.00 Output
- Deepseek-R1: Open-weight (Reasoning) | DeepSeek (China) | 671B params | 128k Context | $0.55 Input / $2.19 Output
- Deepseek-V3: Open-weight (Step-by-step) | DeepSeek (China) | 671B params | 128k Context | $0.27 Input / $1.10 Output
- Gemini 1.5 Pro: Proprietary (Reasoning) | Google (USA) | 1.5T params | 2M Context | $1.25 Input / $5.00 Output
- Gemini 2.0 Flash: Proprietary (Reasoning) | Google (USA) | Unknown params | 1M Context | $0.10 Input / $0.40 Output
- Gemini 2.5 Flash: Proprietary (Reasoning) | Google (USA) | Unknown params | 128k Context | $0.30 Input / $2.50 Output
- Gemini 2.5 Pro: Proprietary (Reasoning) | Google (USA) | Unknown params | 1M Context | $1.25 Input / $10.00 Output
- Gemini 3 Pro: Proprietary (Reasoning) | Google (USA) | Unknown params | 1M Context | $2.00 Input / $12.00 Output
- Gemini 3.1 Pro: Proprietary (Reasoning) | Google (USA) | Unknown params | 1M Context | $2.00 Input / $12.00 Output
- Gemini 3.1 Flash Lite: Proprietary (Reasoning) | Google (USA) | Unknown params | 1M Context | $0.25 Input / $1.50 Output
- GPT-3.5-turbo: Proprietary (Step-by-step) | OpenAI (USA) | 20B params | 16k Context | $0.50 Input / $1.50 Output
- GPT-4-turbo: Proprietary (Step-by-step) | OpenAI (USA) | Unknown params | 128k Context | $10.00 Input / $30.00 Output
- GPT-4o: Proprietary (Step-by-step) | OpenAI (USA) | 200B params | 128k Context | $2.50 Input / $10.00 Output
- GPT-4o-mini: Proprietary (Step-by-step) | OpenAI (USA) | Unknown params | 128k Context | $0.15 Input / $0.60 Output
- GPT-4.1: Proprietary (Step-by-step) | OpenAI (USA) | 1.8T params | 1M Context | $2.00 Input / $8.00 Output
- GPT-4.1-nano: Proprietary (Step-by-step) | OpenAI (USA) | Unknown params | 1M Context | $0.20 Input / $0.80 Output
- GPT-o1: Proprietary (Reasoning) | OpenAI (USA) | 175B params | 128k Context | $15.00 Input / $60.00 Output
- GPT-o3: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 200k Context | $2.00 Input / $8.00 Output
- GPT-o3-mini: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 200k Context | $1.10 Input / $4.40 Output
- GPT-o4-mini: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 200k Context | $1.10 Input / $4.40 Output
- GPT-5: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 400k Context | $1.25 Input / $10.00 Output
- GPT-5-mini: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 400k Context | $0.25 Input / $2.00 Output
- GPT-5-nano: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 400k Context | $0.05 Input / $0.40 Output
- GPT 5.1: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 400k Context | $1.25 Input / $10.00 Output
- GPT-5.2: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 400k Context | $1.75 Input / $14.00 Output
- GPT-5.4: Proprietary (Reasoning) | OpenAI (USA) | Unknown params | 1M Context | $2.50 Input / $15.00 Output
- Grok-2: Proprietary (Reasoning) | xAI (USA) | 175B params | 128k Context | $2.00 Input / $10.00 Output
- Grok-3: Proprietary (Reasoning) | xAI (USA) | 2.7T params | 1M Context | $3.00 Input / $15.00 Output
- Grok-3-mini: Proprietary (Reasoning) | xAI (USA) | Unknown params | 128k Context | $0.30 Input / $0.50 Output
- Grok Code Fast 1: Proprietary (Reasoning) | xAI (USA) | Unknown params | 256k Context | $0.20 Input / $1.50 Output
- Grok-4: Proprietary (Reasoning) | xAI (USA) | Unknown params | 256k Context | $3.00 Input / $15.00 Output
- Llama 3.1 70B: Open-weight (Step-by-step) | Meta (USA) | 70B params | 130k Context | $0.99 Input / $0.99 Output
- Llama 3.3 70B: Open-weight (Step-by-step) | Meta (USA) | 70B params | 128k Context | $0.72 Input / $0.72 Output
- Mistral Large 2411: Open-weight (Reasoning) | Mistral (France) | 123B params | 128k Context | $2.00 Input / $6.00 Output
- Mistral Medium 3.1: Proprietary (Reasoning) | Mistral (France) | Unknown params | 128k Context | $0.50 Input / $2.00 Output
- Mistral Large 3 2512: Open-weight (Reasoning) | Mistral (France) | 675B params | 256k Context | $0.50 Input / $1.50 Output
- Ministral 3 14B 2512: Open-weight (Reasoning) | Mistral (France) | 140B params | 256k Context | $0.20 Input / $0.20 Output
- Devstral 2 2512: Open-weight (Reasoning) | Mistral (France) | 123B params | 256k Context | $0.40 Input / $2.00 Output
- Qwen2.5 Coder 1.5B: Open-weight (Step-by-step) | Alibaba (China) | 1.5B params | 32k Context | $0.11 Input / $0.42 Output
- Qwen2.5 Coder 3B: Open-weight (Step-by-step) | Alibaba (China) | 3B params | 32k Context | $0.11 Input / $0.42 Output
- Qwen2.5 Coder 7B: Open-weight (Step-by-step) | Alibaba (China) | 7B params | 32k Context | $0.18 Input / $0.70 Output
- Qwen2.5 Coder 14B: Open-weight (Step-by-step) | Alibaba (China) | 14B params | 32k Context | $0.35 Input / $1.40 Output
- Qwen2.5 Coder 32B: Open-weight (Step-by-step) | Alibaba (China) | 32B params | 32k Context | $0.70 Input / $2.80 Output
- Qwen3 1.7B: Open-weight (Step-by-step) | Alibaba (China) | 1.7B params | 32k Context | $0.11 Input / $0.42 Output
- Qwen3 4B: Open-weight (Step-by-step) | Alibaba (China) | 4B params | 32k Context | $0.11 Input / $0.42 Output
- Qwen3 4B Thinking: Open-weight (Reasoning) | Alibaba (China) | 4B params | 256k Context | $0.11 Input / $1.26 Output
- Qwen3 8B: Open-weight (Step-by-step) | Alibaba (China) | 8B params | 32k Context | $0.18 Input / $0.70 Output
- Qwen3 14B: Open-weight (Step-by-step) | Alibaba (China) | 14B params | 32k Context | $0.35 Input / $1.40 Output
- Qwen3 32B: Open-weight (Step-by-step) | Alibaba (China) | 32B params | 32k Context | $0.70 Input / $2.80 Output
- Qwen3 Coder Next: Open-weight (Step-by-step) | Alibaba (China) | 80B params | 256k Context | $0.50 Input / $1.20 Output
- Qwen3.5 397B A17B: Open-weight (Reasoning) | Alibaba (China) | 397B params | 262k Context | $0.60 Input / $3.60 Output
Data Collection
The benchmark dataset comprises 4,276 files across 9 languages:
- 82% Open-Source Code: Selected from 63 active GitHub repositories with releases within 6 months.
- 18% Unseen Source Code (USC): Drawn from proprietary, closed-source commercial repositories not present in public training corpora.
Dataset Distribution by Language
- C: 436 files
- C#: 492 files
- C++: 466 files
- Go: 464 files
- Java: 463 files
- JavaScript: 527 files
- PHP: 381 files
- Python: 538 files
- TypeScript: 499 files
- Total: 4,276 files evaluated across 57 models (243,732 total attempts)
Benchmarking Technique
Each model was prompted using a 4-stage chain-of-thought strategy:
- Problem Comprehension: Model explains code functionality and purpose.
- Issue Diagnosis & Strategy Formulation: Diagnostic metrics are presented; model proposes concrete improvements.
- Implementation: Model generates refactored file adhering to signature and dependency preservation constraints.
- Validation Planning: Model outlines a test verification plan.
Evaluation was strictly single-shot (pass@1) directly to LLM APIs without agentic scaffolding, self-correction loops, or external tools.
Validation Checks and Metrics
Refactored files were passed through 7 validation checks:
- Syntax Validation: Parsed and compiled without error.
- Function Signature Integrity: Preserves function names, parameters, and return types.
- FLART Assessment: Quantitative reduction in FLART score.
- Import Statement Verification: Ensures no dependencies were omitted.
- Unfinished Logic Detection: Rejects placeholders or incomplete code.
- Comment Preservation: Retains docstrings and meaningful comments.
- Variable Access Integrity: Linter checks confirm no variable is accessed before assignment.
Key performance metrics:
- File Generation Rate: Percentage of attempts yielding complete output files.
- Maintainability Refactoring Success Rate: Percentage passing all 7 checks with FLART reduction.
- Average Coding Effort (CE): Normalized effort unit spent per successful refactoring.
Error Classification
Unsuccessful runs were classified into:
- API-Related Errors: Service infrastructure failures (Network Connection, Throttling, Server Errors, Malformed Response).
- Model-Related Errors: Failures originating within the model's generation process.
Model Error Breakdown
- Output Token Limit Exceeded: 63.63%
- Prompt Violation: 20.33%
- Context Length Exceeded: 9.13%
- Timeouts: 6.04%
- Metric Errors: 0.70%
- Incomplete Generation: 0.10%
- Safety & Policy Violations: 0.06%
- Others: 0.01%
Results
Infrastructure and Generation Reliability
API-related errors accounted for less than 1.5% of attempts (81 network, 19 throttling, 17 server-side, 10 malformed response).
Generation Rate, Success Rate, and Coding Effort
While file generation reliability exceeded 90% for most models, maintainability refactoring success rates clustered between 15% and 23% for top models and fell below 10% for smaller models.
Language-Level Efficacy
Refactoring success is strongly dependent on programming language characteristics:
- JavaScript: 31.91% Success (96.62% File Gen)
- Python: 26.86% Success (94.37% File Gen)
- PHP: 23.65% Success (92.59% File Gen)
- Java: 18.09% Success (88.76% File Gen)
- Go: 17.46% Success (87.84% File Gen)
- C#: 14.91% Success (89.93% File Gen)
- TypeScript: 8.29% Success (89.84% File Gen)
- C++: 4.35% Success (73.02% File Gen)
- C: 3.69% Success (76.82% File Gen)
Maintainability Issue-Specific Success Rates
LLMs perform well on localized intra-function issues but struggle severely with inter-functional architectural issues:
- Long Complex Functions: 38.24% Avg. Success
- High Number of Complex Functions: 36.77% Avg. Success
- Poor Code Readability: 28.91% Avg. Success
- Low Structural Quality of File: 15.88% Avg. Success
- Highly Complex / Nested Structure: 6.13% Avg. Success
- High Cyclomatic Complexity: 2.42% Avg. Success
- High Coupling: 1.62% Avg. Success
- High Number of Functions: 1.60% Avg. Success
Capability Trajectories and Cost Analysis
Flagship cloud models converge in a narrow 17–23% success band: Claude 4.6 Opus (22.0%), GPT-5.2 (21.3%), Gemini 3.1 Pro (21.5%), and Grok-4 (23.0%). Coding Effort per successful refactor rose from 1.7 to 2.1 CE hours across generations.
Discussion
Why LLMs Fail: The Syntax-Semantics Divide
LLMs achieve >85% success on syntax and function signature checks but drop to 25–50% on FLART maintainability improvements. Research confirms LLMs function as pattern matchers operating on sequential token streams, lacking graph-like structural comprehension (Zhang et al., 2023). They exhibit a "single-function horizon"—handling intra-function simplification (38.2%) well, but failing on architectural file restructuring (1.6%).
Language-Specific Performance
The 8.67x gap between JavaScript (31.84%) and C (3.67%) reflects language design constraints. High-level, memory-safe languages with standardized module systems reduce cognitive burden, whereas low-level system languages with manual memory management, pointers, and explicit type constraints severely restrict valid refactoring space.
Benchmark Inadequacy & Performance Plateau
Current benchmarks suffer from saturation and contamination. BARE's single-shot baseline (16.6% average) shows that model scaling alone yields diminishing returns on maintenance tasks. This explains the industry shift toward surrounding foundation models with agentic orchestration layers.
Economic Implications & Total Cost of Ownership
Analyzing developer review time for failed refactoring attempts reverses naive per-token cost calculations:
- Senior Developer Cost: ~$51/hour ($5.10 per 6-minute review).
- Commodity Model (12% success, $0.50 API cost): 100 attempts cost $50 API + $449 review = $499 total ($41.58 per success).
- Premium Model (22% success, $2.00 API cost): 100 attempts cost $200 API + $398 review = $598 total ($27.18 per success).
- Result: Premium models are 35% more cost-effective due to lower rework overhead.
Considerations on Scope
- Single-File Refactorings: Multi-file architectural refactorings were excluded to maintain experimental control, likely overestimating real-world performance.
- Single-Shot Prompting: Evaluates base foundation models without agentic iterative self-correction loops.
- Static Validation: Uses static analysis without dynamic runtime test suite execution.
Conclusion
Strong performance on conventional benchmarks does not translate to maintainability refactoring success. Even frontier models remain below 23% overall success. Flagship cloud models approach an asymptotic ceiling near 20.8%, while open-weight models plateau near 15.1%.
Recommendations for Software Development Executives
- Require Mandatory Human Review: Never deploy LLM refactored code to production without expert engineer review.
- Scope to Localized Tasks: Target bounded use cases (documentation, single-function simplification) rather than architectural restructuring.
- Account for Language Stacks: Adjust expectations based on language (e.g., higher returns in JavaScript vs. low returns in C/C++).
- Validate Against Proprietary Codebases: Benchmark models internally prior to broad rollout.
- Procure Based on Total Cost per Success: Factor in developer review time rather than token unit pricing alone.
- Invest in Engineering Governance: Develop review standards and train senior developers to critically evaluate AI outputs.
Notices and Disclosures
- FLART Metric: Proprietary maintainability metric backed by BlueOptima Global Benchmark analysis of 1.6M+ repositories. Correlates with maintenance costs ($R^2 = 0.674$).
- Benchmark Participation & Research Collaboration: Organizations and academic researchers can contact
research@blueoptima.com. - Consulting & Software Products: Reach out to
Consulting@BlueOptima.com or Sales@BlueOptima.com. - Post Publication Correction: Logistic regression controls (POSTFLART, language, SLCE) show refactoring performance is driven by intrinsic file quality and complexity rather than repository origin alone.
Appendices Summary
Appendix A: GitHub Repositories
Evaluated 63 major open-source repositories spanning 9 languages (including kubernetes, linux, roslyn, electron, tensorflow, react-native, godot).
Appendix B: Logistic Regression Tests
Models refactoring success probability as a function of code source, initial quality (POSTFLART), programming language, and effort (SLCE). Confirms file quality and complexity dictate refactoring success.
Appendix C: Coding Effort
- Actual Coding Effort (ACE): Intellectual work delivered across 36 static metrics evaluating Volume, Complexity, and Interrelatedness.
- Billable Coding Effort (BCE): Prorates ACE across active workdays, capped at 5 hours/day.
Appendix D: LLM Evolution
Tracks CE and success rate trends across model release dates for Anthropic, OpenAI, xAI, Google, Meta, Mistral, and Qwen families.
Appendix E: Forecasting of LLM Refactoring Success Rate
Bayesian Model Averaging (BMA) forecast indicates an asymptotic ceiling of 20.8% (95% CI: 19.4–30.1%) for flagship cloud models and 15.1% (95% CI: 13.4–17.5%) for open-weight models.
Appendix F: File Type Identification (FTI)
BlueOptima's machine learning FTI system classifies code files across 109 languages with 0.97 balanced accuracy.
Public source: https://www.blueoptima.com/resource/benchmarking-the-real-world-coding-performance-of-llms-introducing-bare