How Far Can LLMs Go in Generating Android Lint Checks from Natural Language?

Moshood A. Fakorede, A. B. Siddique, Manu Sridharan, Umar FarooqarXiv 2026

Imagine you’re an Android developer. You’ve just discovered a sneaky bug pattern in your codebase, and you want to make sure it never happens again. You know that Android Lint—the tool that highlights those yellow and red warnings in your IDE—is the perfect place for a custom check.

But there’s a catch: writing a Lint check is hard. It’s not just "find this string"; it’s navigating complex Abstract Syntax Trees (ASTs), understanding obscure framework APIs, and handling edge cases in both Java and Kotlin. Usually, you’d give up and just write a Slack message to your team.

This paper asks: Can we just tell an AI what we want to catch and have it write the check for us?

TL;DR

Researchers created LINTBENCH, a benchmark of 113 real-world Android Lint checks, to see if Large Language Models (LLMs) can turn a simple sentence into working static analysis code. They found that while LLMs are surprisingly good at this—reaching up to an 85% success rate—the hardest part isn't the "how" (the code syntax), but the "what" (the subtle logic required to actually catch a bug without missing it).

What Problem Does This Paper Address?

Static analysis tools are the "automated spell-checkers" for code. However, authoring a custom rule is a high-effort task. Previous attempts to automate this required the AI to see a "bug-fix patch" or a pre-written test suite.

But in the real world, a developer usually starts with nothing but a natural language description, like: "Flag any use of a fixed seed with SecureRandom because it's insecure."

The authors wanted to know:

  1. Can LLMs generate these checks from description alone?
  2. Does giving them access to API documentation (RAG) or letting them see compiler errors (Self-Repair) help?
  3. Why do they fail when they do?

Methods

The researchers didn't just ask the models to write code; they built a sophisticated "agentic" pipeline to help them succeed.

  • The "Held-out Oracle": Crucially, the models never saw the test cases. This prevents "cheating" where the AI might hard-code a solution just to pass a specific test.
  • Execution-Guided Repair: If the generated code failed to compile or failed a test, the system fed the error messages back to the LLM, giving it up to five tries to fix itself.
  • Retrieval-Augmented Generation (RAG): They indexed the official Android Lint API and developer guides, allowing the models to "look up" the correct way to use the framework.
Fig. 2: Execution-guided repair and retrieval. The description (plus retrieved knowledge) goes to the LLM; the harness compiles and tests the candidate, feeding diagnostics back.

Datasets

The authors introduced LINTBENCH, a human-validated benchmark. They started with 478 candidate issues from the Android Open Source Project (AOSP) and put them through a rigorous "filtering gauntlet" to ensure only high-quality, non-trivial checks remained.

Fig. 1: LINTBENCH construction. Four filters reduce 478 candidate issues to 152; human validation flags 35 and four are held out as few-shot examples, yielding the 113-check LINTBENCH. Badges show the count after each step.

Key Insights and Ideas

  • The "API Hallucination" Barrier: The biggest reason models fail initially is that they make up framework methods that don't exist.
  • RAG is a "Leveler": Providing API documentation helped the "weaker" open-weight models catch up to the proprietary giants (like Claude and Gemini) specifically at the compilation stage.
  • Logic is the Final Frontier: Even when the code compiles and runs perfectly, it often suffers from under-detection. The check is too "lazy"—it runs but fails to flag the actual issue. 87% of checks that compiled but failed tests were due to these false negatives.
  • Complexity Matters: Checks that required "multi-scanning" (e.g., looking at both a Java file and an Android Manifest XML) were significantly harder for the models to coordinate.

Key Results

The study evaluated four models: Claude 3.5 Sonnet, Gemini 1.5 Flash, Qwen 2.5 Max, and Kimi K1.5 Code.

  • Prompting Alone: The best models solved about 65% of the checks on the first try.
  • The Full Pipeline: With RAG and execution-guided repair, the success rate jumped to 85% (achieved by Gemini 1.5 Flash).
  • Compilation Success: In the best configuration, models were able to produce code that compiled 99% of the time.
  • Cost-Effectiveness: Claude 3.5 Sonnet was the "value king," producing successful checks with the fewest tokens and the lowest cost ($0.12 per solved check).
Fig. 3: Outcome composition by model, full configuration on LINTBENCH (113 checks). Bars split each model’s checks by the iteration that first passed (1 = initial, 2–5 = repairs); the gray tail is unsolved within the five-call budget.

Limitations and Future Work

While the results are impressive, the authors note a few hurdles:

  • The "Lazy" Logic: Models still struggle with the deep reasoning required to find every instance of a bug pattern. Future work might need "program-analysis-aware" decoding to help the AI think more like a static analyzer.
  • Data Contamination: Since these are real-world checks from AOSP, there's always a chance the models saw some of this code during their initial training. The authors tried to account for this by checking for verbatim code reproduction (they found none), but it's a persistent challenge in AI research.
  • Beyond Android: The benchmark is currently specific to Android Lint. Expanding this to other frameworks like CodeQL or PMD would be the next logical step.

Summary updated

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.
BibTeX
@misc{fakorede2026how,
  author = {Moshood A. Fakorede and A. B. Siddique and Manu Sridharan and Umar Farooq},
  title = {{How Far Can LLMs Go in Generating Android Lint Checks from Natural Language?}},
  year = {2026},
  eprint = {2611.28159},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.28159},
}
Figure