Evaluating and Selecting AI Coding Models for Mobile Development
This article explores how to evaluate AI coding models for mobile development using real engineering tasks. It covers benchmark task types, core metrics such as pass rate and cost per pass, interpretation guidelines, a practical selection framework, and sample code for building an internal evaluation set.
1. Why Evaluate Coding Models with Real Engineering Tasks?
In the past, evaluating code generation capabilities often involved having models solve algorithm problems or complete function snippets. While easy to score, these tests differ significantly from daily development. Mobile app development involves project scaffolding, UI layout, state management, permission declarations, dependency upgrades, and version migration. Writing a single function correctly does not mean the entire app will compile, run, and pass verification. Therefore, engineering-oriented benchmarks focus more on whether a model can deliver runnable results within the context of a complete project.
The value of such benchmarks lies in their proximity to real delivery scenarios. The evaluation target shifts from “writing a piece of code” to “completing an engineering task,” and the scoring dimensions expand to compilation results, test pass rates, feature completeness, and resource consumption.
2. What Tasks Do Mobile Development Benchmarks Usually Cover?
A comprehensive mobile development benchmark generally includes the following four types of tasks:
- App Creation: Generating project structures, basic configurations, and compilable entry code based on requirements. This evaluates the model’s understanding of engineering standards, such as directory organization, module division, and build script writing.
- Feature Development: Adding new pages, API calls, or local data storage logic to an existing codebase. The model must read and understand the existing code’s naming conventions and architectural agreements; otherwise, the new code may conflict with existing logic.
- Code Migration: Upgrading old language features, deprecated APIs, or legacy build configurations to new standards. The challenge lies in identifying all affected call sites; missing any can cause runtime errors.
- App Conversion: Rewriting a feature implemented in one tech stack to another framework while maintaining consistent behavior. This requires the model to understand the runtime models of both frameworks and handle differences in lifecycle, threading models, and data binding methods.
The difficulty distribution varies among these four task types. Success rates for creation tasks are generally higher than those for migration and conversion tasks, as the latter require the model to simultaneously understand the implicit behavior of legacy code. Therefore, an overall score cannot replace a category-specific analysis.
3. Core Metrics and Their Meanings
3.1 Pass Rate
The pass rate is the proportion of tasks that pass validation among all tasks. Validation methods may include compilation checks, unit tests, UI automation tests, or manual review. The pass rate most directly reflects the probability of the model delivering usable results.
Note that the strictness of validation standards significantly impacts this number. Evaluations that only check compilation usually have higher pass rates than those that also run functional tests. Data from two sets can only be directly compared if the validation rules are consistent.
3.2 Average Completion Rate
Completion rate measures the partial completion of a task. A task might meet 80% of requirements but fail all tests. Completion rate can distinguish between “nearly correct” and “completely off-track” results, making it suitable for judging a model’s stability in complex tasks.
The calculation is usually based on acceptance criteria. For example, if a task has ten acceptance items and passes seven, the completion rate is 0.7. When calculating, the weight of each acceptance item should be standardized; otherwise, results across different tasks lack comparability.
3.3 Average Duration
Duration refers to the end-to-end time for the model and toolchain to complete a task. It is influenced by: model inference speed, tool call count, retry strategy after failures, and environment setup time.
A long duration does not necessarily indicate weak model capability. An agent might execute more compilation and testing steps, thereby improving delivery quality. When interpreting duration, you should also check the number of execution steps and failed retries.
3.4 Cost Per Run
Cost is determined by the billed data volume of model calls, tool call overhead, and the number of repeated runs. When calculating costs, you need to record billing unit prices, exchange rates, and statistical scopes; otherwise, numbers across different reports cannot be aligned.
3.5 Trade-offs Between Metrics
Pass rate, duration, and cost often constrain each other. Longer reasoning chains and more self-verification steps may increase the pass rate while also driving up duration and cost. Faster configurations might sacrifice some quality.
During selection, determine business constraints first—such as budget limits, delivery cycles, and quality thresholds—before comparing candidate solutions within those constraints. Ranking directly by a single metric easily leads to one-sided conclusions.
4. Four Points to Note When Interpreting Evaluation Results
- Configuration determines results. The same model paired with different agent frameworks, prompting strategies, or tool permissions may yield vastly different results. Before comparing, confirm whether the subject being tested is the “model itself” or the “model plus a complete toolchain.”
- Limited sample size. If there are only a few dozen tasks, the success or failure of a single task will cause the pass rate to fluctuate by several percentage points. Pay attention to the confidence interval of the results and try to increase the number of tasks and repeated runs.
- Task distribution affects conclusions. The difficulty gap between migration tasks and creation tasks is significant. An overall score may mask shortcomings in a specific capability, so category-specific results should be reviewed simultaneously.
- Conclusions have a time limit. Models, development frameworks, and dependency libraries update frequently, and evaluation conclusions will become invalid as versions change. Teams should retest regularly and record version information for each evaluation.
5. Practical Framework for Team Selection
To translate evaluation results into selection decisions, follow these steps:
- Clarify use cases. Differentiate between prototype development, daily feature iteration, and large-scale code migration. Different scenarios have vastly different requirements for quality and speed.
- Categorize task types. Break down the team’s actual work into categories such as creation, development, migration, and conversion, and assign weights to each.
- Set hard thresholds. For example, the pass rate for critical modules must not fall below a certain value, or the duration of a single task must not exceed a set limit. Solutions that fail to meet the thresholds are eliminated directly.
- Calculate cost per delivery. Assuming a single run cost is C and the pass rate is p, the average model cost per passed task is approximately C / p. This formula assumes independent runs and does not account for manual review costs, but it quickly compares the cost-effectiveness of different solutions.
- Small-scale pilot. Select a real requirement for an internal trial run and record the number of manual modifications and rework time. Pilot data is closer to actual returns than benchmark scores.
Cost per delivery is only a reference metric. If a solution has low cost but requires extensive manual fixes, the total cost may actually be higher. Therefore, teams should include manual review time in the calculation.
6. Sample Code for Building an Internal Evaluation Set
Public benchmark task compositions may not match a team’s tech stack and business characteristics. Teams can build an internal evaluation set based on their own needs and use scripts to uniformly summarize results. The code below is for illustration only; fields should be adjusted according to the actual evaluation process.
from dataclasses import dataclass@dataclassclass TaskResult:task_id: strcategory: str # Creation, Development, Migration, Conversionpassed: bool # Whether all validations passedcompletion: float # Completion rate, ranging from 0 to 1duration_hours: float # End-to-end duration (hours)cost: float # Single run cost (unified currency unit)def summarize(results: list[TaskResult]) -> dict:total = len(results)if total == 0:raise ValueError("Evaluation results are empty, cannot summarize")passed = sum(1 for r in results if r.passed)total_cost = sum(r.cost for r in results)return {"pass_rate": passed / total,"avg_completion": sum(r.completion for r in results) / total,"avg_duration_h": sum(r.duration_hours for r in results) / total,"cost_per_pass": total_cost / passed if passed else float("inf"),}def summarize_by_category(results: list[TaskResult]) -> dict:groups: dict[str, list[TaskResult]] = {}for r in results:groups.setdefault(r.category, []).append(r)return {name: summarize(items) for name, items in groups.items()}
In the code, summarize_by_category is used to calculate statistics by task category separately, making it easier to identify shortcomings in specific types of tasks. cost_per_pass has the same meaning as the cost per delivery in the previous section, calculating the total cost divided by the number of passed tasks.
7. Common Pitfalls
- Focusing only on overall rankings. Overall scores can mask differences in task structures; judgments should be combined with category-specific results.
- Ignoring manual review costs. If generated code requires significant modifications, actual efficiency may be far lower than what the pass rate suggests.
- Representing stable capability with a single result. The results of the same task may vary across multiple runs; the mean and variance of multiple runs should be tracked.
- Overlooking security and compliance reviews. Automatically generated code still requires permission checks, dependency audits, and privacy reviews before it can be directly merged into production branches.
8. Implementation Recommendations
- Establish a regression test set and automatically retest after every model or toolchain update.
- Write acceptance criteria as executable automation scripts to reduce subjective differences in manual judgment.
- Select models in layers by module or business line; there is no need to use the same solution for all scenarios.
- Save environment snapshots for each evaluation, including model version, tool version, dependency versions, and runtime parameters, for traceability and reproducibility.
