Many a Little Makes a Mickle: A Code-Centric Empirical Study of Data Minimization Principle in Android App Development

Dianshu Liao, Shidong Pan, Zhenchang Xing, Xiaoyu SunarXiv 2026

TL;DR

This paper bridges the gap between high-level privacy regulations and low-level code by operationalizing the "data minimization" principle for Android developers. Through a large-scale static analysis of nearly 10,000 popular Android apps, the authors reveal widespread privacy risks and distill 31 actionable coding guidelines to mitigate them. Crucially, they demonstrate that modern LLM-based coding tools inherit and amplify these risky real-world data practices, but can be steered to perfect compliance when paired with domain-specific guardrails.

What Problem Does This Paper Address?

Privacy frameworks like the General Data Protection Regulation (GDPR) mandate data minimization—the principle that personal data collection must be limited to what is strictly necessary for a specific purpose. However, these legal texts are abstract, leaving software engineers without clear, actionable guidance on how to write compliant code day-to-day.

Prior research has primarily focused on high-level policy analysis (e.g., checking if an app's privacy policy matches its actual behavior), rather than addressing root causes in the source code. This lack of fine-grained guidance leads to accidental over-collection, insecure storage, and unnecessary data transmission. The problem is further compounded by the rise of AI-assisted programming ("vibe coding"), where developers prioritize rapid feature delivery over careful privacy engineering, risking the propagation of non-compliant habits embedded in LLM training data.

Methods

The authors tackle this problem through a structured, four-step approach:

  1. Formative Study: They qualitatively analyze 1,114 open-source Android apps using an iterative open-coding process to build a taxonomy of data minimization (DM) scenarios across five key data-handling stages: Permission Control, Acquisition, Transmission, Storage, and Retention.
  2. Static Analysis at Scale: They build a heuristic-based analysis pipeline using FlowDroid to detect DM-related risk signals (such as broad API usage, declarative configurations, and data flows from sensitive sources to network/log sinks) across a massive dataset of popular commercial apps.
  3. Guideline Distillation: Based on the empirical findings, they formulate 31 actionable coding guidelines to help human developers implement data minimization.
  4. LLM Evaluation: They test three advanced LLMs (Gemini-2.5-Pro, GPT-5.2, Claude-4.5-Sonnet) and the AI-powered editor Cursor across 30 simulated Android development prompts to see if they generate risky code, and whether the distilled guidelines can successfully steer them toward compliance.

Datasets

  • F-Droid: 1,114 open-source Android applications used for the initial qualitative formative study to identify recurring data-handling patterns.
  • AndroZoo: A large-scale repository from which they filtered 14,237 popular Android APKs (each with at least 10 million downloads). They successfully analyzed 9,875 of these APKs for their large-scale empirical study.
  • LLM Benchmark Prompts: A newly constructed set of 30 prompts simulating real-world Android development scenarios across the 10 identified DM categories.

Key Insights and Ideas

  • Widespread Neglect of Data Backups: A staggering 46.35% of analyzed apps enable automatic cloud backups without defining any rules to restrict their scope, blindly backing up sensitive or transient states like tracking tokens and interaction logs.
  • The Blocklist Mentality: Even when developers configure backup rules, they overwhelmingly prefer a "blocklist-first" approach (excluding specific data) rather than a safer "allowlist-first" approach (only including the bare minimum).
  • LLMs as Risk Amplifiers: AI coding tools don't just copy human mistakes; they amplify them. When given basic prompts, state-of-the-art models consistently generate data minimization violations, particularly failing at backup configurations.
  • The Power of Prompt-Level Guardrails: The issue isn't an inherent limitation in LLM capability, but a lack of explicit awareness. Injecting the distilled domain-specific guidelines into the prompt reduced AI-generated privacy violations to absolute zero.

Key Results

  • 76.44% of the 9,875 analyzed popular apps exhibited at least one data minimization risk signal.
Figure 1: Per-indicator breakdown of data minimization prac- tices across 9,875 analyzed APKs.
  • Unused Permissions: 1,952 apps declared permissions they never actually used in code, with interaction control and PII data access being the most common culprits.
Figure 2: Occurrences of over-claimed permissions.
  • Data Backup Violations: 4,577 apps left backups wide open without restricting the scope via configuration files.
  • LLM Performance: In basic generation tasks, the advanced LLMs produced between 46 and 59 data minimization violations across 30 scenarios. Crucially, when the distilled guidelines were added to the prompts, violations dropped to zero across all evaluated models.

Limitations and Future Work

  • API-to-Permission Mapping Gaps: The static analysis relies on existing API-to-permission mappings, which can be outdated for newer Android versions, leading to lower precision (70–83%) in permission-related indicators.
  • Static Analysis Timeouts: The pipeline timed out on some very large applications, meaning the scale analysis successfully covered ~69% of the target dataset.
  • Future Directions: The authors suggest integrating these 31 guidelines directly into IDEs or CI/CD pipelines to automate compliance checks for both human developers and AI coding assistants.

Summary updated

Abstract

Modern mobile applications consume large amounts of data to function, raising significant privacy concerns and regulatory challenges. While prior work has primarily focused on detecting compliance gaps through policy analysis, there remains a lack of actionable guidance for developers to implement privacy principles at the code level. In this paper, we focus on data minimization as a developer-operationalizable principle and investigate its realization in Android applications. We conduct a formative study on 1,114 open-source Android apps to identify ten recurring data minimization scenarios across five data-handling stages. Building on this, we perform a large-scale analysis of 9,875 real-world APKs and distill 31 actionable coding guidelines to support privacy-compliant development. We further examine LLM-based code generation in Android development and find that state-of-the-art models consistently reproduce data minimization-risky practices, indicating that they inherit and amplify patterns from real-world code. Encouragingly, incorporating our guidelines eliminates these issues across all evaluated models. Our work advocates a shift toward responding to privacy regulatory requirements at their code-level root causes, enabling better compliance in both human and AI-assisted programming.
BibTeX
@misc{liao2026many,
  author = {Dianshu Liao and Shidong Pan and Zhenchang Xing and Xiaoyu Sun},
  title = {{Many a Little Makes a Mickle: A Code-Centric Empirical Study of Data Minimization Principle in Android App Development}},
  year = {2026},
  eprint = {2606.02960},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.02960},
}

Loading related content...

Figure