Evaluating AI Coding Capabilities in Mobile App Development: Methods and Practices

    Mobile app development imposes strict engineering constraints that general code generation benchmarks often fail to capture. This article explores how to design evaluation tasks from real-world engineering scenarios, fix runtime environments to reduce noise, calculate four core evaluation metrics, understand the relationships between these metrics, and provides practical recommendations for teams adopting AI coding assistants.

    Mobile app development is a scenario with strict engineering constraints. User interfaces must adapt to various screen sizes, app lifecycles are affected by system scheduling, and permission models and background execution rules frequently change. These characteristics make it difficult for general code generation benchmarks to directly reflect the performance of AI coding assistants in real projects. A runnable code snippet may not pass permission checks, dependency upgrades, or UI adaptation. Therefore, when evaluating AI coding capabilities, evaluation tasks must be brought back to the engineering frontline.

    1. Evaluation Tasks Should Originate from Real Engineering Scenarios

    An effective evaluation set should cover typical activities in development work, commonly including three categories:

    • Creating an app from scratch: Provide requirements and ask for a buildable project skeleton, including pages, navigation, and a basic data layer.
    • Incremental feature development: Add new modules to an existing codebase, such as integrating a login flow, adding list pagination, or implementing local caching.
    • Code migration and transformation: Migrate legacy state management patterns to new ones, or convert one UI description method to another.

    Each task should have clear input materials, quantifiable acceptance criteria, and automated tests. If acceptance relies on subjective human judgment, the results are hard to reproduce. It is recommended to version control the task description, initial repository snapshot, and test scripts together, ensuring the same task can be re-executed at different times.

    1. Fix Runtime Environments to Reduce Noise

    Fluctuations in evaluation results often come from the environment rather than the model itself. Dependency versions, build toolchains, emulator images, and network conditions all affect results. In practice, you should:

    • Lock dependency versions and record a complete environment manifest in the evaluation report.
    • Run each task in a clean container or a newly created working directory to avoid residual cache from previous runs.
    • Set timeout and retry limits for steps requiring internet access, and record the number of retries.

    Additionally, run the same task multiple times. Generative model outputs have randomness, and a single run cannot represent stable capabilities. After multiple runs, you can analyze the distribution of pass rates rather than looking at a single number.

    1. Four Core Metrics and Their Calculations

    An evaluation report typically includes four metrics: pass rate, average completion rate, average duration, and cost per run, each answering a different question.

    1. Pass Rate: The proportion of tasks that pass all acceptance tests out of the total number of tasks. Calculated by dividing the number of passed tasks by the total number of tasks. It answers: “Can it deliver usable results?”
    2. Average Completion Rate: For each task, calculate the proportion of passed test cases, then take the average. It answers: “How far is it from a usable result?” Tasks that fail can still receive a score, making the evaluation more granular.
    3. Average Duration: The time from task assignment to the production of buildable code. The report should specify whether it includes human intervention time and queue waiting time.
    4. Cost Per Run: Calculated based on the actual billed units and unit price. The cost scope needs to be unified, for example, whether it includes the cost of failed retries and tool calls.

    These four metrics must be used in combination. Looking only at the pass rate cannot determine the cost; looking only at cost ignores quality differences.

    1. Understanding the Relationships Between Metrics

    The gap between completion rate and pass rate can be telling. A high completion rate with a low pass rate usually indicates that the generated result is generally correct but fails on edge cases, exception branches, or version compatibility. These issues are suitable for fixing through additional test cases and human review.

    Cost per pass is a useful derived metric, calculated as total cost divided by the number of passed tasks. When two solutions have different pass rates and prices, comparing them using cost per pass more directly reflects cost-effectiveness.

    1. from dataclasses import dataclass
    2. @dataclass
    3. class TaskResult:
    4. passed: bool # Whether all acceptance tests passed
    5. completion: float # Proportion of passed test cases, ranging from 0 to 1
    6. duration_h: float # Duration in hours
    7. cost: float # Cost per run, consistent with the billing scope
    8. def summarize(results: list[TaskResult]) -> dict:
    9. n = len(results)
    10. passed = sum(r.passed for r in results)
    11. total_cost = sum(r.cost for r in results)
    12. return {
    13. "pass_rate": passed / n,
    14. "avg_completion": sum(r.completion for r in results) / n,
    15. "avg_duration_h": sum(r.duration_h for r in results) / n,
    16. "total_cost": total_cost,
    17. "cost_per_pass": total_cost / passed if passed else None,
    18. }

    The function above reads the execution records of each task and outputs summary metrics. When the number of passed tasks is zero, cost per pass returns null to avoid division by zero errors.

    1. Factors to Note When Interpreting Results

    Evaluation results are influenced by multiple factors, which should be checked item by item during interpretation:

    • Agent framework: The same model may perform very differently under different tool call orchestration, context management, and auto-repair strategies. Reports should specify the framework and version, and comparisons should try to keep the framework consistent.
    • Task distribution: If tasks are concentrated on UI generation, the conclusions cannot be directly extrapolated to the network layer, local storage, or background tasks. Teams should construct task sets according to the module proportions of their own business.
    • Level of human intervention: Fully automated completion and completion after human correction belong to different scopes, and their data cannot be mixed for comparison.
    • Data timeliness: Models and dependency libraries update frequently, so conclusions have a shelf life. Regular re-runs are recommended.
    1. Practical Recommendations for Teams

    When introducing AI coding tools, teams can proceed with the following steps.

    Step 1: Clarify priorities. If the goal is to quickly complete a large batch of repetitive migrations, unit duration and cost are more important; if used for core business modules, pass rate and code quality should be prioritized.

    Step 2: Establish an evaluation baseline. Select twenty to fifty historical tasks representing the team’s business, fix the test scripts, and use them as a benchmark for subsequent comparisons. The baseline needs to be maintained synchronously with the business codebase.

    Step 3: Integrate continuous evaluation into the development workflow to ensure that AI coding tools consistently meet engineering standards as the codebase evolves.