Evaluating AI Coding Tools for Mobile Development: Metrics and Trade-offs

    This article explores how to evaluate AI coding tools for mobile development through engineering tasks rather than simple algorithm tests. It covers typical task categories, four core metrics (pass rate, average completion, average time, and cost per run), trade-offs between these metrics, a decision framework for team selection, and practical guidelines for implementing benchmarks.

    I. Why Engineering Task-Based Evaluation is Needed

    General code generation tests usually ask a model to solve an algorithm problem and check if the output matches the standard answer. While these tests demonstrate a model’s basic coding ability, they hardly reflect its performance in real-world projects. Building an app from scratch, adding features, migrating legacy code, and adapting to new platforms all involve multiple files, dependencies, build configurations, and runtime environments.

    Characteristics of engineering task evaluation include:

    • Tasks span multiple files and modules, requiring an understanding of project structure.
    • Results must pass building, running, and functional acceptance rather than just checking if a code snippet is syntactically correct.
    • Tasks often require multi-round reasoning, tool calls, and error corrections, taking significantly longer than a single Q&A session.
    • Costs grow with call frequency and context length, so they must be measured alongside effectiveness.

    Mobile app development is a typical scenario for such evaluation. UI layout, page lifecycle, permission requests, local storage, network requests, and app signing carry strong platform conventions. A model can only produce compilable and runnable results if it understands these conventions.

    II. Types of Evaluation Tasks

    A reasonable engineering evaluation task set generally covers the following categories:

    1. App Creation: Generate a project skeleton based on requirement descriptions, including directory structure, basic pages, and dependency declarations.
    2. Feature Development: Add new features to an existing project, such as list pagination, form validation, or offline caching.
    3. Code Migration: Rewrite old version APIs or legacy syntax code to new APIs while maintaining original behavior.
    4. App Conversion: Rewrite an app from one tech stack to another, retaining core business logic.
    5. Bug Fixing: Locate issues and modify code based on error logs or reproduction steps.

    How tasks are described also affects results. Some tasks only provide natural language requirements, while others include design drafts or API documentation. The closer the description is to a real-world ticket, the better the evaluation reflects actual usage.

    Below is an example of a task definition showing what information an evaluation task typically records:

    1. task = {
    2. "id": "feature-offline-cache-001",
    3. "category": "Feature Development",
    4. "description": "Add offline caching to the list page to display the most recently successfully loaded data when the network is unavailable",
    5. "repo_snapshot": "commit-abc123", # Fixed code version to ensure reproducibility
    6. "acceptance": [
    7. "Project can be built successfully",
    8. "List page still displays cached data when offline",
    9. "Data refreshes automatically when network is restored",
    10. "All existing unit tests pass",
    11. ],
    12. "time_limit_minutes": 180,
    13. }

    The acceptance criteria in the task definition determine the strictness of the evaluation. The more detailed the criteria, the easier it is to distinguish between “basically done” and “truly usable”.

    III. Meaning of the Four Core Metrics

    3.1 Pass Rate

    Pass rate refers to the proportion of tasks that fully meet all acceptance criteria out of the total tasks, calculated as:

    Pass Rate = Passed Tasks / Total Tasks

    This is the strictest metric. If even one acceptance criterion fails, the task is marked as failed. Therefore, the pass rate best reflects whether the result can be directly delivered.

    3.2 Average Completion

    Average completion measures the proportion of achieved acceptance criteria in each task, then averages all tasks:

    Single Task Completion = Met Criteria / Total Criteria

    Average Completion = Sum of Single Task Completions / Total Tasks

    Completion reflects “how much was done”. A task might implement 70% of the features but fail at the build stage. This result scores high on completion but zero on pass rate.

    3.3 Average Time

    Average time refers to the wall-clock time used to complete a single task. It includes model inference time, tool call time, build and test waiting time, and retry time after failures. A longer time does not necessarily mean low efficiency; it may indicate that the model performed more checks and corrections. Whether the time is reasonable should be evaluated alongside the pass rate.

    3.4 Cost Per Run

    Cost per run refers to the expense of completing an entire evaluation round. In most pricing models, costs correlate with text volume (input/output), call frequency, and context length. Specific pricing rules are subject to the provider’s documentation. Evaluation reports should record the currency and exchange rate to facilitate cross-region comparisons.

    IV. Trade-offs Between Metrics

    None of the four metrics can draw a conclusion on their own; they must be analyzed together. Common combinations include:

    High completion, low pass rate. This indicates the tool can complete most steps but makes mistakes at critical nodes, such as improper handling of boundary conditions, missing dependencies in build scripts, or missing permission declarations. For prototype development, such results are already valuable; for features that need to go live, significant manual remediation is required.

    High pass rate, long time. Such tools usually do more planning, checking, and retrying. The result quality is better, but team waiting time increases, and more review resources are occupied. If tasks can be executed in batches in the background, the impact of time decreases; if developers wait for results, time becomes the primary cost.

    Short time, low cost, average pass rate. This tool is suitable for large-scale, low-risk work, such as generating boilerplate code or batch replacing old APIs. Its output needs to be gated by automated tests and code reviews.

    To put cost and effectiveness on the same scale, you can calculate the “average cost per passed task”. It answers: how much does the team pay for a deliverable result?

    1. from dataclasses import dataclass
    2. @dataclass
    3. class BenchmarkRun:
    4. name: str
    5. tasks_total: int # Total number of tasks
    6. tasks_passed: int # Number of passed tasks
    7. avg_completion: float # Average completion, ranging from 0 to 1
    8. avg_hours_per_task: float # Average time per task in hours
    9. cost_per_run: float # Cost for a full evaluation round
    10. def pass_rate(run: BenchmarkRun) -> float:
    11. return run.tasks_passed / run.tasks_total if run.tasks_total else 0.0
    12. def cost_per_passed_task(run: BenchmarkRun) -> float:
    13. """Average cost per passed task; returns infinity for sorting if no tasks passed."""
    14. if run.tasks_passed == 0:
    15. return float("inf")
    16. return run.cost_per_run / run.tasks_passed
    17. def passed_per_hour(run: BenchmarkRun) -> float:
    18. """Assumes serial execution; returns the number of passed tasks per hour."""
    19. total_hours = run.avg_hours_per_task * run.tasks_total
    20. return run.tasks_passed / total_hours if total_hours > 0 else 0.0

    These functions only use existing fields in the evaluation results without any external assumptions. In practice, fill in the real evaluation data into the corresponding fields, then sort based on the dimensions the team cares about.

    V. Decision Framework for Team Selection

    When selecting a coding tool, it is recommended to follow this order:

    1. Set a quality baseline first. Determine the minimum acceptable pass rate based on business risk. For user-facing features, the baseline should be high; for internal tools or prototypes, it can be relaxed.
    2. Filter out unqualified solutions. Solutions below the baseline pass rate are directly excluded and do not participate in cost comparison.
    3. Compare economics. Among the remaining solutions, compare the average cost per passed task and the output per unit time.
    4. Consider hidden costs last. This includes manual review time, rework probability, team learning curve, and data security compliance requirements.

    Priority metrics vary significantly across different scenarios:

    Scenario Priority Metrics Reason
    Live core features Pass rate, rework rate Errors directly affect users; quality first
    Internal tools & prototypes Time, unit cost Minor rework allowed; speed is more important
    Large-scale code migration Cost per passed task Large number of tasks amplifies unit price differences
    Exploratory development Average completion Need to see the overall feasibility of the solution

    Note that metrics are derived from specific task sets. If the task set differs significantly from the team’s real business, the reference value of the conclusion decreases.

    VI. Practical Points for Implementing Evaluation

    If a team wants to build its own evaluation process, consider the following practices:

    • Fix versions. Record code snapshots, build tool versions, dependency versions, and evaluation dates. Results without version information cannot be reproduced.
    • Run multiple times for statistical values. The same task may yield different results across multiple runs. Report the mean and range of variation to avoid drawing conclusions from a single run.
    • Isolate environments. Run each test in a clean container or temporary directory to prevent previous caches from affecting results.
    • Combine automated acceptance with manual sampling. Automated tests can determine if features meet criteria, but cannot judge code readability and architectural rationality. Manual sampling is a necessary supplement.
    • Protect sensitive information. Task descriptions and code should not contain keys, certificates, or user data. Materials like signing certificates should be provided via environment variables or key management services, not hardcoded in the repository.
    • Limit permissions. Run the tool in a restricted working directory without granting access to production environments or release channels. Generated code must be reviewed before merging.

    Evaluation results should also be re-run periodically. Tool version updates, task set expansions, or dependency upgrades can change conclusions, so evaluation should be a continuous process rather than a one-time task.

    1. Organize the team’s recent real development tasks and convert them into an evaluation task set with acceptance criteria.
    2. Fix the code version for each task and record the runtime environment.
    3. Execute multiple evaluations for each candidate tool, recording pass rate, completion, time, and cost.
    4. Filter and compare according to the steps in Section V.
    5. Validate conclusions in a small-scale pilot, confirm whether the rework rate and review cost meet expectations, and then decide whether to expand the scope of use.