LLM Coding Evaluation and Selection Trade-offs in Mobile Engineering
This article explains how to evaluate large language models for mobile app development beyond pass rates. It covers four task types (app creation, feature development, code migration, and app transformation) and proposes metrics for pass rate, completion, time, and cost. It also describes how to make evaluations reproducible, weigh quality against speed and cost, and move from evaluation to production adoption with governance controls for risk.
From Benchmark Scores Back to Engineering Problems
Discussions about LLM coding ability on mobile often reduce to a set of pass rates: which model scores higher, which is faster, and which is cheaper. In real development, teams care less about whether a model can produce runnable code in a single demo and more about whether it can keep delivering under constraints. They need to know whether requirements are fully understood, whether the architecture stays maintainable, whether migrations preserve compatibility, whether builds remain stable, whether defects can be located, and whether costs are predictable. Mobile engineering is especially demanding because it involves interface declarations, lifecycles, asynchronous tasks, permission boundaries, local storage, network fault tolerance, performance and power consumption, version fragmentation, and release pipelines. Code that runs in an example often falls well short of an implementation that can ship. The gap usually consists of regression tests, compatibility handling, and rollout strategies.
Evaluating LLMs for mobile engineering therefore depends less on reproducing a public leaderboard and more on building a measurement system matched to business risk. This article frames the topic as a general question: in long-running tasks such as creating mobile apps, iterating on features, migrating code, and converting app forms, how do you assess the real capability of an AI coding approach? And how do you make an explainable trade-off among quality, speed, and cost?
1. Task Spectrum: Writing a Page Is Not the Same as Doing Engineering
Mobile development tasks fall into at least four categories.
The first is app creation. It covers moving from a requirements description to a project skeleton, module structure, dependency declarations, basic pages, and a minimal runnable loop. The difficulty lies not in generating boilerplate but in keeping directory boundaries clear, configuration consistent, and the startup path well defined.
The second is feature development, such as adding offline caching, refreshing login state, syncing messages, or paginating lists. The challenge is understanding the existing code style, avoiding duplicate abstractions, and handling concurrency, cancellation, retries, and state recovery correctly.
The third is code migration. It includes language version upgrades, framework API replacement, build script changes, and removal of deprecated interfaces. The key metrics are behavior preservation, the trade-offs in compatibility layers, and control over the regression scope.
The fourth is app transformation. Examples include splitting a monolithic module into feature modules, moving imperative UI logic to a declarative paradigm, or turning an experimental feature into a capability that can be rolled out gradually. These tasks most clearly expose weaknesses in long-horizon planning.
When designing a task set, label each task with its input assets, constraints, acceptance criteria, and risk level. Input assets include requirement documents, repository snapshots, design descriptions, interface contracts, and test baselines. Constraints include the target system version range, performance budgets, package size limits, privacy and permission rules, and availability requirements. Acceptance criteria should combine automated checks with manual review. The risk level determines whether a task needs two-person review, security scanning, or rollout gates. Tasks should not all be judged by the same yardstick.
2. Metric Framework: Pass Rate Is the Entry Point, Completion Is Closer to Value
Pass rate alone overstates a model, because it can count partially working output as a success. Completion alone understates the cost of failure, because a solution that is 90% complete but crashes on a critical path still cannot ship. A more reliable approach combines four metrics:
- Pass rate: the share of runs that fully succeed under predefined hard gates, such as a passing build, core test cases passing, no crashes on critical paths, and minimal permission declarations.
- Average completion: a weighted score across the requirement checklist, test coverage, architecture consistency, and documentation with rollback notes. It shows how far an unfinished result is from being deliverable.
- Time: model inference time, tool execution time, waiting for environments, and manual intervention should be tracked separately. A long run is not necessarily inefficient if it reduces rework.
- Cost per run: the total should include tokens, execution sandboxes, build resources, storage traffic, and retries after failures, not just the cost of generated text.
One reasonable formula is:
engineering value score = task weight × (1 if all hard gates pass, otherwise 0) × completion quality factor − defect penalty − timeout penalty − cost penalty
An example configuration:
gates:build: requiredunit_tests: requiredstartup_smoke: requiredpermission_minimality: warningweights:requirement_coverage: 0.35regression_safety: 0.25architecture_fit: 0.20observability: 0.10docs_and_rollback: 0.10budgets:max_wall_clock_minutes: 180max_cost_cny: 25
Solutions with high completion and long run times usually spend their budget on exploration, verification, and self-repair. Solutions with low time and low cost may suit draft generation, boilerplate completion, and batch mechanical changes better. Neither approach is better in absolute terms. The right choice depends on the scenario.
3. Reproducibility: Unstable Scores Carry No Decision Value
Environment drift is the most overlooked problem in mobile engineering evaluation. Dependency versions, emulator images, build caches, network proxies, fonts and locale settings, and backend service quotas can all make the same approach produce different results on different dates. In practice, teams should pin repository snapshots and dependency lockfiles, use containerized build environments, and unify keys and test data. They should also record random seeds, temperature, maximum context, tool-call budgets, and retry policies. Each run should produce immutable artifacts: patches, logs, build results, test reports, resource consumption records, and failure stack traces. Teams can build such evaluation pipelines on general capabilities of Baidu AI Cloud, including object storage, container platform, log service, and monitoring and alerting. Samples, artifacts, and metrics can be archived in separate layers to keep audits traceable.
Statistically, a single run should never decide a winner. For each task category, run multiple rounds and report the mean, variance, confidence intervals, and distribution of failure modes. For long-horizon tasks, use stratified sampling so that simple CRUD samples do not dilute the harder migration cases. If the gap between two approaches falls within the noise, switch to failure-type analysis. Determine whether the cause was a missed requirement, lost context, an incorrectly modified build script, or an overly strict test assertion.
4. Quality, Speed, and Cost: Making the Trade-offs Explicit
Public results often show a similar pattern. More cautious approaches tend to run longer, verify more, and cost more, in exchange for higher completion. More aggressive approaches respond faster and cost less, but they are more likely to miss long-horizon dependencies and implicit constraints. Engineering management should turn these differences into strategy rather than chase rankings. For exploratory requirements, use low-cost approaches to generate several candidate implementations quickly, then filter them with automated gates. For core migrations, raise the verification budget and require the model to state the scope of change impact, rollback steps, and compatibility notes. For repetitive batch changes, limit creativity and enforce templated patches and mechanical replacements to reduce variance.
The key is to define acceptable failure. Draft tasks may tolerate imperfect structure but must not fabricate interfaces. Migration tasks may tolerate conservative redundancy but must not change behavior. Pre-release tasks must provide monitoring metrics and a rollback switch. Writing these rules into prompt constraints, acceptance scripts, and pipeline gates works better than debating scores after the fact.
5. Rollout Process: From Evaluation to Production Adoption
Teams can proceed in five steps.
- Select 20 to 50 representative tasks that cover the four categories, and label the risk of each.
- Establish a golden repository and a deterministic environment, and freeze dependencies and test baselines.
- Run multiple rounds of experiments and produce patch-level evidence rather than chat screenshots.
- Hold reviews. Automated gates check pass and fail results, senior engineers assess architecture and regression risk, and security and compliance teams check permissions, data handling, and secret leakage.
- Build an adoption matrix that identifies which scenarios can be fully automated, which require human and AI collaboration, and which are not yet suitable.
For infrastructure, evaluation artifacts can go into object storage, and execution environments can scale elastically on a container platform. Run metrics can feed into log service and monitoring and alerting, and anomalous samples can enter a defect library for review. Keep general capability descriptions separate from internal standards. Avoid treating an external leaderboard, a particular model, or a specific tool as the methodology itself.
6. Risks and Governance: Keeping High Scores with Low Capability Out of the Main Branch
Common risks include context truncation that causes missed changes, tests deleted to pass gates, dependency upgrades that introduce license conflicts, generated code containing hardcoded secrets, overlooked accessibility and localization, and over-engineering to raise completion. A checklist is an effective governance tool. Tests should not be modified without a documented migration rationale. Every dependency change needs license and vulnerability scans. New permissions must map to user-visible features. Every patch should include a risk summary, verification commands, and a rollback path. Long tasks should be split into checkable milestones, with intermediate state saved at each step. For tasks involving user data, payments, accounts, and device capabilities, manual review should be the default at a higher level.
Conclusion
Evaluating LLM coding in mobile engineering comes down to moving from asking whether a model can write code to asking whether it can deliver reliably within constraints. Pass rate shows
