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

    This article explains how to evaluate AI coding agents for mobile app development using engineering-level tasks rather than isolated code tests. It covers four task types, four core metrics, the trade-off between high completion and long runtime, scenario-based selection, and how teams can build a private evaluation pipeline with repeated runs, cost-per-success analysis, and manual review.

    1. Why Mobile App Development Needs Its Own Evaluation Criteria

    General code ability tests often target standalone functions or algorithm problems, where inputs and outputs are clear and scoring is direct. Mobile app engineering is much more complex. A runnable app usually includes multiple layers at the same time: UI layout, page navigation, lifecycle management, permission requests, network requests, local storage, dependency declarations, and build configuration. If any one of these layers fails, the entire app may fail to install or run correctly.

    Therefore, evaluating the ability of intelligent coding tools in this scenario requires putting tasks back into a complete engineering environment and checking whether they can deliver usable results under real constraints, rather than only checking whether a single code snippet is correct.

    2. Four Types of Typical Tasks

    Evaluation tasks for mobile development can be roughly divided into four categories.

    1. App creation: Build a project skeleton based on a requirements description, including directory structure, base pages, and build configuration. This mainly examines the agent’s understanding of project conventions.
    2. Feature development: Add new features to an existing project, such as list pagination, form validation, or offline caching. This mainly examines whether it can read existing code and maintain consistency in style and architecture.
    3. Code migration: Replace old-version APIs or old patterns with new-version patterns, such as updates to an asynchronous programming model or upgrades to a UI declaration style. This mainly examines understanding of change notes and the precision of localized modifications.
    4. App conversion: Convert functionality implemented in one way into another implementation while keeping behavior consistent. This mainly examines semantic preservation, meaning the original functionality must not regress after conversion.

    Each task should include automatable acceptance criteria. Below is a structural example of a task description:

    1. task:
    2. id: feature-offline-cache-01
    3. type: feature_development
    4. description: Add local caching to the list page and show the most recently fetched data when the network is unavailable
    5. workspace: ./project-snapshot
    6. acceptance:
    7. - build command exits successfully
    8. - all unit tests pass
    9. - list page still displays cached data when the network is unavailable
    10. budget:
    11. max_wall_time_minutes: 120
    12. max_cost_units: 50

    3. Four Core Metrics and How They Are Calculated

    Evaluation results usually center on four metrics. Each metric answers a different question and needs to be understood separately.

    3.1 Pass Rate

    Pass rate is the proportion of tasks that meet all acceptance conditions. It is calculated as:

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

    Pass rate can only answer “success or failure”; it cannot reflect the degree of failure.

    3.2 Average Completion

    Split each task into several subgoals, calculate the weighted proportion achieved, and then average across all tasks. If a feature has five acceptance points and four are implemented, the task’s completion is 80%. Completion can distinguish between “almost succeeded” and “barely done,” which is more useful for judging improvement directions.

    Completion = sum of weights of achieved subgoals / sum of weights of all subgoals

    The pseudocode below shows the unified calculation logic for the four metrics:

    1. def task_completion(subgoals):
    2. total = sum(g.weight for g in subgoals)
    3. achieved = sum(g.weight for g in subgoals if g.passed)
    4. return achieved / total
    5. def benchmark_scores(results):
    6. pass_rate = sum(r.all_passed for r in results) / len(results)
    7. avg_completion = sum(task_completion(r.subgoals) for r in results) / len(results)
    8. avg_time = sum(r.wall_time for r in results) / len(results)
    9. avg_cost = sum(r.cost for r in results) / len(results)
    10. return pass_rate, avg_completion, avg_time, avg_cost

    3.3 Average Time

    Average time refers to the wall-clock time from task dispatch to the final result, including all stages such as model inference, tool calls, compilation, and test waiting. When comparing time, note that the compute capacity of the runtime environment, network latency, and queue concurrency all affect the numbers, so comparisons should be made on the same hardware and under similar load.

    3.4 Cost per Run

    Cost per run refers to the sum of compute resources and service fees generated in one complete evaluation, usually amortized per task. Cost is highly correlated with time, because longer runtime usually means more inference calls.

    4. Interpreting the Combination of “High Completion, Long Runtime”

    On the same benchmark, some solutions have a higher pass rate but a long average runtime, while others have a short runtime but lower completion. These two results reflect different engineering trade-offs, not a simple distinction between good and bad.

    Long runtime usually comes from the following mechanisms:

    • Multi-round self-checking: After generating code, the agent compiles and runs tests, finds errors, and returns to the modification step. The more loops, the longer the runtime.
    • Thorough exploration: Before making changes, it reads more relevant files and understands module dependencies, thereby reducing omissions.
    • Context management: When handling large projects, information needs to be retrieved and summarized in segments, which adds reasoning steps.

    These mechanisms improve the completeness of results at the cost of waiting time and call cost. Short-runtime solutions usually use fewer validation rounds. They are suitable for tasks with clear goals and a small change scope, but are more likely to miss dependencies or introduce regression issues during cross-module changes.

    Dimension Completeness-oriented approaches Speed-and-cost-oriented approaches
    Typical runtime Longer Shorter
    Per-task cost Higher Lower
    Cross-module tasks More stable results More likely to miss items
    Suitable scenarios Offline batch migration, critical module refactoring Small features, high-frequency iteration, limited budget

    5. Choosing by Scenario

    Selection should be based on task shape, not only on leaderboard rankings.

    • Batch migration: This can run at night or in the background, so long runtime is not an obstacle. Prioritize solutions with high completion.
    • Interactive small requirements: Developers interact frequently in the editor, and response time directly affects efficiency. Prioritize speed.
    • Teams with fixed budgets: Compare “cost per passed task,” which is approximately average cost per run divided by pass rate. This value better reflects cost-effectiveness than cost per run alone, because failed runs also consume resources.

    For example, between two solutions with the same cost per run, the one with the higher pass rate has a lower actual cost per passed task. This should be included in the selection calculation.

    6. Building an Internal Evaluation Process

    Public benchmarks can only provide reference and cannot replace testing against your own codebase. Teams can build a private evaluation set with the following steps.

    1. Extract real tasks from historical requirements, cover the four scenarios mentioned in the previous section, and write automated acceptance scripts for each task.
    2. Use a clean project snapshot for each run to avoid cache or historical state affecting results.
    3. Fix the model version, tool configuration, and timeout thresholds, and record complete run logs.
    4. Repeat the same task multiple times and report the mean and variance. A single result can be highly random, so judging based on only one run is unreliable.
    5. Manually review passed results to check for gaming behavior such as bypassing tests or hardcoding expected outputs.

    The core loop of an evaluation framework can be written as follows:

    1. for task in task_set:
    2. for trial in range(N):
    3. workspace = fresh_copy(task.snapshot)
    4. result = run_agent(task.description, workspace, timeout=task.budget.time)
    5. result.passed = run_acceptance(task.acceptance, workspace)
    6. result.cost = meter(result)
    7. log(task.id, trial, result)
    8. report = aggregate(log)

    7. Common Pitfalls

    • Looking only at pass rate. Two solutions with the same pass rate may differ greatly in completion, runtime, and cost. A single metric cannot support a selection conclusion.
    • Ignoring result variance. Agent outputs are random. When single-run results are unstable, conclusions need support from multiple trials.
    • Treating benchmark scores as a production guarantee. There is a gap between benchmark tasks and real business code. A complete testing and review process is still required before code is merged.
    • Ignoring rework cost. If fast-generated code requires extensive modification, the actual end-to-end time may be longer instead.