From Requirements to Evidence: A Practical Workflow for AI-Assisted Programming
Clear explanations and fast code generation do not by themselves make AI-assisted programming reliable. This article describes a general practice that separates requirement analysis, engineering design, empirical verification, and result communication, then uses logs, tests, simulations, and reproducible checks—not writing style—to decide whether a change should ship. It applies the approach to mobile spatial-measurement tools and tower-defense balance work, and outlines analyst, implementer, and reviewer roles plus a four-part delivery report.
1. The key to AI-assisted programming is an evidence loop, not fluent answers
On real projects, developers often see two conflicting outcomes. A clear, well-structured recommendation may not improve the metric that matters. A harder-to-read analysis may, by running the program, reproducing the issue, and checking boundary conditions, find the defect that actually affects the business.
That means AI-assisted programming should not be judged only by how easy an answer is to understand or how quickly code is generated. A more useful method is to split the work into independent stages:
- Requirement understanding: identify the outcome the user actually wants to change.
- Engineering design: decide the scope of change, the implementation approach, and the compatibility strategy.
- Empirical verification: check assumptions with logs, tests, simulations, and real runs.
- Result communication: turn technical findings into decisions that can be executed and accepted.
These stages need different skills. Being good at clarifying requirements does not mean being able to locate a runtime defect. Finding a problem does not mean being able to explain its impact on the user.
This article does not compare the performance of any particular AI programming system. It discusses a general practice: treat requirements analysis, implementation, and verification as roles that constrain one another, and let engineering evidence—not language style—decide whether a proposal holds.
2. Agree on the task before optimizing the wrong problem
2.1 Move from a technical wish to a business metric
Take a mobile spatial-measurement tool as an example. A user can capture a room with a depth-capable mobile device, generate 2D or 3D drawings, add dimensions, attach photos, and export a report.
When a developer says “make whole-house output faster,” that sentence can mean at least three different things:
- Shorten computation after capture ends.
- Shorten the time from the start of capture to an editable drawing.
- Shorten the total time from arriving on site to a deliverable report.
Each points to a different optimization. The first is mainly computation and data processing. The second also involves the capture flow, state changes, and interaction waits. The third must include annotation, photo organization, validation, and export.
Without a clear metric, an AI programming tool can easily treat “the overall process is slow” as “the underlying algorithm is slow,” and then propose many complex changes with limited payoff.
2.2 Break end-to-end time into observable stages
A practical time model is:
Total completion time = capture time + user operation time + stage wait time + post-processing time + validation and export time
This formula is a way to organize time spent. It does not mean every stage is strictly sequential. When work runs in parallel, analyze the critical path instead of simply adding the durations.
If logs show that post-processing is only a small share of total time, cutting it in half may barely change the experience. Reducing repeated confirmations, avoiding unnecessary page switches, or showing an editable result earlier may help more.
Two ideas should stay separate:
- Actual completion time: the time until all required work is finished.
- Perceived wait time: the time during which the user cannot continue and can only wait.
Showing a result early can reduce perceived waiting. It does not justify claiming that the whole task is done. Validation and final export still need explicit status.
2.3 Add constraints that optimization must not break
Speed is not the only target. Constraints should be listed at the same time:
- Do not lower existing recognition quality.
- Do not break the relationship between dimensions and walls.
- Do not lose photos or manual user edits.
- Do not change unconfirmed trial or access boundaries.
- Do not produce a report that looks complete from incomplete data.
- After interruption, failure, or retry, recover to a consistent state.
These constraints decide which proposals can be implemented directly and which need product confirmation.
3. Tool-style apps: verify process changes and engineering changes separately
3.1 Find redundant waits in the flow first
In spatial-measurement apps, the problem is not always inside the geometry algorithm. It may be in how the flow is orchestrated.
For example, the system may require a full model before the user can add photos, even though photo capture may not depend on the final geometry. If a stable object identifier can store a temporary association, and binding happens after the structure is confirmed, some work can start earlier.
A smoother interface is not enough. The change must also answer:
- When a temporary object is merged or deleted, how does associated data move?
- If the user leaves the page, does the unfinished task still exist?
- If background processing fails, does the foreground still show success?
- Which version of the data does report export use?
Moving work earlier and running tasks in parallel usually makes state management harder. Without version identifiers, explicit state transitions, and failure compensation, a performance change can become a consistency problem.
3.2 Replace overall guesses with stage instrumentation
Record start, end, result, and a related task identifier for key stages, for example:
task identifierstage namestart timeend timeexecution resultinput sizefailure reason
When measuring intervals, prefer a monotonic clock suited to duration, so system-clock adjustments do not distort the result. For photos, spatial data, and user information, logs should keep only the metadata needed to locate the problem, not raw sensitive content by default.
When reading logs, do not look only at the average. Also check the median, tail latency, and the failure distribution. Average time can fall while a few complex floor plans still stall often enough to hurt the experience.
Test samples should cover different input sizes, structural complexity, lighting, and device conditions. One simple scene is not enough to call an optimization effective.
3.3 Keep engineering changes small, reversible, and comparable
Without changing underlying recognition, check first whether:
- The same data is parsed or converted more than once.
- Nonessential work runs on the critical UI path.
- Refreshes or redraws are repeated with no effect.
- Nonessential previews can be generated later.
- Intermediate results can be reused safely.
- A bad retry policy piles up tasks.
Each change should test one main hypothesis. If repeated conversion is the suspect, measure conversion count and time, then remove the duplication. Do not change caching, thread allocation, and layout at the same time.
Otherwise, even if the result improves, it is hard to say why. If a regression appears, it is harder to find the responsible change.
4. Games: balance depends on the real rules
4.1 Numerical analysis should not stop at formulas
Combat outcomes in a tower-defense game depend on many factors together:
- Attack interval and damage resolution.
- Target selection and range checks.
- Enemy movement and path changes.
- Area damage and status effects.
- Resource gain, upgrade cost, and build timing.
- Wave structure and win/loss conditions.
Unit damage or theoretical output alone often cannot show whether a strategy is too strong. A unit with ordinary paper efficiency may dominate because its attacks cover the field reliably. A unit with high theoretical damage may underperform because of target switching and wasted attacks.
Balance checks should reuse the actual game rules rather than a separate, oversimplified calculator.
If a standalone simulator is necessary, first check that it matches real execution: event order, random behavior, collision or range checks, and how resources are settled.
4.2 Run count does not replace experiment design
A large number of simulations can look convincing. Their value depends on the design, not only on how many times they run.
A sound test plan should at least specify:
- Goal: validate one unit’s strength, or the overall difficulty curve?
- Strategy set: cover different build, upgrade, and resource choices.
- Randomness control: record seeds so unusual results can be reproduced.
- Comparison conditions: use the same scenarios and random inputs before and after the change.
- Metrics: besides win rate, record remaining resources, clear time, and where failures occur.
- Stopping rule: do not stop only when a favorable result appears.
For simulations that include randomness, report uncertainty. With too few samples, a small win-rate gap should not be treated as a confirmed balance change.
Scripted strategies are not real players. Simulation is useful for screening obvious anomalies. It cannot fully replace playtesting, especially for whether a strategy is understandable, how heavy the controls feel, and how frustrating failure is.
4.3 Separate balance checks from rendering checks
A logic simulation can assess combat results. It usually cannot prove that the picture is smooth. A simulation that does not run the real graphics pipeline does not cover drawing, effects, textures, UI updates, or device temperature.
Use two verification paths:
- Logic verification: rule consistency, strategy payoff, and win/loss distribution.
- Runtime performance verification: frame time, resource use, and long-run stability in the real rendering environment.
Performance analysis should include worst cases: many enemies at once, stacked area effects, frequent object create and destroy, and complex UI updates during combat.
Do not report only average frame rate. Occasional long frames are often more noticeable than a modest drop in the average, and they deserve priority.
5. Build an analyze–implement–review collaboration chain
5.1 The analysis role defines the problem
Input to the analyst should include the business goal, the current flow, known logs, constraints that must not change, and acceptance criteria.
The output should not be only a list of suggestions. It should at least include:
- The problem hypothesis.
- Existing evidence that supports it.
- Facts that are still unconfirmed.
- Candidate options and their risks.
- Observations that still need to be collected.
“Not enough information” is an acceptable conclusion at this stage. Stating which data is missing is more valuable than a complete plan built on guesses.
5.2 The implementation role makes the smallest verifiable change
The implementer should receive a confirmed scope, not a vague request to “optimize the whole project.”
Each change should state which modules it touches, which behavior stays the same, how to test it, and how to roll it back. Changes to async work and state management also need tests for failure paths.
AI programming tools can help produce patches and tests. Generated code does not mean the task is done. At minimum, run static checks, the relevant tests, and any real execution that is necessary.
5.3 The review role looks for counterexamples
Review is not about whether a proposal “looks reasonable.” It is about actively finding conditions that make it fail.
For example:
- What happens if the user switches pages while processing is underway?
- What happens with empty, duplicate, or partially corrupt input?
- What happens if two tasks update the same object at once?
- Can an optimized cache read stale data?
- Does the best-looking strategy in simulation exploit a rules hole?
To reduce shared blind spots from the same assumptions, the reviewer can inspect the original requirements and code before reading the implementation conclusions. That only raises the chance of finding different issues. It does not guarantee an independent review.
The final opinion must land on reproducible steps, test results, or a specific code path.
6. Treat readability as a delivery requirement
Hard-to-read analysis is not a sign of higher technical level. A smooth answer is not a sign that the conclusion is reliable.
Use a four-part report:
- Conclusion: whether to proceed, and the main reason.
- Evidence: what logs, tests, or code paths support.
- Risk: which conditions are still uncovered, and which behavior they might break.
- Action: what to change, verify, and accept next.
Tests that have not been run must be labeled “recommended to verify.” They must not be written as “already proven.” Estimated gains must state their assumptions. They must not be packaged as measured results.
Tool calls, task scheduling, and experiment runs need limits. When source code, user photos, spatial data, or production resources are involved, use least privilege, data minimization, and a controlled environment. Being able to run many tasks does not mean resources should be used without limit, or that production systems should be changed automatically.
7. Judge collaboration by results that can be accepted
Whether AI-assisted programming improves efficiency can be judged on four points:
- Result quality: functional correctness, regression count, and boundary coverage.
- Time cost: total time from the request to accepted delivery.
- Verification quality: whether issues can be reproduced and whether conclusions are supported by evidence.
- Communication cost: how many clarification rounds a developer needs before the plan can be executed.
Include compute, human review, and failed rework in the cost. Do not count only the time spent generating code.
For a mobile measurement tool, the end check is whether users finish a reliable delivery faster, not whether one function runs faster. For a game, the end check is whether the rules are more stable and the experience more reasonable, not how many simulation runs finished.
AI-assisted programming works when it leaves a traceable chain: the business goal is understood correctly, technical assumptions are verified, code changes can be explained, abnormal results can be reproduced, and the final benefit can be accepted. Connecting those stages is what moves assistance from “making suggestions” to “reliable delivery.”
