Evaluating AI Coding Agents for Mobile App Development: Metrics and Trade-offs

    This article explains how to evaluate AI coding agents on mobile app development tasks. It covers four metrics (pass rate, average completion, average duration, and cost per run), the trade-offs between completion quality and speed, a reproducible evaluation framework with a sample metric script, and a selection process with review practices for agent-generated code.

    1. Why Mobile App Development Needs a Dedicated Evaluation

    Mobile app development is a demanding test for AI coding agents. A project usually includes several modules, such as UI layout, state management, network requests, local storage, permission requests, and multi-device adaptation, and these modules depend on each other. A single feature change can affect build configuration, dependency versions, and test cases.

    General code generation benchmarks usually measure a single function or algorithm problem, so they do not reflect this kind of engineering work. The industry focus is on whether an agent can complete the following tasks in a full project:

    • Build a new app that compiles and runs, starting from a requirements description;
    • Add features to an existing codebase without breaking original behavior;
    • Migrate old code to a new framework or language version;
    • Convert one app form into another, for example, turning a single-screen tool into a multi-page app.

    These tasks share common traits. They involve many steps, require continuous reading of context, and must be verified through compilation and tests. An evaluation needs to consider both whether the result is correct and how much time and resources the process consumes.

    2. Four Core Metrics

    2.1 Pass Rate

    Pass rate is the share of tasks whose final output meets all acceptance criteria:

    Pass rate = number of passed tasks / total number of tasks

    Acceptance criteria should include successful compilation, passing automated tests, and manual verification of key features. Looking only at compilation results tends to overestimate agent capability, because code that compiles may not run correctly.

    2.2 Average Completion

    Pass rate is a binary result, so it cannot show tasks that were almost finished. Average completion splits each task into several acceptance items, scores each task by the share of items it satisfies, and then averages the scores across all tasks. For example, a task with ten acceptance items that satisfies eight has a completion of 80%.

    This metric helps identify common agent weaknesses. If completion is generally high but pass rate is low, the final steps are usually weak. Typical causes include missed edge cases, configuration files that were not updated, or tests that do not cover new logic.

    2.3 Average Duration

    Duration is measured from when a task is assigned to when the result is submitted. It directly affects development pace. For teams that iterate quickly, waiting several hours can block a full day of work. For tasks that run in overnight batches, duration matters much less.

    When measuring duration, separate two types of time: the time the agent spends actually working, and the time spent waiting for external resources, such as build queues or dependency downloads. If these are mixed together, the comparison results will be distorted.

    2.4 Cost per Run

    Cost includes model call fees, compute resource fees, and the cost of occupying the evaluation environment. Different approaches can have very different cost structures. When comparing them, calculate costs using the same task set and the same resource configuration. Do not directly compare costs from different configurations.

    3. Engineering Trade-offs in Long-Running Tasks

    3.1 High Completion and Long Duration

    In a single task, an agent may spend a lot of time planning, reading code, and repeatedly compiling and fixing errors. This approach usually raises completion because it checks more details. However, longer durations also increase the cost of waiting and context switching for developers.

    Whether this strategy is worth it depends on the value of the task. For refactoring a core module, spending several extra hours to get higher accuracy is usually worthwhile. For interface copy that needs adjusting several times a day, a fast result matters more than a perfect one.

    3.2 Speed and Cost

    Fast, low-cost approaches often use shorter reasoning chains and fewer self-check steps. They perform well on simple tasks, but they tend to miss details in tasks that span multiple files or dependencies.

    The common trade-offs are shown below:

    Scenario Suitable strategy Main risk
    Limited budget, simple and repetitive tasks Fast, lightweight approach with manual spot checks Low pass rate on complex tasks
    Core modules that require high correctness High-completion approach that accepts longer duration Long waiting times and high cost
    Teams that need fast feedback Tiered processing: fast approach for simple tasks, careful approach for complex tasks Requires extra logic to classify tasks

    Tiered processing is usually a good practice. First, use rules or a lightweight model to judge task complexity. Then route each task to a suitable strategy. This helps control cost and quality at the same time.

    4. Building a Reproducible Evaluation Framework

    Evaluation results are only useful when they can be reproduced. We recommend following these principles:

    1. Fix the task set: tasks should cover the four scenarios of creation, development, migration, and conversion, and stay consistent across evaluation cycles.
    2. Standardize the environment: use the same dependency versions, build tools, and simulated device configurations.
    3. Run each task multiple times and average the results: agent output is random, and single-run results vary widely, so repeat each task and analyze the distribution.
    4. Record process data: save logs, the list of modified files, and failure reasons for each run to support later root-cause analysis.
    5. Isolate the execution environment: code changes during evaluation should happen in a sandbox, without access to real code repositories or production credentials.

    The following script shows how to aggregate single-run results into these metrics:

    1. from dataclasses import dataclass
    2. @dataclass
    3. class RunResult:
    4. task_id: str
    5. passed: bool # Whether the task passed all acceptance criteria
    6. completion: float # Share of acceptance items met, from 0.0 to 1.0
    7. duration_h: float # Hours from task assignment to submission
    8. cost_usd: float # Total cost of this run, in US dollars
    9. def summarize(results: list[RunResult]) -> dict:
    10. if not results:
    11. raise ValueError("Evaluation results are empty, cannot compute statistics")
    12. n = len(results)
    13. passed_count = sum(r.passed for r in results)
    14. total_cost = sum(r.cost_usd for r in results)
    15. return {
    16. "pass_rate": passed_count / n,
    17. "avg_completion": sum(r.completion for r in results) / n,
    18. "avg_duration_h": sum(r.duration_h for r in results) / n,
    19. "avg_cost_usd": total_cost / n,
    20. # Average cost per successfully completed task, a better measure of
    21. # cost-effectiveness than the cost of a single run
    22. "cost_per_passed": total_cost / passed_count if passed_count else None,
    23. }
    24. # Sample data for demonstrating the calculation only, not measured results
    25. sample = [
    26. RunResult("t01", True, 1.0, 3.5, 4.2),
    27. RunResult("t02", False, 0.7, 9.0, 12.8),
    28. RunResult("t03", True, 0.9, 1.2, 1.1),
    29. ]
    30. print(summarize(sample))

    The cost_per_passed metric is especially useful. An approach may have a low cost per run, but if its pass rate is also low, the actual cost of each completed task may not be worthwhile.

    5. Selection Process

    When choosing an agent approach, follow these steps:

    1. Define business constraints: list the budget ceiling, the maximum acceptable duration, and the minimum acceptable pass rate.
    2. Build a representative task set: draw tasks from real requirements and avoid relying only on demo-level examples.
    3. Run the evaluation under uniform conditions: record the four metrics and the failed samples.
    4. Filter by constraints: eliminate approaches that exceed the budget or duration limits.
    5. Compare cost-effectiveness among the remaining approaches: focus on the cost per passed task and the distribution of completion.
    6. Run a small pilot: observe results over one real iteration cycle before deciding on a wider rollout.

    Evaluation results only reflect performance on the evaluation task set. A team’s code size, tech stack, and coding standards all affect real-world results, so the final decision should rely on the team’s internal pilot data.

    6. Practical Considerations

    Developers should review code generated by agents, especially the parts that involve permissions, data storage, and network communication. The review should focus on the following:

    • Whether sensitive information is written into code or logs. Keys should be injected through environment variables or a key management service.
    • Whether the requested system permissions exceed what the feature needs.
    • Whether network requests validate input and certificates.
    • Whether tests truly cover the new logic, not only the normal path.

    For permission design, follow the principle of least privilege. The account an agent runs under should only have permission to read and write the code directories it needs and to run builds. It should not be able to publish apps or change production configuration.

    Finally, bring the evaluation process into continuous integration. Whenever the model version changes or the configuration is adjusted, automatically run the fixed task set and monitor how the metrics change. This catches regressions early and builds historical data for later decisions.

    7. Summary

    Evaluating AI coding agents for mobile app development requires looking at four metrics together: pass rate, completion, duration, and cost. High completion often comes with longer duration, while fast approaches may miss details on complex tasks. Teams should first define their budget and time requirements, run a uniform evaluation on a representative task set, and then make a choice based on pilot results.