How Far Can LLMs Go in Generating Android Lint Checks from Natural Language?
Organizations: Louisiana State University · University of Kentucky · University of California, Riverside
Abstract
Static analysis tools such as Android Lint, PMD, and CodeQL let developers add custom checks for project-specific rules. However, authoring a check is a demanding programming task: a rule can be stated in a few sentences, yet turning it into a working, tested check requires detailed knowledge of the analysis framework and its issue-detection logic. Recent work generates such checks with large language models (LLMs), but each system needs more than the natural language description a developer always has: a bug-fix patch, a CVE record, or a developer-written test suite to repair against. No prior work measures whether an LLM can turn a description into a working check, or what external knowledge it needs to do so. We introduce LintBench, a human-validated benchmark of 113 real-world Android Lint checks, each paired with a natural language description and its original test suite as a held-out oracle. We evaluate four LLMs, including proprietary and open-weight models. We compare prompting strategies, then evaluate execution-guided repair with and without retrieved API knowledge. Prompting alone reaches 30%-65% (pass@5) across models. Execution-guided repair and retrieval reach 57%-85% test-passing rates within five calls. Our results show that execution feedback raises the pass rate, while retrieved framework knowledge raises the compile rate, which reaches up to 99%. The framework knowledge helps the low-performing models the most, providing the knowledge they need to fix compilation errors. Of the generated checks that compile but fail their tests, 87% have false negatives, missing an issue the generated check should report. Based on our findings, getting the issue-detection logic right remains an open challenge. We release LintBench and the evaluation harness to support future work on generating Android Lint checks.
Figures & tables
| Approach | Analyzer | Input |
|---|---|---|
| KNighter [ 7 ] | Clang Static Analyzer | Bug-fix patch |
| QLCoder [ 8 ] | CodeQL | CVE metadata |
| AutoChecker [ 9 ] | PMD | Description + tests |
| LintBench (ours) | Android Lint | Description |
| LintBench -unverified | LintBench | |
| (148) | (113) | |
| Analysis representation | ||
| XML / manifest ( XmlScanner ) | 67 (45%) | 54 (48%) |
| Source ( SourceCodeScanner ) | 41 (28%) | 33 (29%) |
| Mixed (source XML) | 38 (26%) | 26 (23%) |
| Other (Gradle, binary, …) | 2 (1%) | 0 (0%) |
| Setting + LLM | compile@1 | pass@1 | compile@ | pass@ | #Pass |
| Zero-shot natural-language description only | |||||
| + Qwen3.6-Max-Preview | 26.5 | 14.3 | 54.9 | 31.9 | 36 |
| + Kimi K2.7 Code | 24.6 | 13.3 | 61.1 | 38.1 | 43 |
| + Claude Sonnet 4.6 | 62.5 | 33.1 | 85.0 | 47.8 | 54 |
| + Gemini 3.5 Flash | 55.2 | 34.3 | 89.4 | 61.1 | 69 |
| Few-shot with worked example checks | |||||
| Setting + LLM | Compile (%) | Pass (%) | #Pass (/113) | Iters | \downarrow$ | kTok/solved |
| Repair-only ( vs. best prompting) | ||||||
| + Qwen3.6-Max-Preview | 74.3 4.4 | 50.4 13.2 | 57 | 3.6 | 0.308 | 55.6 |
| + Kimi K2.7 Code | 77.0 2.7 | 49.6 0.9 | 56 | 3.8 | 0.327 | 104.3 |
| + Claude Sonnet 4.6 | 93.8 8.8 | 66.4 18.6 | 75 | 2.9 | 0.152 | 16.4 |
| + Gemini 3.5 Flash | 95.6 6.2 | 80.5 15.9 | 91 | 2.5 | 0.227 | 28.1 |
| Repair + API reference ( vs. Repair-only) | ||||||
| Predictor | Compile OR | Pass compile OR |
|---|---|---|
| Repair loop (vs. matched-budget prompting) | ||
| Repair loop | 2.34 [1.71, 3.21] | 1.82 [1.37, 2.42] |
| Retrieval and performance (vs. Repair-only) | ||
| API reference | 2.88 [1.93, 4.30] | 1.09 [0.94, 1.27] |
| Developer guide | 1.52 [1.05, 2.22] | 1.06 [0.90, 1.25] |
| Performance ( 1 SD) | 2.31 [1.83, 2.91] | 1.41 [1.23, 1.63] |
| 99% compile | |||
| Failure mode | All | Claude | Gemini |
| False negative (under-detection) | 383 (86.8%) | 22 (84.6%) | 16 (100%) |
| reports nothing | 212 (48.1%) | 11 (42.3%) | 7 (43.8%) |
| catches some, misses some | 170 (38.5%) | 11 (42.3%) | 9 (56.2%) |
| flags wrong target | 1 (0.2%) | 0 | 0 |
| Wrong message / location | 16 (3.6%) | 1 (3.8%) | 0 |
| Subset | Pass rate | Pass odds vs. ref. |
|---|---|---|
| By analysis surface (scanner interface) | ||
| XML resource | 72.2% | – |
| Source code (UAST) | 66.3% | 0.76 |
| Multiple scanners | 55.3% | 0.48* |
| By benchmark difficulty tier (vs. Easy) | ||
| Easy | 68.6% | – |
Static Code Analysis
Static code analysis examines source code without running it to find defects, security risks, and maintainability problems.
See all 62 papers