Evaluating Mobile Coding Agents on Long-Horizon Tasks: A Metrics and Selection Guide

    Evaluating coding agents for mobile development is shifting from single-file completion toward long-horizon tasks, where pass rate alone can be misleading. This guide walks through a five-step evaluation approach: building a realistic task suite, running agents in isolated environments, applying deterministic graders, measuring stability with pass^k, and modeling cost to build a capability-versus-cost selection matrix. It explains the four core metrics (pass rate, completion, duration, cost), how to read them together, why mobile projects fail in distinctive ways, and how to turn evaluation into a continuous CI-integrated pipeline with layered quality gates and human-in-the-loop boundaries.

    1. Key Takeaways: Five Steps to Evaluate Long-Horizon Coding Agents

    Evaluation of coding agents in mobile development is shifting from single-file completion to long-horizon tasks. A long-horizon task typically involves requirement understanding, code navigation, multi-file edits, build verification, and regression checks, and it may take anywhere from several hours to tens of hours to finish. For engineering teams, evaluation should not rely on a single run or a single ranking. It should be a reproducible, comparable, and repeatable engineering practice. The recommended approach has five steps:

    1. Build a realistic task suite: draw tasks from the requirement backlog, the defect tracker, and code review feedback, and attach automated acceptance criteria to each one.
    2. Design an isolated execution environment: use a dedicated container or virtual machine, and restrict network and filesystem access.
    3. Implement a deterministic grader: a task counts as successful only when static checks, build, functional tests, and regression tests all pass.
    4. Add a stability metric: run the same task k times and observe whether it passes every time.
    5. Establish a cost model and selection matrix: make decisions based on pass rate, stable pass rate, duration, cost, and compliance risk.

    Note: this article does not cite specific leaderboard names, and all figures shown are illustrative, used only to explain metric relationships and the engineering method.

    2. How to Evaluate Long-Horizon Coding Tasks

    2.1 Why Single-File Completion Is Not Enough

    Traditional code completion tasks have clear inputs and short context. Running the unit tests usually takes a few minutes to produce a result. Long-horizon tasks are different. They involve at least four stages: understanding and decomposing the requirement, navigating the codebase, coordinating edits across multiple files, and closing the loop on build and verification. A mistake at any stage can make the final artifact unusable. Errors also accumulate along a loop of “plan → implement → verify → re-plan”. For that reason, “can it complete a single function?” is not a meaningful evaluation criterion.

    2.2 Four Characteristics of Mobile Development

    Native mobile projects raise the difficulty further.

    • Strict toolchains. Compilation, resource packaging, and signing are tightly chained. One error in a manifest file or a resource configuration can break the build.
    • Complex context. Multi-language code, build scripts, configuration files, and resources all live in the same project.
    • Interactive features. An app must manage its lifecycle and adapt to different screens, and many defects only surface in an emulator or on a real device.
    • Strict code review. Permission declarations, privacy compliance, and resource reference conventions usually have explicit constraints.

    Evaluating mobile coding agents therefore cannot stop at “does the code compile?”. A reasonable standard is: build succeeds, functional tests pass, and no new regressions are introduced.

    2.3 Common Failure Modes in Mobile Projects and How to Diagnose Them

    Failure type Typical symptoms Diagnosis
    Build failure Missing dependencies, version conflicts, incorrect resource references, manifest misconfiguration Inspect the build log, dependency lock files, resource table, and manifest configuration
    Permission and compliance failure New sensitive permissions added without justification, missing privacy disclosures, non-compliant resource references Check against the permission list, privacy guidelines, and static scan rules
    Regression failure Fixing one issue breaks existing functionality Run the full regression suite and diff the failure set against the baseline
    Interaction and lifecycle failure Crash on startup, incorrect state restoration, broken behavior on rotation Execute key user paths in an emulator or on a real device
    Inconsistent multi-file edits Interface signatures, call sites, and configuration not kept in sync Perform cross-file reference analysis and use compile errors to narrow down the location

    3. How to Choose and Read the Four Core Metrics

    3.1 Task Pass Rate: Can It Actually Ship?

    Task pass rate is the number of tasks completed and accepted divided by the total number of tasks. Judgement is usually binary: a task counts as successful only if it passes completely, with no partial credit. The advantage is that it is close to a real delivery standard; the drawback is that it is insensitive to the process. Under pass rate, a task that finishes ninety percent of the work but stalls on the last step looks the same as one that went off track from the very beginning.

    3.2 Average Task Completion: How Far Off Is It?

    Average task completion measures how far a run is from the target. A more robust approach weights the acceptance points rather than taking a plain average. It can be defined as:

    Task completion = Σ(acceptance point score × weight) / Σ(weights)
    Average task completion = Σ(weighted completion score per task) / total number of tasks

    Two common signals emerge. Low completion together with a low pass rate indicates a lack of basic planning and execution ability. High completion with a comparatively low pass rate indicates the model often falls short in “the last mile”, for example missing tests, insufficient handling of edge cases, or regressions introduced by the fix itself. The latter is more practically relevant to engineering teams, because a result that is nearly deliverable can be finished with a small amount of manual work.

    3.3 Average Task Duration: Is It Fast Enough for a Pipeline?

    Long-horizon task duration is usually measured in hours. Duration does not directly indicate model quality, but it determines how often evaluation can be run. If one full regression round takes several days, evaluation is hard to integrate into day-to-day iteration and becomes a quarterly health check at best.

    3.4 Average Cost: Can It Scale?

    Cost is driven mainly by input and output token counts, the number of tool calls, and model service pricing. Mobile development requires repeatedly reading large chunks of code, so longer context means higher cost. Model selection cannot be based on capability alone; the capability-to-cost relationship matters too. Some lightweight models may be cheaper but fall short on pass rate and stability, while high-capability models may perform better at a higher cost. The decision has to account for the value of the tasks involved.

    3.5 How the Four Metrics Relate

    Raising the pass rate usually means a longer exploration process, more tool calls, and higher cost. Evaluating a model should therefore not rest on a single pass rate figure, but on overall performance under an equivalent resource budget: did the pass rate improve, did duration shrink, is cost still under control, and are failures reproducible and diagnosable?

    4. Does Doubling the Pass Rate Mean It Can Run Unattended?

    Consider a set of illustrative figures. Suppose one version raised the pass rate from roughly 12% to roughly 24%, cut the average duration of a single round from roughly 66.2 hours to roughly 27.4 hours, and reduced the average cost from roughly 418 USD to roughly 317 USD. These numbers are illustrative only and do not refer to any specific model.

    The data illustrates at least three things.

    First, the capability gain may come from efficiency rather than simply spending more resources. If the pass rate had been improved only through a longer reasoning chain or more trial and error, duration and cost should have risen along with it. The illustrative data shows all three improving at once.

    Second, the overall efficiency gain can exceed the doubling of the pass rate. This can be captured by “effective deliverables per unit time”:

    Effective deliverables per unit time ≈ task pass rate ÷ average duration per round

    In the illustrative data, the previous generation comes to roughly 0.18 and the new version to roughly 0.88, close to a fourfold increase. Put plainly, what previously might have taken multiple rounds and hundreds of hours to produce one passing task now has a much shorter feedback cycle.

    Third, lower cost makes full regression feasible. Once cost and duration drop into an acceptable range, teams can move from “try a few tasks” to “run the complete task suite on every iteration”.

    It must be stressed, however, that a higher pass rate does not mean unattended operation is possible. Even at an illustrative 24% pass rate, roughly three quarters of tasks still require human intervention. Coding agents are better suited as high-throughput executors than as the final decision maker.

    5. Building an Evaluation System From Scratch

    5.1 How Should the Task Suite Be Constructed?

    Task suite quality determines how much the evaluation can be trusted. Five principles are recommended:

    1. Derived from real requirements. Prefer extracting tasks from the requirement backlog, the defect tracker, and code review comments rather than inventing toy tasks.
    2. Acceptance that is objective and automatable. Every task needs acceptance scripts such as a build command, test cases, and static check rules.
    3. Tiered difficulty. Split tasks into three levels: single-module changes, cross-module feature development, and architecture-level refactoring.
    4. Isolated and reproducible. Each task runs in its own environment with pinned external dependencies, so results are consistent across machines and over time.
    5. Data compliance. Task descriptions and code must not contain sensitive information, and core business code should be redacted before use.

    5.2 What to Watch Out for in the Isolated Environment

    Long-horizon tasks may run for tens of hours, so environment isolation is both a security requirement and a precondition for reproducibility. Assign each task its own container or virtual machine, preinstall the build toolchain and dependency cache, and limit the network and filesystem scope it can reach. Recycle the environment uniformly after each run to prevent cross-task contamination.

    On security, three more things are needed: redact code snapshots so sensitive information does not end up in logs; apply least privilege to network and filesystem access so only resources required by the task are reachable; and record cost, tool calls, and execution traces for auditing and troubleshooting.

    5.3 How to Keep the Grader Objective

    The grader should be fully deterministic and must not rely on subjective scoring. A practical flow:

    1. Static checks: formatting, naming, permission declarations, and other project conventions.
    2. Build: whether the project builds completely in the target environment.
    3. Functional tests: whether the unit tests and UI tests for the target feature pass.
    4. Regression tests: whether existing tests still pass, avoiding “fix one, break three”.

    The task is marked successful only when all four steps pass. Otherwise, the failing step is recorded for later analysis.

    The following illustrative code shows the executor design. The interfaces in the code are simplified placeholders and can be replaced with the team’s own model invocation and sandbox components.

    1. import time
    2. def grade(workspace, task):
    3. """Run static checks, build, functional tests, and regression tests in order."""
    4. checks = [
    5. ("lint", run_lint, workspace),
    6. ("build", run_build, workspace),
    7. ("feature_test", task.run_feature_tests, workspace),
    8. ("regression_test", run_regression_suite, workspace),
    9. ]
    10. results, passed = {}, True
    11. for name, func, target in checks:
    12. ok, detail = func(target)
    13. results[name] = {"passed": ok, "detail": detail}
    14. passed = passed and ok
    15. # Completion is weighted by the task's acceptance points; weights are illustrative
    16. # here and can be defined per task in practice.
    17. weights = getattr(task, "weights", {name: 1.0 for name, _, _ in checks})
    18. total_weight = sum(weights[name] for name in results)
    19. completion = sum(
    20. weights[name] * (1.0 if results[name]["passed"] else 0.0)
    21. for name in results
    22. ) / total_weight if total_weight else 0.0
    23. return {"passed": passed, "completion": completion, "checks": results}
    24. def evaluate(task, agent, max_turns=100, time_limit_seconds=72 * 3600):
    25. """Execute a single long-horizon task in an isolated environment.
    26. time_limit_seconds can be configured per task size; the 72-hour default is illustrative.
    27. """
    28. started = time.monotonic()
    29. workspace = create_sandbox(task.repo_snapshot, task.dependencies)
    30. trace, tokens_in, tokens_out, tool_calls = [], 0, 0, 0
    31. try:
    32. workspace.write_file("TASK.md", task.description)
    33. workspace.checkout(task.base_commit)
    34. for turn in range(1, max_turns + 1):
    35. if time.monotonic() - started > time_limit_seconds:
    36. break
    37. message = agent.chat(workspace.read_context())
    38. tokens_in += message.input_tokens
    39. tokens_out += message.output_tokens
    40. trace.append({"turn": turn, "action": message.action})
    41. if message.action.type == "submit":
    42. break
    43. tool_result = workspace.execute(message.action)
    44. tool_calls += 1
    45. trace.append({
    46. "turn": turn,
    47. "tool": message.action.type,
    48. "status": tool_result.status,
    49. "summary": tool_result.summary,
    50. })
    51. report = grade(workspace, task)
    52. return {
    53. "task_id": task.id,
    54. "passed": report["passed"],
    55. "completion": report["completion"],
    56. "duration_seconds": round(time.monotonic() - started, 1),
    57. "tokens_in": tokens_in,
    58. "tokens_out": tokens_out,
    59. "tool_calls": tool_calls,
    60. "checks": report["checks"],
    61. }
    62. finally:
    63. workspace.destroy()

    In a real deployment, the task suite should run concurrently, with cost estimation and result archiving built in alongside it. The point is not the code details but that the grading rules are stable, inputs and outputs are traceable, and metrics can be recomputed.

    5.4 How to Measure Stability

    A single run is subject to chance. The same task run five times may pass three times and fail twice. Drawing conclusions from one run makes misjudgement easy. The recommendation is to run each task k times and compute:

    Task stable pass rate = number of tasks that passed all k runs / total number of tasks

    Here, pass^k means the same task passes all k consecutive or repeated runs. It is stricter than “passes at least once”. pass@1 usually means passing at least once out of the attempts, which suits evaluating exploratory capability, while pass^k is more appropriate for measuring production readiness. For critical business modules, only tasks that pass stably should be considered eligible for fully autonomous work by an agent.

    5.5 How to Design the Cost Model and Selection Matrix

    On top of the evaluation data, a capability-versus-cost selection matrix can be built. A typical strategy:

    Task tier Typical characteristics Suggested strategy
    Basic tasks Small single-module changes, well-defined rules Prefer low-cost, fast models and run them in batches
    Advanced tasks Cross-module feature development Use models that balance capability and cost, with human spot checks
    Challenging tasks Architecture-level refactoring, complex defect localization Use the model with the highest pass rate and keep human review

    A selection checklist can be added on top to avoid looking at a single metric:

    Evaluation item Focus Recommendation
    Task pass rate Whether acceptance criteria can be met Use as the baseline threshold
    Stable pass rate Reliability across repeated runs Always required for critical tasks
    Average duration Suitability for day-to-day iteration Determines the feedback cycle
    Average cost Whether it can scale Determines whether full regression is feasible
    Compliance risk Data, permissions, privacy High-risk tasks require human review
    Toolchain compatibility Support for build, tests, emulators Affects usability in mobile projects

    6. Continuous Evaluation and Common Pitfalls

    A leaderboard is a static snapshot, while engineering evolves continuously. To make evaluation part of everyday development, it needs to be wired into the CI pipeline.

    First, set tiered quality gates. Code submitted by an agent should go through the same checks as traditional code: reject the merge if static checks fail, roll back if the build fails, and route to a human if functional tests fall short of the target. Agent output should not get a special channel.

    Second, establish a baseline comparison mechanism. After every model change, prompt change, or tool configuration change, run a regression on a fixed task suite and compare pass rate, completion, duration, and cost. A new configuration may only go live if none of the overall metrics regress.

    Third, build a failure case library. Archive the execution traces, failing steps, and manual fixes for failed tasks. This is useful both for improving prompts and tooling and for expanding the task suite, so that models cannot simply “memorize the exam”.

    Fourth, plan compute and scheduling sensibly. Long-horizon evaluation is a batch workload: high volume, long-running, and parallelizable. It is well suited to an elastic container platform with a task queue for scheduling. Runs can be concentrated during idle periods and yield to production traffic during peak hours. Evaluation data, execution traces, and build artifacts can be archived to object storage, and core metrics can be visualized through log monitoring. Enterprises can assemble such a platform from general-purpose cloud infrastructure plus container, storage, and logging components.

    Fifth, keep the human-agent boundary clear. Agents can still fail on long-horizon tasks today. A sensible division of labour: give agents repetitive, rule-based, automatically verifiable work such as template code generation, filling in test cases, and initial defect localization; keep architecture decisions, requirement clarification, and security and compliance judgements with people.

    7. Conclusion

    Evaluation of mobile coding agents is moving from “writing one correct line of code” to “completing a task independently”. Pass rate, completion, duration, and cost together form the coordinate system for measuring long-horizon coding ability. What matters more to an engineering team than a single ranking is building its own evaluation capability: constructing a task suite from real work, using isolated environments to guarantee reproducibility, using deterministic graders to produce conclusions, using stability metrics to measure reliability, and using a cost model to guide selection. Only when evaluation is consolidated into a continuously running engineering pipeline can AI-assisted coding turn from an occasional impressive demo into reliable, sustained productivity.