Evaluating and Selecting AI Coding Agents for Mobile App Development
This article explores a practical approach to evaluating AI coding agents for mobile app development, moving beyond simple code generation benchmarks. It highlights four core metrics—pass rate, completion rate, execution time, and cost—and the engineering trade-offs between them. Additionally, it provides a reusable selection process, architectural considerations, and a tiered application strategy to help engineering teams make data-driven decisions.
1. Why Engineering Task-Based Evaluation Matters
Early methods for evaluating AI code generation capabilities typically focused on single function completions or algorithmic problems, judging success solely by passing fixed test cases. These tasks are small in scale and well-defined, creating a significant gap from modern software projects.
Real-world mobile app development involves multiple files, modules, and external dependencies. Tasks can range from setting up a project from scratch, adding new features, migrating legacy APIs, to transforming an app into a different format. These tasks require an understanding of existing code structures and ensuring that modifications do not break existing functionality.
Therefore, the evaluation target should be the “delivery result of a complete task” rather than the text similarity of a code snippet. Engineering task-based benchmarks typically prepare a set of runnable, real-world project scenarios, define clear acceptance criteria, and measure the agent’s performance across multiple runs.
2. The Meaning of Four Core Metrics
A valuable evaluation system generally includes at least the following four metrics:
- Pass Rate: The percentage of tasks that meet all acceptance criteria. It reflects delivery readiness and is the strictest metric.
- Average Completion Rate: The completion ratio calculated based on sub-requirements. Even if a task does not fully pass, a majority of the functionality may have been achieved; this metric captures that partial value.
- Average Execution Time: The end-to-end time from receiving a task to producing a result, including model inference, tool calls, compilation, execution, and self-correction.
- Single Run Cost: The computing resources and API fees consumed for a single task, usually directly related to the input/output data volume.
These metrics are not interchangeable. Focusing only on the pass rate ignores “nearly complete” results, while looking solely at the completion rate may mask the absence of critical functionality.
3. Engineering Trade-offs Among Metrics
3.1 High Completion Rate vs. Long Execution Time
When executing complex tasks, agents often repeatedly read code, formulate plans, write tests, and backtrack to correct errors. These steps improve the completion rate but extend the total execution time. If an agent achieves a significantly higher completion rate but takes longer, the team must evaluate whether the wait is justified.
For large-scale, one-off architectural migrations or refactoring, a longer wait time is usually acceptable as the quality of the result takes priority. For frequent, small modifications, a long wait disrupts the development rhythm, making response speed more valuable.
3.2 Pass Rate vs. Average Completion Rate
A low pass rate combined with a high completion rate indicates that the agent frequently gets “close to completion” but fails the final acceptance stage. These issues often stem from boundary condition handling, UI details, or backward compatibility. The cost of manual remediation depends on where the failure occurs.
Conversely, a high pass rate with a mediocre completion rate suggests the agent excels at well-defined tasks but struggles with decomposing complex requirements.
3.3 Cost vs. Speed
Low-cost, fast solutions are suitable for budget-sensitive or high-frequency invocation scenarios, such as batch generating boilerplate code, adding unit tests, or generating documentation. However, their results may require more manual review, which should be factored into the review cost.
3.4 Cost Per Successful Unit
Comparing only the single run cost is insufficient. A more informative metric is the “cost per successful unit”—the average expense required to achieve one acceptance-passing result:
Cost Per Successful Unit = Single Run Cost / Pass Rate
A solution with a low single-run cost but a very low pass rate might result in a higher cost per successful unit than a more expensive alternative with a higher pass rate. This formula aligns cost and quality on the same scale for comparison.
4. The Impact of Agent Architecture on Results
The same underlying model paired with different agent frameworks can yield vastly different results. The framework dictates several key aspects:
- Tool Invocation Capability: The ability to read project files, execute build commands, and interpret compilation errors.
- Context Management: The ability to selectively load only relevant files when dealing with large projects to avoid information overload.
- Error Backtracking Mechanism: The ability to locate issues and modify code accordingly upon encountering compilation or test failures, rather than repeating the same mistakes.
- Test-Driven Loop: The ability to write or run tests before iterating based on feedback.
Therefore, when comparing different solutions, it is essential to standardize the task set, runtime environment, time limits, and acceptance criteria. Focusing solely on final scores while ignoring running conditions will likely lead to skewed conclusions.
5. A Reusable Selection Process
When introducing a new AI agent tool, teams can follow these steps for evaluation:
- Define the Task Set: Extract representative tasks from actual projects, covering initialization, feature development, migration, and refactoring. Establish quantifiable acceptance criteria for each task.
- Standardize the Runtime Environment: Unify dependency versions, hardware resources, network conditions, and timeout settings to prevent environmental differences from interfering with results.
- Run Multiple Times for Averages: Execute each task multiple times. Because agent outputs are stochastic, a single run is insufficient to draw conclusions.
- Record Comprehensive Data: Save the execution time, cost, pass status, and failure reasons for each run to facilitate subsequent analysis.
- Manual Spot-Checking: Conduct code reviews on results that pass automated acceptance to ensure the agent did not bypass tests or introduce hidden risks.
Below is language-agnostic pseudocode used to aggregate the above metrics:
Data Structure RunResult:IsPassed: BooleanCompletionRatio: Decimal between 0 and 1DurationHours: NumericCost: NumericFunction Aggregate(ResultList):If ResultList is empty:Throw "No valid data" errorn = length of ResultListReturn {PassRate: Count of IsPassed / n,AverageCompletion: Sum of CompletionRatio / n,AverageDuration: Sum of DurationHours / n,AverageCost: Sum of Cost / n,CostPerSuccessfulUnit: AverageCost / PassRate (Infinite if PassRate is 0)}
Note: The values in the example are for illustrating the calculation method and do not represent any actual results.
6. Implementation Recommendations
6.1 Layered Task Selection
There is no need to choose a single solution for all tasks. Tasks can be divided into three tiers:
| Task Type | Priority Metrics | Recommendation |
|---|---|---|
| Large-scale refactoring, architectural migration | Pass rate, completion rate | Accept longer execution times; select higher-quality solutions |
| Daily feature development | Balance of pass rate and time | Choose based on cost per successful unit |
| Boilerplate code, testing, documentation | Cost and speed | Select low-cost solutions, supplemented with manual review |
6.2 Treat Benchmark Scores as References
Public benchmarks provide a horizontal reference, but they cannot replace internal evaluation. Different projects vary greatly in codebase size, dependency structure, and coding conventions. A solution with high benchmark scores might still perform mediocrely on internal projects. Teams should validate against their internal task sets before adopting at scale.
6.3 Control Code Quality and Security Risks
AI-generated code must go through the same pipeline as manually written code: static analysis, automated testing, code review, and permission auditing. Modules involving authentication, payments, or user data should have stricter review thresholds. Generated code must never contain hardcoded secrets; credentials should be injected via environment variables or a secret management service.
6.4 Establish a Continuous Evaluation Mechanism
Model versions and agent frameworks update frequently, meaning selection conclusions have a limited shelf life. It is recommended to periodically re-evaluate using the same task set, recording historical data to monitor trends in quality and cost.
7. Conclusion
Evaluating AI coding agents should revolve around real engineering tasks while examining four key metrics: pass rate, completion rate, execution time, and cost. As these metrics constrain one another, teams must make trade-offs based on task types and resource limitations. By utilizing a standardized evaluation process, derived metrics like the cost per successful unit, and a tiered application strategy, teams can translate benchmark data into actionable selection decisions.
