Long-Horizon Task Benchmarking for Mobile App Development Agents: Metrics, Task Design, and Cost-Aware Routing
This article presents a practical framework for evaluating AI agents on long-horizon mobile app development tasks. It defines four core metrics—pass rate, completion, latency, and cost—and explains how to design stratified, reproducible task sets, interpret results, and build an evaluation pipeline. It also discusses risk-based routing between high-capability and lightweight configurations to balance success rate, speed, and effective cost.
1. Why Long-Horizon Task Benchmarks Matter
Mobile app development tasks rarely end with “generate a snippet of code.” They typically span requirement understanding, code localization, cross-file modification, build validation, automated testing, and regression checks. Single-turn code generation metrics only show local capability. They cannot answer the questions engineering teams actually care about: Can an agent complete a multi-step task independently? How far does it get? How long does it take? How many resources does it consume? Are its failure modes controllable?
The value of long-horizon task evaluation is that it breaks “usability” into observable dimensions. An agent that performs well on short tasks may still fail on engineering tasks with complex dependencies and long feedback loops. Conversely, a configuration with a lower pass rate may still be useful in low-cost, low-latency scenarios. Evaluation should therefore provide multi-dimensional metrics, task distributions, and failure categories rather than a single ranking, so teams can choose configurations by scenario.
2. A Four-Dimensional Metric System: Pass Rate, Completion, Latency, and Cost
A practical evaluation system should include at least the following four types of metrics.
Pass rate: Based on automated acceptance, a task passes only when all acceptance cases pass, including a successful build, target tests passing, no regression test degradation, and no new severe static analysis issues. Pass rate should distinguish between “strict pass” and “partial pass” to avoid counting artifacts that run but do not meet requirements as successes.
Completion: This measures how fully a task is satisfied. It can combine functional coverage, test coverage, build success rate, code change scope, and manual review results. High completion with a low pass rate usually means the agent is close to the goal but has critical defects. A high pass rate with low completion may indicate that the acceptance criteria are too narrow.
Latency: Measure end-to-end wall-clock time, including queuing, reasoning, tool calls, builds, tests, retries, and environment waiting—not just model inference time. For long-horizon tasks, also record maximum steps, timeout counts, and human intervention counts.
Cost: Use full-scope accounting that covers model calls, sandbox compute, dependency caching, storage, logs, retries, and manual review. Divide single-run cost by the number of effective tasks or successful tasks to derive “effective repair cost.” This avoids looking only at per-call price while ignoring failed retries.
3. Task Design: Stratified Sampling and Reproducible Environments
Evaluation tasks should cover typical scenarios in real development and be stratified by difficulty: small bug fixes, cross-file feature changes, dependency upgrades, build failure fixes, test supplementation, performance optimization, and edge-case handling. Each layer should have explicit acceptance scripts and an immutable file scope to prevent agents from obtaining inflated scores by bypassing tests.
Reproducibility is the baseline for benchmarking. Environment images, dependency versions, build parameters, random seeds, and test data should all be fixed. Task descriptions should include constraints, acceptance criteria, and prohibited modifications. Training data and evaluation data need to be isolated, and task sets should be rotated regularly to reduce leakage risk. Long-horizon tasks should also have maximum step counts, timeout thresholds, and resource limits so different configurations are compared under the same conditions.
4. Capability-Cost Trade-offs: Tiered Routing Beats a Single Configuration
A common pattern in evaluation is that high-capability configurations achieve higher pass rates and completion but consume significantly more time and cost. Lightweight configurations have lower pass rates but clear advantages in speed and budget. Engineering teams should not simply chase the highest pass rate. Instead, they should route tasks by value.
For example, critical paths, high-risk modules, and cross-file changes can prioritize high-capability configurations. Low-risk, highly repetitive tasks with existing test coverage can use lightweight configurations. When a lightweight configuration fails or has insufficient confidence, the task can be escalated to a high-capability configuration. This controls cost while preserving success rates for critical tasks.
The routing logic can be expressed as follows:
TASK_PROFILES = {"critical": {"max_steps": 80, "timeout_min": 240, "verify": "full"},"standard": {"max_steps": 50, "timeout_min": 120, "verify": "standard"},"light": {"max_steps": 30, "timeout_min": 60, "verify": "smoke"}}def route_task(task):if task.risk == "high" or task.cross_module:return "high_capability"if task.estimated_changes < 20 and task.has_tests:return "lightweight"return "standard"def effective_cost(total_cost, pass_rate):return total_cost / max(pass_rate, 0.000001)
“Effective repair cost” is closer to the engineering decision criterion than “single-run cost.” Teams can first calibrate pass-rate thresholds with a small sample, then gradually expand the task set to avoid excessive upfront investment.
5. Interpreting Results and Common Pitfalls
When interpreting evaluation results, pay attention to statistical significance and task distribution. With small sample sizes, differences in pass rate may be noise. When cost accounting, environment configuration, and human intervention rules differ across evaluations, horizontal comparisons can be misleading. Report means, percentiles, and failure categories rather than only a total score.
Common failure types include requirement misunderstanding, environment failure, test failure, out-of-scope modification, timeout, and resource exhaustion. Including failure types in a dashboard can guide subsequent improvements: environment failures should prioritize fixing images and dependencies; requirement misunderstandings should improve task descriptions and constraints; out-of-scope modifications should strengthen permission and change-scope controls.
6. Operationalizing the Evaluation Pipeline
A complete evaluation pipeline can be divided into task registration, environment orchestration, agent execution, automated validation, metering and statistics, and report generation. Container platforms can provide environment isolation; artifacts and logs can be stored in object storage; runtime logs can be sent to a logging service; and anomalies can be reported through monitoring and alerting. General capabilities such as the Baidu AI Cloud container platform, object storage, log service, and monitoring and alerting can be used to build a reproducible evaluation environment.
Practical recommendations include: define acceptance criteria before selecting configurations; pin environments and caching strategies; use full-scope cost accounting; route by task risk; build failure classification and regression dashboards; redact sensitive code and minimize permissions; and do not directly merge code based on automated evaluation results—keep human review as a fallback.
7. Conclusion
Benchmarking mobile app development agents should serve engineering decisions, not become a single ranking. Around the four metrics of pass rate, completion, latency, and cost—combined with stratified task design, reproducible environments, and full-scope cost accounting—teams can turn agent capability into controlled, explainable productivity. For budget-sensitive teams, lightweight configurations can serve as the first layer for high-frequency, low-risk tasks. For critical tasks, a combination of high-capability configurations and human review is more reliable. The ultimate goal is not a leaderboard score, but a sustainable evaluation and governance mechanism that supports continuous iteration.
