Evaluating AI Coding Agents for Mobile App Development: Metrics Breakdown and Engineering Trade-offs
This article presents a practical framework for evaluating AI coding agents on real-world mobile app development tasks. It defines four core metrics—pass rate, average completion, average duration, and per-run cost—and examines the engineering trade-offs between them. It also offers guidance on task design, acceptance criteria, a decision framework for agent selection, and best practices for building an internal evaluation pipeline.
1. Background: From Single Scores to Multi-Dimensional Evaluation
A growing number of teams are assigning real engineering tasks to AI coding agents—such as generating a project skeleton from a requirements description, adding new features to an existing codebase, or migrating legacy code to a new framework or coding style. These tasks are fundamentally different from algorithmic code generation exercises. The agent must understand the project structure, read dependency configurations, modify multiple files, run builds, and iteratively fix errors based on compiler or test output.
Mobile app development is a representative scenario in this category. A mobile project simultaneously involves UI layouts, page lifecycles, permission declarations, dependency versions, and platform-specific adaptations. A single error in any of these areas can cause the build to fail. Therefore, evaluating such agents requires more than checking whether a generated code snippet runs—it requires verifying whether the agent can deliver a complete, compilable result that passes acceptance checks.
2. Designing Evaluation Tasks
A credible evaluation suite typically covers three types of scenarios:
- Greenfield creation: Given functional requirements, the agent must produce a compilable project skeleton and base pages.
- Feature development: Add a new module to an existing project without breaking existing behavior.
- Migration and conversion: Refactor legacy interfaces, frameworks, or coding patterns to new standards while preserving business logic.
Every task should be paired with acceptance criteria, and these criteria should be as automated as possible—for example, whether the build succeeds, whether unit tests all pass, whether specified screens render correctly, and whether API calls follow the new conventions. The acceptance criteria must be frozen before the agent runs. If the criteria are modified after execution, the evaluation results lose their comparative value.
The number of tasks is equally critical. The smaller the sample, the larger the variance in results; success or failure on just a few tasks can alter the overall ranking. Reports should therefore state the total task count and the distribution across task types.
3. Four Core Metrics: Definitions and Calculations
3.1 Pass Rate
Pass rate is the proportion of tasks that satisfy all acceptance criteria:
Pass rate = Number of passed tasks / Total number of tasks
This metric answers whether the result is ready for direct delivery. The bar is strict: if a single acceptance criterion is not met, the task is marked as failed.
3.2 Average Completion
Average completion measures, for each task, the percentage of acceptance criteria satisfied, then averages that value across all tasks:
Average completion = Mean(satisfied criteria count / total criteria count for each task)
This metric answers how far the agent progressed overall. In long, multi-step tasks, an agent may complete most sub-goals but get stuck on a dependency issue. Average completion captures this partial progress, whereas pass rate records it as a total failure.
3.3 Average Duration
Average duration is the wall-clock time from when the agent receives the task to when it submits the result, averaged over all tasks. Duration is determined by three factors: model inference speed, the number of tool calls, and the number of retry rounds after failures. In complex tasks, retries are often the dominant contributor to duration; therefore, retry counts should be recorded separately for each run.
3.4 Per-Run Cost
Per-run cost includes model API fees, sandbox compute resources, and storage overhead. Pricing models vary significantly across providers—some charge input and output separately, some offer cache discounts, and others bill by time. Before any comparison, all costs must be converted to the same pricing basis, the same currency, and the same date; otherwise, the numbers are not comparable.
Below is illustrative summary code showing how to derive the four metrics from per-task records. The sample data is provided only to clarify the calculation method:
Structure TaskResult:passed # whether all acceptance criteria are satisfied (boolean)satisfied # count of satisfied acceptance criteriatotal # total number of acceptance criteriaduration_h # duration in hourscost # per-run cost (unified currency unit)Function summarize(results):n = number of resultsreturn {pass_rate: number of passed tasks / n,avg_completion: mean(satisfied / total for each result),avg_duration: mean(duration for each result),avg_cost: mean(cost for each result),}Example data:(passed, satisfied 10, total 10, duration 2.5, cost 3.2)(failed, satisfied 7, total 10, duration 1.0, cost 1.1)(failed, satisfied 4, total 8, duration 6.0, cost 4.0)
4. Trade-offs Between Metrics
The four metrics are not independent; they involve clear engineering trade-offs.
Completion vs. duration. An agent designed to repeatedly verify, proactively repair, and run multiple self-check cycles will satisfy more acceptance criteria, but the time per task increases significantly. If an agent tends to submit quickly upon encountering an error, duration drops, but completion may plateau at a lower level.
Cost vs. depth. Longer context windows, more tool calls, and larger models generally yield better reasoning capability, but they also push up per-run costs. Truncating context and limiting tool calls can reduce costs, but the agent is more likely to give up when facing cross-file dependencies or legacy code.
Autonomy vs. controllability. A fully autonomous agent reduces the need for human intervention, but failures are harder to diagnose. A workflow with human checkpoints is slower but can catch errors at critical steps.
The takeaway: the solution with the highest pass rate is not necessarily the most cost-effective overall. Selection should be driven by business objectives, not by a single column of numbers.
5. A Decision Framework for Agent Selection
Different scenarios call for different metric priorities. Consider ranking them as follows:
- Delivery-quality-sensitive use cases, such as critical migrations before release. Prioritize pass rate and pair it with a manual review process—spot-check results that passed.
- Iteration-speed-sensitive use cases, such as prototyping and internal tools. Prioritize average duration and average completion. Failed tasks can be handed over to humans, as long as the takeover cost is lower than writing from scratch.
- Budget-sensitive use cases, such as batch refactoring or high-volume repetitive work. Compare unit effective cost rather than per-run cost:
Unit effective cost = Average per-run cost / Pass rate
This formula assumes the pass rate is greater than zero. If the pass rate is zero, unit effective cost is undefined, and the solution should be deemed unusable on the current task set.
In addition, the cost of manually fixing failed tasks must be included in the total cost. A solution with a low per-run cost but a high failure rate can end up being more expensive due to extensive rework.
6. Building an Internal Evaluation Pipeline: Practical Recommendations
Rather than relying solely on external rankings, teams should build their own evaluation system. Recommended steps:
- Build a task library. Collect tasks from real business requirements, strip out sensitive information, and grade them by difficulty. Task descriptions should be clear and unambiguous.
- Isolate the runtime environment. Use a clean project snapshot with pinned dependency versions for each run, and block network access unrelated to the evaluation to ensure reproducibility.
- Run multiple times and aggregate statistics. Repeat the same task several times and record the mean and dispersion. A single run is insufficient to support a conclusion.
- Record the full trace. Save every tool call, build output, and error message at each step. When a failure occurs, the trace is the primary basis for diagnosis.
- Spot-check automatically verified results. Automated tests can produce false positives—code that passes tests but does not satisfy the requirement. Manually sampling tasks marked as passed can surface such issues.
- Manage versions and accounting basis. Each report should state the agent configuration, task library version, pricing date, and cost conversion method so that results can be audited and compared later.
7. Common Pitfalls
Treating a single benchmark as an absolute ranking. Different task sets produce very different distributions. Swap in another set of tasks and the original ranking may completely reverse. Benchmarks are useful references, but they should not be the only basis for a decision.
Ignoring the cost accounting basis. Billing models, caching policies, and whether retries are charged all materially affect the final numbers. If the bases are inconsistent, the comparison table is meaningless.
Looking only at averages. The average duration can be skewed by a few outlier tasks. The median and percentiles should also be examined to understand the typical case.
Overlooking failure modes. Failures can stem from misunderstood requirements, dependency version conflicts, or build configuration errors. Different failure causes point to different improvement directions. Categorizing failures is more valuable than merely counting them.
8. Summary
The essence of evaluating AI coding agents is putting delivery quality, response speed, and running cost into a single table, and drawing conclusions through consistent accounting, reproducible processes, and manual spot-checks. Pass rate answers whether delivery is possible; completion answers how much progress was made; duration and cost answer the price of the effort. Only by understanding the trade-offs among these four metrics and setting priorities aligned with their own business context can readers make explainable, auditable selection decisions.
