Trade-off Analysis of AI Programming Agents in Mobile Development Benchmarks

    This article explores the shift in evaluating AI programming agents from simple code generation to complete mobile app delivery. It analyzes four core metrics—pass rate, average completion, average wall-clock time, and cost per run—and examines the engineering trade-offs between them. Additionally, it provides a practical framework for teams to select the right agent configuration, including pseudocode for metric calculation and a discussion on the limitations of benchmark results.

    1. Background: Evaluating AI Agents from “Writing Code” to “Delivering Apps”

    Early evaluations of AI programming capabilities primarily focused on function-level code completion and algorithmic problems, judging success by whether a single snippet of code passed unit tests. Mobile application development, however, presents an entirely different task profile. A deliverable app typically involves multiple layers: UI layout, state management, network requests, local storage, permission handling, and build configurations, all of which share numerous dependencies. Therefore, evaluation frameworks must treat complete tasks as units to observe whether an agent can achieve end-to-end delivery under real engineering constraints.

    Such benchmarks usually cover several typical tasks: creating a new project from scratch, developing new features in an existing project, migrating legacy code to a new language version or framework, and converting one app format to another. Each category demands different capabilities. Creating projects tests understanding of engineering structures, feature development tests the ability to read and modify existing code, and migration/conversion tests the grasp of interface changes and compatibility.

    2. Four Core Metrics and Their Definitions

    Pass Rate

    Pass rate refers to the proportion of all benchmark tasks where the final output meets the acceptance criteria. These criteria usually include successful compilation, passing automated tests, and passing key functional use cases. Pass rate is a hard metric for determining if a product “works,” but being a binary outcome, it cannot reflect how close the failed tasks were to the target.

    Average Completion

    Completion measures the proportion of accepted items satisfied within each task. For example, if a task has ten checkpoints and the agent satisfies eight, the completion is 80%. Average completion compensates for the coarse granularity of the pass rate. Two configurations with the same pass rate may have vastly different completion rates, indicating a significant difference in their performance on failed tasks.

    Average Wall-Clock Time

    Wall-clock time refers to the time elapsed from task initiation to output generation, encompassing model inference, tool calls, compilation runs, and self-correction loops. This time directly impacts the waiting cost for developers, which is crucial for teams requiring rapid iteration. It is also influenced by concurrency strategies, tool call latency, and retry mechanisms; the same configuration may yield very different times across different execution environments.

    Cost per Run

    Cost is the total billing consumed to complete a full benchmark run, typically comprising input/output token counts, number of calls, and tool usage fees. Combining cost with the pass rate allows estimation of the average expense per successful task:

    Cost per success = Total benchmark cost ÷ (Total number of tasks × Pass rate)

    This formula assumes the task set is identical across runs and that failed task costs are still included in the total. It reveals a frequently overlooked fact: a configuration with a low cost per run might actually result in a higher cost per success if its pass rate is too low.

    3. Engineering Trade-offs Between Metrics

    The four metrics constrain one another; evaluating any single metric in isolation leads to one-sided conclusions.

    High Completion vs. Long Duration

    High average completion combined with long durations typically indicates that the agent tends to repeatedly check and refine details, ultimately covering more acceptance checkpoints. In scenarios with clear requirements and high error costs, this effort has practical value. However, if the goal is to quickly prototype, prolonged waiting slows the iteration pace. Teams must assess whether the extra time translates into tangible quality improvements.

    Pass Rate vs. Cost

    Achieving a higher pass rate often requires longer context, more correction rounds, and stronger inference configurations, all of which drive up costs. Conversely, low-cost configurations may prematurely abandon many tasks, manifesting as low completion rates. When selecting a solution, the primary metric for comparison should be the “cost per successful task” rather than just looking at the total bill.

    Speed vs. Reliability

    Fast and cost-effective configurations are suitable for high-frequency, small-granularity tasks, such as scaffolding boilerplate code, generating unit tests, or fixing specific compilation errors. For cross-module architectural changes, the pass rate holds more reference value. A single team can configure different solutions based on task types rather than seeking a single “optimal” solution.

    Consistency of Evaluation Criteria

    When comparing different agents, it is essential to verify that the execution framework, tool permissions, retry counts, timeout settings, and prompt templates are consistent. Differences in the execution framework itself can sometimes outweigh differences in the underlying models. With varying frameworks, the resulting numbers only reflect how a specific combination performs on a particular task set and cannot be directly attributed to model capability.

    4. Team-Oriented Selection Framework

    Selection can be advanced through the following steps:

    1. Define Task Profiles: Analyze development tasks from the past three months and categorize them by type (new creation, feature, migration, fix) and scale (single file, single module, cross-module).
    2. Set Constraints: Determine the maximum acceptable waiting time, monthly budget limit, and minimum quality threshold (e.g., pass rate must not fall below a certain value).
    3. Build a Small Internal Benchmark Set: Extract twenty to thirty tasks from real historical tasks and write automatable acceptance use cases.
    4. Run Candidates Under Uniform Conditions: Execute under the same framework and parameters, recording the four metrics.
    5. Compare and Analyze: First filter out substandard solutions using the pass rate, then compare the cost per success and duration among the qualified solutions.
    6. Small-Scale Pilot: Run in real projects for two to four weeks, collecting manual rework rates and subjective developer feedback.

    The core of this workflow is filtering first, optimizing later. The pass rate is the threshold metric; only candidate solutions that meet the threshold are worth comparing in terms of cost and speed.

    5. Practice: Writing Metric Calculation Functions

    The following pseudocode demonstrates how to calculate the four metrics from run records. This structure is independent of any specific tool and fields can be adjusted according to the team’s data format.

    1. Data structure RunRecord:
    2. task_id Task ID
    3. passed Whether passed (Boolean)
    4. completion Completion rate, 0.0 to 1.0
    5. duration_s Wall-clock time in seconds
    6. cost Billing amount for this task
    7. Function summarize(records):
    8. If records is empty, throw an error and terminate
    9. total = total number of records
    10. successes = number of records where passed is true
    11. pass_rate = successes / total
    12. total_cost = sum of cost for all records
    13. return {
    14. pass_rate: rounded to three decimal places,
    15. avg_completion: arithmetic mean of completion, rounded to three decimal places,
    16. avg_duration_h: mean of duration_s divided by 3600, rounded to two decimal places,
    17. cost_per_success: total_cost / successes if successes > 0, otherwise null
    18. }

    Two points to note when using this:
    First, the same batch of tasks should be run repeatedly under the same configuration, capturing the mean and fluctuation range of multiple runs to avoid mistaking randomness for capability differences.
    Second, complete run configurations—including framework version, timeout, and retry count—should be saved in the records for post-hoc reproduction and auditing.

    6. Limitations of Benchmark Results

    • Task Representativeness: If benchmark tasks differ significantly from the team’s actual work, the reference value of the results is limited.
    • Data Contamination Risk: Public tasks may have entered the training data, leading to inflated scores that do not reflect true capabilities.
    • Randomness: Results from multiple runs of the same configuration may vary. The fluctuation range should be reported rather than just a single data point.
    • Insufficient Sample Size: Pass rate statistics from twenty or thirty tasks have large margins of error; a difference of a few percentage points is insufficient to support a conclusion.
    • Changes in Billing Rules: Prices and billing methods will adjust over time. Cost data should be annotated with the date when cited.

    7. Implementation Recommendations

    • Use the pass rate as an admission threshold, and use cost per success and duration as ranking criteria.
    • Set different configurations for different task types; avoid using a single set of parameters to cover all scenarios.
    • Save original run records for every evaluation so conclusions can be reviewed and easily re-evaluated when models or prices change.
    • Evaluation results are only valid on the team’s own task set; external benchmark numbers should serve as a reference, not the sole basis for decisions.