Evaluating AI Coding Agents for Mobile Development: Metrics, Trade-offs, and a Reproducible Workflow

    This article explains how to evaluate AI coding agents on real engineering tasks in mobile development. It defines four common task categories, breaks down core metrics such as pass rate, completion rate, time, and cost, explains the trade-offs between quality, speed, and cost, and provides a layered usage strategy plus a reproducible evaluation workflow and checklist to help teams make sound adoption decisions.

    1. Why We Need Engineering-Task-Oriented Evaluation

    The way we assess coding models is shifting from “is a single function correct” to “can the model complete a full engineering task.” Creating applications, developing features, migrating code, and refactoring across frameworks all require the model to understand requirements, break down steps, read and write multiple files, invoke build tools, and fix runtime errors. These tasks involve many steps, and the accuracy of a single response does not reflect real delivery capability.

    Mobile app development is a particularly representative case. UI layout, lifecycle management, permission requests, asynchronous networking, and local storage are tightly coupled, and a change in one place often triggers cascading issues elsewhere. Evaluation therefore needs to answer three questions at once: does the task ultimately pass acceptance, how much progress was made along the way, and how much time and money did it cost?

    2. Defining the Scope of Evaluation Tasks

    Before designing an evaluation, define the task types and acceptance criteria. Common mobile engineering tasks fall into four categories:

    • From-scratch creation: generate a runnable project skeleton with basic pages from a requirements description.
    • Feature development: add a complete feature to an existing codebase, such as a login module or paginated list.
    • Code migration: upgrade legacy code to new APIs or new language features.
    • App transformation: convert an app from one interaction model to another, for example from a single-page structure to a multi-module structure.

    Each task category should have clearly defined acceptance methods. The recommended practice is to write an automated test suite for each task covering compilation, unit tests, key UI flows, and edge cases. The more specific the acceptance criteria, the better the evaluation reflects real differences between configurations.

    3. Breaking Down the Core Metrics

    3.1 Pass Rate

    Pass rate is the proportion of tasks that pass the entire acceptance test suite. It is the strictest metric: a single failing critical case counts as a failure. A high pass rate means the model’s output is directly usable.

    3.2 Average Completion

    Completion measures partial progress. If a feature has five requirement points and the model implements four, completion is 80%. Completion reveals “almost usable” results and helps estimate remediation effort. When pass rate is low but completion is high, the remaining problems are usually concentrated in a small number of edge cases.

    3.3 Average Time

    Time refers to the total duration from task launch to final output, including model inference, tool calls, and repeated fixes after build errors. Time directly affects developer waiting cost and determines whether batch tasks can fit within a schedule.

    3.4 Cost per Run

    Cost includes model invocation fees, compute resource consumption, and environment usage. A low per-run cost does not imply a low total cost; it must be interpreted together with pass rate.

    3.5 Composite Metric: Cost per Passed Task

    Looking at per-run cost alone is misleading. A more meaningful figure is the cost per successfully passed task, calculated as total cost divided by the number of passed tasks. The following example shows how to compute these metrics from raw run records; the data is for illustrating the calculation method only:

    1. from dataclasses import dataclass
    2. @dataclass
    3. class RunRecord:
    4. passed: bool # Whether the run passed all acceptance tests
    5. completion: float # Completion score, between 0 and 1
    6. hours: float # Elapsed time, in hours
    7. cost_usd: float # Cost of a single run, in USD
    8. def summarize(records: list[RunRecord]) -> dict:
    9. n = len(records)
    10. passed = [r for r in records if r.passed]
    11. total_cost = sum(r.cost_usd for r in records)
    12. return {
    13. "pass_rate": round(len(passed) / n, 3),
    14. "avg_completion": round(sum(r.completion for r in records) / n, 3),
    15. "avg_hours": round(sum(r.hours for r in records) / n, 2),
    16. "avg_cost": round(total_cost / n, 2),
    17. # Cost per passed task; returns None if no task passed
    18. "cost_per_pass": round(total_cost / len(passed), 2) if passed else None,
    19. }

    When using this function, run multiple tasks for each model configuration and then aggregate the results. Single runs fluctuate significantly; only averages across multiple runs are comparable.

    4. Understanding the Trade-offs Among Quality, Speed, and Cost

    In engineering practice, quality, speed, and cost are hard to optimize simultaneously. Evaluation results commonly show the following patterns:

    1. High pass rates usually come with long runtimes. To pass all tests, a model typically needs more rounds of planning, execution, and repair, which increases total time.
    2. Low-cost models suit high-frequency, low-risk tasks. These models respond quickly and cheaply, but fail more often on complex dependencies and edge cases.
    3. The gap between completion and pass rate reflects the remediation burden. When the gap is large, the team still has to invest manual effort to finish the remaining parts, and that actual cost must be counted separately.

    Therefore, selection should not be based on a single metric being the highest. Teams need to first determine the fault tolerance of each task: for features involving payments, permissions, or data security, prioritize pass rate; for batch code migrations or prototype validation, a lower pass rate can be acceptable in exchange for faster iteration.

    5. A Layered Usage Strategy

    In practice, a single model rarely covers every scenario. A more feasible approach is to layer configurations by task risk and frequency:

    • Core features and security-related tasks: use configurations with high pass rates and retain manual code review.
    • Routine feature development: balance speed and quality, using automated tests for quick verification.
    • Batch mechanical refactoring: use low-cost, fast configurations combined with scripted validation rules, routing failures to manual work or higher-quality configurations.

    The premise of layering is a unified evaluation methodology; otherwise, data from different teams cannot be compared directly.

    6. Building a Reproducible Evaluation Workflow

    Reproducibility is the foundation of trustworthy evaluation results. Recommended practices include:

    • Fix the environment: unify dependency versions, build toolchains, and emulator configurations so environment differences do not mask model differences.
    • Fix the inputs: keep each task’s requirement description, initial code, and acceptance cases unchanged, and manage them under version control.
    • Isolate network dependencies: replace real APIs with local mock services during testing to reduce external variability.
    • Run multiple times and report statistics: report means and variance rather than the best single run.
    • Record failure causes: classify failures—for example, build errors, logic errors, API misuse, or timeouts—to guide improvement.

    An illustrative configuration file can be organized like this:

    1. task_suite:
    2. name: mobile-feature-dev
    3. runs_per_config: 5
    4. timeout_hours: 24
    5. environment:
    6. toolchain_version: pinned
    7. network: local_mock_only
    8. acceptance:
    9. - build_success
    10. - unit_tests
    11. - ui_flow_tests

    7. Common Pitfalls

    • Ranking by pass rate only. Ignoring time and cost easily leads to wrong decisions under resource constraints.
    • Treating a single run as stable capability. Model output is stochastic; a single result cannot represent long-term performance.
    • Ignoring manual remediation cost. High completion that requires extensive rework may not actually be cheaper to deliver.
    • Disconnection between evaluation tasks and business needs. If generic benchmark tasks differ greatly from the team’s real needs, results have limited value for tool selection.

    8. Implementation Recommendations and Checklist

    Before formally adopting a coding agent, it is recommended to complete the following checks:

    1. List the team’s five most common development task types and write acceptance tests for each.
    2. Set acceptable upper limits for runtime and per-run cost for each task type.
    3. Run each candidate configuration at least five times, recording pass rate, completion, time, and cost.
    4. Calculate the cost per passed task and compare it with the time and expense of completing the same tasks manually.
    5. Classify tasks by risk level and define the default configuration and manual review requirements for each level.
    6. Re-test quarterly, tracking the impact of model updates and changing business requirements.

    In summary, the key to evaluating coding agents is breaking “can it complete the task” into measurable metrics, then making layered decisions based on business risk and budget. Only with a unified, reproducible evaluation process can teams find a stable balance between efficiency gains and delivery quality.