Evaluating Mobile AI Coding: How to Measure True Delivery Capabilities

    As AI-assisted coding evolves from simple code completion to complex task-level delivery, evaluating its real-world capability has become crucial for mobile developers. This article explores how to define task boundaries, establish a core metric system (pass rate, completion, duration, and cost), and build a reproducible evaluation process. It also highlights common pitfalls in interpreting results and offers practical recommendations for integrating AI coding evaluation into R&D workflows.

    1. Background: From “Writing Code” to “Delivering Code”

    AI-assisted programming has evolved from basic code completion and snippet generation to task-level capabilities, where models can understand requirements, modify multiple files, run tests, and fix errors. For mobile application developers, this shift introduces new evaluation challenges. A piece of code that looks correct does not necessarily mean it can pass compilation and UI tests, nor does it guarantee stable operation across different devices and OS versions.

    Consequently, the industry increasingly replaces subjective code quality scoring with “task pass rate.” A task typically involves providing a clear requirement description, an initial code repository, and a set of acceptance tests. The model must complete the modifications within a limited number of steps to ensure all tests pass. This approach is closer to real-world R&D scenarios, and the results are easier to reproduce.

    2. Evaluation Targets and Task Boundaries

    Before evaluation, three factors must be clearly defined:

    1. Task Source: Tasks should be derived from real application scenarios, such as list view modifications, local data caching, permission request flow fixes, and network exception handling. Relying solely on simple exercises makes it difficult to extrapolate conclusions to actual projects.
    2. Task Granularity: There is a significant difference between single-function modifications and cross-module, multi-iteration tasks. Long tasks better reflect the engineering capability of agentic coding, though they consume more time and cost.
    3. Environment Constraints: Simulator or physical device versions, dependency library versions, and build tool versions must be fixed. When environments are inconsistent, the same model’s results may vary drastically, and such differences are often misinterpreted as model capability differences.

    An evaluation report should explicitly state these three factors; otherwise, readers cannot judge the applicability of the results.

    3. Core Metric System

    3.1 Task Pass Rate

    Pass rate refers to the proportion of tasks that pass all acceptance tests out of the total number of tasks.

    Pass Rate = Passed Tasks / Total Tasks × 100%

    Pass rate is highly sensitive to the difficulty distribution of tasks. If the question bank contains a high proportion of simple tasks, the pass rate will be artificially inflated. It is recommended to report by difficulty tiers, such as Easy, Medium, and Hard, and calculate statistics separately.

    3.2 Average Task Completion

    Pass rate is a binary metric and cannot distinguish between “almost passed” and “completely off track.” Completion can be calculated based on the sub-cases of acceptance tests—that is, the ratio of passed sub-cases to the total sub-cases for a specific task, averaged across all tasks. It shows the model’s performance when partially correct and helps pinpoint issues.

    3.3 Duration

    Duration should be measured at two levels. The first is end-to-end time, including model inference, tool calls, building, and test execution. The second is the model’s own inference time. The two differ significantly; build time is often determined by the engineering environment and is unrelated to the model. Reports should record them separately or at least clarify the statistical scope.

    3.4 Cost

    Cost typically consists of the billed token count for input and output, the number of tool calls, and the resource consumption of the running environment. Different platforms have varying billing units and discount rules. When comparing costs, they must be unified into the same pricing method, and the exchange rate and statistical date must be noted.

    3.5 Trade-offs Between Metrics

    The four metrics often constrain each other. Improving the pass rate may require more inference rounds, thereby increasing duration and cost. A practical approach is to plot a curve of “pass rate vs. unit cost” to select the scheme with the highest pass rate within the target budget, rather than just looking at the optimal value of a single metric.

    Metric What It Measures Main Risk
    Pass Rate Whether the task is fully completed Influenced by the difficulty distribution of the task bank
    Completion Degree of partial correctness Distorted results when sub-cases are poorly designed
    Duration Delivery speed Environment build time can interfere with results
    Cost Economic investment Inconsistent pricing standards

    4. Building a Reproducible Evaluation Process

    Reproducibility is the prerequisite for trustworthy evaluation results. It is recommended to follow these steps:

    1. Fix Versions: Lock the commit hash of the code repository, dependency versions, build tool versions, and simulator images.
    2. Isolated Execution: Execute each task in an independent container or sandbox to prevent state residue from previous runs affecting subsequent ones.
    3. Multiple Sampling: Run the same task multiple times and report the mean and range of fluctuation. The randomness of a single result can be significant.
    4. Unified Acceptance: Use the same set of acceptance scripts for all candidate schemes; do not modify test cases based on the performance of the scheme being tested.
    5. Log the Process: Save the input, output, tool calls, and error logs for each round to facilitate post-mortem analysis of failures.

    The following sample code demonstrates how to aggregate the running results of a single scheme across multiple tasks. It only illustrates the statistical logic; an actual runner would also need to implement task scheduling and environment isolation.

    1. from dataclasses import dataclass
    2. from statistics import mean, stdev
    3. @dataclass
    4. class RunResult:
    5. task_id: str
    6. passed: bool # Whether all acceptance tests passed
    7. passed_cases: int # Number of passed sub-cases
    8. total_cases: int # Total number of sub-cases
    9. wall_seconds: float # End-to-end duration (seconds)
    10. cost_usd: float # Cost of this run (unified to USD)
    11. def summarize(results: list[RunResult]) -> dict:
    12. """Aggregate the running results of a single scheme across multiple tasks."""
    13. if not results:
    14. raise ValueError("The results list is empty")
    15. valid = [r for r in results if r.total_cases > 0] # Skip invalid tasks to avoid division by zero
    16. pass_rate = sum(r.passed for r in results) / len(results)
    17. completion = mean(r.passed_cases / r.total_cases for r in valid)
    18. durations = [r.wall_seconds for r in results]
    19. return {
    20. "pass_rate_pct": round(pass_rate * 100, 1),
    21. "avg_completion_pct": round(completion * 100, 1),
    22. "avg_seconds": round(mean(durations), 1),
    23. "std_seconds": round(stdev(durations), 1) if len(durations) > 1 else 0.0,
    24. "avg_cost_usd": round(mean(r.cost_usd for r in results), 2),
    25. }

    In the code, all costs are unified to USD for easy cross-scheme comparison. If the original data uses other currencies, it should be converted using the exchange rate of a unified date before database entry, and noted in the report.

    5. Common Pitfalls in Interpreting Results

    5.1 Relying on a Single Ranking

    Ranking high does not mean optimal in all scenarios. Evaluation leaderboards typically only cover a specific set of tasks. Readers should first review the task composition to judge its relevance to their own business scenarios.

    5.2 Ignoring Sample Size

    If the number of tasks is only a dozen, the difference of passing one task can cause fluctuations of several percentage points. Reports should provide the sample size and reduce randomness by increasing the number of tasks or repeated runs.

    5.3 Training Data Contamination

    If the original code or test cases of the evaluation tasks have already appeared in public data, the model might be memorizing the answers rather than genuinely solving the problems. Mitigations include using unpublished private task sets and regularly rotating the question bank.

    5.4 Confusing Model Capability with Toolchain Capability

    The same model paired with different tool-calling frameworks or context management strategies may yield significantly different results. When comparing models, fix the toolchain; when comparing toolchains, fix the model.

    6. Recommendations for R&D Teams

    1. Build an Internal Task Library: Extract tasks from the team’s past real-world requirements and bug tickets, attaching acceptance tests to each task. Internal task libraries are closer to the team’s actual work than public question banks.
    2. Start with a Small-Scale Pilot: Select one or two low-risk modules to observe the adoption rate and rework rate of the scheme in real merge requests.
    3. Incorporate Manual Review into Metrics: Passing automated tests does not mean the code is maintainable. Record the number of code review comments, rollback times, and production defects.
    4. Set Dual Thresholds for Quality and Cost: For example, specify an upper limit on the cost per task while requiring the pass rate to meet a baseline. The scheme only enters the production workflow if both conditions are met.
    5. Regularly Re-evaluate: Model versions, dependency libraries, and OS versions all change. Evaluation results should be updated on a fixed cycle rather than drawing a one-time conclusion.

    7. Conclusion

    Evaluating mobile AI coding capabilities centers on transforming “looks usable” into “verifiable, reproducible, and comparable.” Pass rate, completion, duration, and cost each have their own focus. Only by using them in combination and clarifying the statistical scope can evaluation results support reliable technical decision-making.