Evaluating AI Coding for Mobile Development: How to Read Pass Rate, Time, and Cost

    This article explains how to evaluate AI-assisted coding tools in mobile app development scenarios. It defines four core metrics—task pass rate, average task completion, per-run duration, and cost per success—highlights common mistakes when reading public leaderboards, and provides a practical four-step evaluation workflow with a Python example for aggregating metrics, plus selection advice for engineering teams. The sample data in the article is fictional and for demonstration only.

    1. Why Mobile Development Deserves Separate Attention

    Mobile app development has characteristics that general backend development does not. There is heavy interaction between the UI and the operating system: permission requests, background task restrictions, and compatibility across screen sizes and OS versions all need to be handled. Code that compiles does not necessarily run correctly on a real device. Therefore, when evaluating AI-assisted coding capability, looking only at the quality of generated text is far from enough—results must be verified in an environment close to real development.

    For engineering teams, an evaluation needs to answer three questions: Can the model independently complete part of the development work? How much manual correction is needed afterward? Is the overall cost worthwhile? These three questions map to the pass rate, completion, and cost metrics discussed below.

    2. The Meaning of Four Core Metrics

    2.1 Task Pass Rate

    Task pass rate is the proportion of tasks in a set whose final results satisfy all verification conditions. Verification conditions typically include successful compilation, passing unit tests, and key UI flows running end to end. Pass rate is the most intuitive metric, but it is binary—it cannot reflect cases that were “almost passing.”

    2.2 Average Task Completion

    Completion complements pass rate. A task can be broken into checkpoints, such as whether dependency configuration is correct, whether the data model is complete, and whether page navigation matches the requirements. Completion is calculated as the proportion of checkpoints passed, and it shows where the model went wrong. Two systems with identical pass rates can differ greatly in completion.

    2.3 Per-Run Duration

    Per-run duration is the time from receiving a task to producing a verifiable result, including model generation, tool calls, compilation, and test execution. For long-running tasks, duration is also affected by build speed and retry counts. Recording the time of each stage is therefore more useful than logging only the total elapsed time.

    2.4 Cost per Success

    Cost includes model invocation fees, compute resource fees, and retry overhead after failures. When calculating cost, use cost per success rather than cost per call:

    Cost per success = Total cost ÷ Number of successful tasks

    A solution that is cheap per call but has a low pass rate may end up more expensive than a higher-priced option once cost is normalized by successful tasks.

    3. Common Mistakes When Reading Leaderboards

    1. Looking only at rankings. Rankings are determined by a specific task set. The difficulty distribution, the development domains covered, and the evaluation environment all affect results. Change the task set and the ranking may be completely different.
    2. Ignoring sample size. With a small number of tasks, a few percentage points of difference may just be random variation. Confirm the sample size is sufficient to support a conclusion before comparing.
    3. Ignoring versions and environments. Model versions, system images, and dependency versions all affect results. When comparing two sets of data, verify the runtime environments are identical.
    4. Treating benchmark pass rate as production readiness. Benchmark tasks are usually curated with clear requirement descriptions. Real requirements are often vague and heavily constrained, so the actual usable rate is typically lower than benchmark numbers.
    5. Overlooking manual correction costs. Even code that passes tests may have maintainability issues, security risks, or styles that violate team conventions, all of which require human review.

    4. Building Your Own Evaluation Pipeline

    The evaluation pipeline can be divided into four steps: define the task set, execute generation, run automated verification, and aggregate metrics. The example below shows the core logic of the aggregation step. The sample data is fictional and only demonstrates the calculation method; it does not represent any actual measurement results.

    1. from dataclasses import dataclass
    2. @dataclass
    3. class TaskRecord:
    4. task_id: str
    5. passed: bool
    6. completion: float # Checkpoint completion ratio, from 0.0 to 1.0
    7. duration_hours: float # Per-run duration, in hours
    8. cost: float # Total per-run cost, including retry overhead
    9. def summarize(records: list[TaskRecord]) -> dict:
    10. total = len(records)
    11. if total == 0:
    12. raise ValueError("Evaluation records are empty")
    13. passed_count = sum(1 for r in records if r.passed)
    14. total_cost = sum(r.cost for r in records)
    15. return {
    16. "pass_rate": passed_count / total,
    17. "avg_completion": sum(r.completion for r in records) / total,
    18. "avg_duration_hours": sum(r.duration_hours for r in records) / total,
    19. "cost_per_success": total_cost / passed_count if passed_count else float("inf"),
    20. }
    21. if __name__ == "__main__":
    22. demo = [
    23. TaskRecord("t-001", True, 1.0, 3.5, 12.0),
    24. TaskRecord("t-002", False, 0.6, 8.0, 40.0),
    25. TaskRecord("t-003", True, 0.9, 5.2, 18.0),
    26. ]
    27. print(summarize(demo))

    Key points for each step:

    • Define the task set: Rewrite tasks based on real requirements, covering common scenarios such as UI layout, local data storage, network requests, and permission handling. Every task category must have clear verification criteria.
    • Execute generation: Fix the model version, prompt templates, runtime environment, and timeout. Run each task multiple times and use statistical values to reduce the impact of incidental results.
    • Automated verification: Verify in three layers—compilation, unit tests, and UI automation tests, in that order. Prefer repeatable automated checks, with manual inspection as a supplement.
    • Aggregate and analyze: Compute the four metrics using the approach above, keep all failed cases, and categorize them by cause—for example, dependency configuration errors, improper async state handling, or missing permission declarations.

    5. Practical Advice for Team Tool Selection

    • Clarify the goal first. If the goal is to improve day-to-day coding efficiency, focus on completion and the amount of manual correction. If the goal is batch-generating boilerplate code, focus on pass rate and cost per success. Different goals call for different metric weights.
    • Re-test with your own task set. Public leaderboards are useful as a reference, but your team’s real requirements determine which capabilities matter most.
    • Look at all four metrics together. Focusing only on pass rate may hide cost; focusing only on cost may hide rework time after failures.
    • Build a failure case library. Failure causes usually concentrate in a few categories. Addressing them with better prompt templates, coding standards, or sample code is often more effective than switching models.
    • Define boundaries for human review. Code involving account authentication, payment flows, and user privacy data must be manually reviewed before merging.