Testing New-Generation Models: Generating GUI Tools with Zero Runtime Errors
This article examines how to evaluate AI coding models using a batch audio extraction GUI tool as a practical test case. It explains why GUI applications expose engineering weaknesses that command-line scripts hide, how to structure prompts with functional requirements, constraints, and checkable acceptance criteria, and how to enforce asynchronous execution with thread-safe progress updates. It also provides an eight-point robustness checklist, a follow-up questioning template for code review, and a reusable acceptance workflow to help developers move generated code from "looks correct" to "runs, ships, and stays maintainable."
Introduction: The Gap Between “Generates Code” and “Actually Runs”
Using large language models to write code is no longer a novelty. But when you move that code into a production workflow, developers rarely care about whether it can produce something that looks like valid code. They care about three much more practical questions: does it run on the first try, are edge cases handled, and does it hold up in terms of performance and interaction? A desktop utility generation exercise with clear acceptance criteria exposes all three very quickly. This article uses a “batch audio extraction tool” as the case study and abstracts a reusable evaluation and prompting methodology from it. It does not reference any specific product and focuses only on general engineering experience.
1. Why GUI Tools Are a Good Stress Test
Command-line scripts leave a lot of room for error: a wrong path can be fixed by changing an argument, and exceptions can be read directly from the stack trace. Graphical interfaces are different. They amplify three categories of risk at the same time.
The first is thread model risk. If a time-consuming task runs on the main thread, the event loop is blocked, the window immediately stops responding, and the application appears to freeze. This is the most common pitfall for generated solutions, because the code is completely valid at the syntax level and static checks cannot detect it.
The second is state consistency risk. The file list, dropdown options, progress, and status text are spread across multiple controls. If any one of them updates at the wrong time, the interface falls out of sync with the actual task.
The third is resource and path risk. Output directories, same-name overwrites, and missing external dependencies are all problems that “never show up during a demo but always show up after delivery.”
For this reason, testing with a small but complete GUI tool reflects a model’s real engineering understanding far better than solving ten algorithm problems.
2. Requirements Design: Writing Acceptance Criteria into the Prompt
A vague prompt only produces vague code. The effective approach is to break requirements into three parts: functional items, constraint items, and acceptance items.
Example functional items:
- Accept input in common video container formats and output a selectable mainstream audio format;
- Provide a file import list and an input/output format settings area;
- Provide complete operations for import, start conversion, and exit;
- Show progress during conversion and display a summary when it finishes.
Example constraint items:
- Fix the language and GUI framework to prevent the model from freely introducing extra dependencies;
- Cover both the single-file and batch paths;
- Move all time-consuming logic off the main thread.
Example acceptance items (the critical part):
- The interface stays interactive during conversion;
- A single file failure does not interrupt the whole batch;
- Missing external dependencies produce a clear message instead of a stack trace;
- Duplicate output names are automatically avoided rather than silently overwritten.
A sample prompt structure can be written as:
Role: Senior desktop application developerGoal: Implement a batch audio/video-to-audio toolTech stack: Python + standard library GUI framework + external transcoding CLI dependencyFeatures: See list AConstraints: Time-consuming tasks must be asynchronous; failure isolation; configurable pathsAcceptance: List checkable acceptance points one by oneOutput: Complete runnable code + dependency notes + usage instructions
Turning acceptance points into a checkable list is the cheapest and most effective way to improve the first-pass success rate.
3. Async and Progress: The Right Way to Avoid Freezing
“Does not freeze” is not an adjective; it is a clear architectural constraint. The general approach has three layers.
The first layer is pushing tasks down. Wrap “traverse directories, transcode one by one, aggregate results” into an independent task, hand it to a background thread through a queue, and let the main thread handle only scheduling and refreshing.
The second layer is one-way communication. The background does not directly manipulate interface controls. Instead, it posts messages in a thread-safe way, and the main thread consumes them uniformly and updates progress and status text. A sketch:
import queueimport threadingmsg_q = queue.Queue()def worker(tasks):total = len(tasks)for i, t in enumerate(tasks, 1):ok = convert(t) # time-consuming work runs in the backgroundmsg_q.put(("progress", i, total))msg_q.put(("log", f"{t} -> {'ok' if ok else 'failed'}"))msg_q.put(("done", None, None))def start(tasks):threading.Thread(target=worker, args=(tasks,), daemon=True).start()def pump():while not msg_q.empty():kind, a, b = msg_q.get()if kind == "progress":bar.set(a / b); status.set(f"{a}/{b}")elif kind == "log":log.append(a)elif kind == "done":status.set("All done")root.after(80, pump) # poll on a timer to avoid blocking
The third layer is throttled refreshing. Driving redraws directly from high-frequency progress updates creates a new kind of freezing. Refreshing in batches at a fixed interval is the most reliable compromise in practice.
4. Robustness Checklist: “Demo-Ready” vs. “Delivery-Ready”
The gap between generated code and deliverable code lies almost entirely in the exception paths. It is worth fixing the following eight checks:
- Friendly messages for empty input, a nonexistent directory, or no permission;
- A single file failure is isolated and logged without terminating the batch;
- The external transcoding dependency is probed before launch, with installation guidance when it is missing;
- Duplicate output names automatically get a sequence number appended to avoid silent overwrites;
- Escaping and handling of long paths and special characters;
- Repeated clicks on Start are blocked while a task is running, preventing stacked concurrency;
- Background tasks are terminated and temporary files are cleaned up on exit;
- The final output reports three counts: success, failure, and skipped.
Among these eight, items 3, 4, and 6 are the ones most often overlooked by generated solutions and the ones that most affect the real experience.
5. Follow-Up Verification: Turning the Conversation into Code Review
One generation pass is not the end. A high-quality practice is to treat follow-up questions as a review step, using specific questions to pin down implementation details, for example: where the default output directory is, whether it is configurable, whether failed files are retried, whether progress is measured per file or by percentage, and whether a batch task can be canceled midway.
The value of these questions is that they force the implementation to move from “looks right” to “can be explained clearly.” If the model can answer accurately and point to the corresponding code location, it has genuinely maintained context consistency. If the answers are vague, ask it to produce the relevant snippet again with acceptance notes.
Recommended follow-up template:
Please answer: Where is the default output directory? How do I change it?How are failed files handled? Is a log recorded?What is the progress granularity? How is cancellation supported?Point to the corresponding code lines or function names.
6. A Reusable Acceptance Workflow
Turning the above into a fixed process can significantly reduce rework:
- Requirements stage: produce a three-part list of features, constraints, and acceptance criteria;
- Generation stage: require complete code plus dependency notes and run steps;
- Static stage: syntax and import checks to confirm no missing dependencies;
- Run stage: four test groups covering empty input, single file, batch, and an abnormal file;
- Interaction stage: drag the window during conversion, click repeatedly, exit midway;
- Review stage: check the implementation location against the follow-up question list item by item.
Conclusion
The most effective measure of a model’s coding ability is not generation speed but how it performs on three lines: runnable, deliverable, and maintainable. Putting acceptance criteria up front, writing the asynchronous architecture into the constraints, listing the exception paths as a checklist, and treating follow-up questions as review — this method applies to any AI coding tool and to everyday human-AI collaborative development. For developers, the real payoff is not writing a few fewer lines of code but shifting attention from boilerplate implementation to architectural judgment and quality control, which is exactly where the most durable efficiency gains come from.
