Evaluating AI Coding Assistants for Mobile Development: Quality, Time, and Cost
This article explains why AI coding assistants need task-level evaluation for mobile development, defines pass rate, average completion, average duration, and cost per run, and introduces cost per passed task as an efficiency metric. It also examines the tradeoff between high completion and long duration, provides a reusable Python pipeline for metric aggregation, and offers a decision framework and common pitfalls for tool selection.
1. Why Mobile Development Needs Separate Evaluation
General code-generation ability does not transfer directly to mobile app development. Mobile projects typically involve UI layout, lifecycle management, permission requests, local storage, background task scheduling, and compatibility across OS versions. Code that runs correctly in a command-line environment may still fail UI rendering or permission checks.
For this reason, evaluating an AI coding assistant only by how fluently it generates code or how often a single function is correct is not enough to determine whether it can handle real development work. A more reasonable approach is to evaluate it on complete engineering tasks, such as creating an app from scratch, adding a feature to an existing app, migrating legacy code to a new framework version, or converting one application form into another.
These tasks share several characteristics:
- They involve multiple files, with dependencies between changes.
- They require understanding of the project structure and existing conventions.
- Results must be compilable, runnable, and verifiable.
- Execution takes time and may require repeated corrections.
The value of evaluation is that it turns “looks like it can write code” into “can deliver a runnable result under constraints.”
2. Composition of Evaluation Tasks
An effective evaluation set usually covers four types of tasks.
1. App creation: Generate a complete project skeleton from a requirements description, including dependency configuration, entry pages, and basic navigation. This type of task tests how well the model understands engineering directory conventions.
2. Feature development: Implement a new feature in an existing project, such as adding list pagination, integrating a local database, or implementing form validation. This type of task tests the model’s ability to read context and follow existing code style.
3. Code migration: Replace obsolete API calls, deprecated state-management approaches, or old-version syntax with new solutions. This type of task tests the model’s judgment about the scope of impact, meaning whether it can find all locations that need modification.
4. Application-form conversion: For example, splitting single-page application logic into multiple modules, or rewriting one UI approach into another component system. This is the most difficult type because it requires reorganizing code while keeping behavior consistent.
Two points matter when designing tasks. First, every task must have clear acceptance criteria, preferably automated test cases or build commands. Second, task descriptions should stay close to real requirements and avoid excessive decomposition; otherwise, the evaluation results cannot reflect the model’s overall planning ability.
3. Four Core Metrics and Their Meaning
3.1 Pass Rate
Pass rate is the proportion of task results that satisfy all acceptance criteria. It is a binary metric: a task either passes or fails.
The advantage of pass rate is that its conclusion is clear and suitable for horizontal comparison. The disadvantage is that it hides cases that are “close but not quite successful.” A result with only one failing test and a result with a complete failure are both recorded as 0 in the pass rate.
3.2 Average Completion
Average completion measures how much of each task was completed, usually calculated as the proportion of acceptance items met. For example, if a task contains 10 acceptance criteria and 8 are met, the completion is 80%.
Only by looking at completion together with pass rate can two types of models be distinguished: one that often gets close to success but misses the final step, and another that steadily completes most of the work but rarely meets all requirements. The former requires manual finishing, while the latter may require redesigning the task.
3.3 Average Duration
Average duration is the time from when the model receives a task to when it outputs a verifiable result. It includes thinking, code generation, running checks, and self-correction.
Duration needs to distinguish between two measurement bases: wall-clock time for automated runs and the time a developer waits for results. If human confirmation steps are involved, the difference between the two can be large. Evaluation reports should state the measurement basis clearly; otherwise, data from different sources cannot be compared.
3.4 Cost per Run
Cost per run is the compute cost of completing one evaluation task. It usually includes model input and output fees as well as the resource overhead of the execution environment.
Cost per run is easy to misread. If a low-cost approach has a very low pass rate, its actual delivery cost may be higher. This leads to the key metric in the next section.
4. Measuring Efficiency with Cost per Passed Task
Cost per run only shows how much one run costs. What teams really care about is how much it costs to obtain a usable result. This leads to the following derived metric:
Cost per passed task = cost per run ÷ pass rate
Assume the following data for two approaches. These are hypothetical values for demonstration, not measured results:
| Plan | Cost per Run | Pass Rate | Cost per Passed Task |
|---|---|---|---|
| A | CNY 100 | 20% | CNY 500 |
| B | CNY 10 | 15% | ~CNY 66.7 |
Plan B costs only one-tenth as much per run as Plan A, but its pass rate is lower. Even so, its cost per passed task is much lower. This shows that selection needs to consider both success rate and unit price; looking at either one alone can lead to the wrong conclusion.
The same principle applies to duration. If humans need to spend a large amount of time checking and repairing output, the runtime saved by the model may be offset by manual effort.
5. What High Completion and Long Duration Together Mean
A common phenomenon in evaluations is that a given approach has high average completion but very long average duration. This usually reflects several engineering tradeoffs.
First, the approach tends to perform complete validation. Long duration may come from multiple rounds of self-checking, such as repeated compilation, test execution, and error correction. This pattern raises completion but lengthens waiting time.
Second, the approach tends to use a more conservative modification strategy. If the model reads a large amount of context before making changes, or confirms dependencies file by file, its changes will be more stable but slower.
Third, the task itself has a long dependency chain. Migration tasks often require fixing a series of compilation errors in sequence, with each step depending on the previous result. This naturally lengthens the process.
For users, this tradeoff has no absolute good or bad. The suitable choice depends on the scenario:
- For core modules that require high-quality delivery and can tolerate longer cycles, high completion is often more valuable.
- For prototype validation, batch small changes, or scenarios that need rapid feedback, low latency and low cost may be more important.
- For teams with limited budgets, a low-cost approach can handle most tasks first, while difficult tasks are assigned to a high-completion approach.
6. Building a Reusable Evaluation Pipeline
If a team needs to evaluate its own scenarios, the evaluation can be divided into three stages: task-set definition, automated runs, and metric aggregation. The code below demonstrates the metric aggregation stage. It reads records from each run and calculates the core metrics.
from dataclasses import dataclassfrom statistics import mean@dataclassclass TaskRun:task_id: strpassed: boolcompletion: float # Completion rate, range 0.0 to 1.0duration_h: float # Duration in hourscost_usd: float # Cost per run in USDdef summarize(runs: list[TaskRun]) -> dict:"""Summarize core metrics for a set of evaluation runs."""if not runs:raise ValueError("runs must not be empty")n = len(runs)passed_runs = [r for r in runs if r.passed]total_cost = sum(r.cost_usd for r in runs)return {"pass_rate": len(passed_runs) / n,"avg_completion": mean(r.completion for r in runs),"avg_duration_h": mean(r.duration_h for r in runs),"cost_per_run": total_cost / n,"cost_per_pass": (total_cost / len(passed_runs) if passed_runs else float("inf")),}if __name__ == "__main__":sample = [TaskRun("create-app-01", True, 1.0, 2.5, 3.2),TaskRun("feature-02", False, 0.7, 4.0, 3.5),TaskRun("migrate-03", False, 0.4, 6.0, 4.1),]for key, value in summarize(sample).items():print(f"{key}: {value:.3f}")
Keep the following points in mind when using this code:
- The same task set should be run in the same environment, with the same prompting strategy, and within the same time window to avoid environment differences contaminating the conclusions.
- Each task should be run multiple times because generative model outputs are stochastic; a single result is not enough to draw conclusions.
- Acceptance criteria should combine automated tests with manual spot checks, and should not rely only on the model’s self-reported “completion.”
7. Decision Framework for Tool Selection
Based on the analysis above, selection decisions can be made in the following order.
Step 1: Define task types. List the three to five most common task types for the team and set acceptance criteria for each. An evaluation without acceptance criteria has no reference value.
Step 2: Determine constraints. These include the maximum acceptable duration, weekly budget limit, human effort for code review, and data compliance requirements. Constraints determine which metrics are hard thresholds.
Step 3: Calculate combined metrics. For candidate approaches, calculate pass rate, average completion, average duration, and cost per passed task, then filter according to the constraints.
Step 4: Run a small-scale pilot. Try the approach on one module of a real project for one to two weeks and record the manual modification effort. Data from this step often reflects actual benefits better than benchmark tests.
Step 5: Review regularly. Tool and model capabilities change quickly, so selection conclusions should be revalidated periodically rather than reused indefinitely.
8. Practical Advice and Common Pitfalls
Pitfall 1: Looking only at pass rate. A high-pass-rate approach that takes too long may slow down iteration. Completion, duration, and cost should be observed together.
Pitfall 2: Treating benchmark scores as equivalent to the team’s own experience. Public benchmark task designs may not match the team’s codebase, technology stack, and coding conventions. Benchmark results can serve as a reference, but they must be validated in the team’s own scenarios.
Pitfall 3: Ignoring manual review cost. Automatically generated code must be reviewed before it can be merged into the main branch. Review time should be included in total cost.
Pitfall 4: Choosing a tool once and for all. Different task types may suit different approaches. A more pragmatic practice is to allocate tools by task category and keep room for switching.
Practical advice:
- Build an internal evaluation set and update it continuously as the business changes.
- Record the input, output, and acceptance results of each run to support retrospective analysis.
- Put AI-generated code through the same testing and review process as human-written code.
- For tasks involving sensitive data or permissions, run them in an isolated environment first before deciding whether to connect them to the production environment.
In short, the key to evaluating AI coding assistants is to compare quality, time, and cost within the same framework. Metric numbers have decision-making value only after task boundaries and acceptance criteria are clearly defined.
