Testing LLM Coding Skills: A Full Walkthrough of Building a GUI Tool

    This article examines how well large language models handle real software delivery by walking through the build of a batch audio-video extraction desktop tool. It covers task selection, structured prompting, the two-thread architecture that keeps the UI responsive, easily overlooked engineering details such as recursive scanning and filename collision handling, a repeatable verification process, and how to use follow-up prompts effectively.

    1. Introduction: From Generating Code to Delivering Software

    LLM-assisted programming has moved from demos into everyday development workflows. What developers care about is no longer whether a model can output a runnable snippet, but whether it can deliver a small, complete, and directly runnable piece of software in one pass when requirements are vague and constraints are numerous.

    This article follows a representative hands-on task: building a desktop tool for batch audio-video extraction. The task looks simple, yet it concentrates nearly every typical difficulty in desktop development — multi-format compatibility, keeping the UI responsive during long-running work, error messaging, status feedback, file conflict handling, and external dependency detection. The sections below work through requirement breakdown, architecture design, key implementation, and verification methods.

    2. Task Design: Why “Batch Audio-Video Extraction”

    The choice of this task is deliberate. It has three characteristics:

    1. Requirements are enumerable but easy to miss: format support, import and export, progress display, and exception handling can each be expanded on their own.
    2. Performance-sensitive: audio-video transcoding is a classic long-running task; a poor implementation will inevitably leave the UI unresponsive.
    3. Depends on an external runtime: transcoding usually relies on system-level command-line components, which require upfront detection and graceful degradation.

    These three points map exactly to the three areas where LLM-generated code is most likely to become unstable: requirement coverage, concurrency correctness, and environment robustness.

    3. Structured Prompts: Turning “Tedious” into “Executable Constraints”

    In practice, prompt quality directly determines how controllable the generated result is. It helps to split requirements into four categories of constraints and list them one by one, avoiding the ambiguity of natural-language narration.

    • Functional constraints: support common video inputs, allow selection among mainstream audio output formats; provide a complete interaction flow with a file list, format selection, run, and exit.
    • Technical constraints: use a general-purpose high-level language and a standard GUI library, without pulling in heavy third-party frameworks.
    • Experience constraints: sensible layout, short operation paths, visible state.
    • Robustness constraints: progress feedback and a status bar are mandatory; exceptions must produce clear messages; long-running operations must not block the UI thread.

    The last one is the dividing line. Many “seemingly correct” generated solutions put the transcoding loop directly inside a UI callback, and the result is a blank window and a system “not responding” notice. Writing out “must not block the UI thread” explicitly turns implicit engineering common sense into an acceptance criterion.

    4. Key Architecture: Dividing Work Between the UI Thread and the Worker Thread

    The correct approach is a two-thread model: the UI thread handles only rendering and event dispatch, while the worker thread processes transcoding tasks serially or in parallel, with the two communicating through thread-safe queues.

    A sketch of the structure:

    1. import queue
    2. import threading
    3. task_queue = queue.Queue()
    4. message_queue = queue.Queue()
    5. def worker():
    6. while True:
    7. item = task_queue.get()
    8. if item is None:
    9. break
    10. # Call the external transcoding component and parse progress from its output
    11. progress, ok = run_convert(item)
    12. message_queue.put(("progress", progress))
    13. if not ok:
    14. message_queue.put(("error", item.name))
    15. task_queue.task_done()
    16. def poll_ui():
    17. # The UI thread periodically pulls messages and updates the progress bar and status bar
    18. while not message_queue.empty():
    19. kind, payload = message_queue.get_nowait()
    20. update_widget(kind, payload)
    21. root.after(100, poll_ui)

    The key point: the worker thread never touches UI widgets directly, and every UI update is executed back on the UI thread. This is both a technical constraint and the basic discipline that avoids intermittent crashes.

    5. Easily Overlooked Engineering Details

    A high-quality generated result often shows up in the additions beyond the stated requirements. The following items are worth fixing in the prompt or a review checklist:

    • Recursive directory scanning: when a folder is dropped in, traverse subdirectories automatically instead of handling only top-level files.
    • Completing the format whitelist: have the model fill in common container and audio codec combinations to reduce user trial and error.
    • Preventing same-name output overwrites: when the target file already exists, append a sequence number automatically rather than silently overwriting and losing data.
    • Upfront external dependency detection: before startup or execution, check whether the transcoding component is available, and show installation guidance instead of throwing a stack trace when it is missing.
    • Cancellable and recoverable: long tasks should allow abortion and clearly state how many items have been completed.

    These details cannot be piled up with a “longer prompt”; they need to be driven by an explicit acceptance checklist.

    6. Verification: Turning “Zero Errors” into a Repeatable Process

    After the code is generated, verify in a fixed order rather than judging by feel:

    1. Static checks: start with syntax and import checks to rule out low-level mistakes.
    2. Minimal sample run: validate the main path with a single short video.
    3. Batch and edge cases: empty list, very large file, corrupted file, directory without permissions.
    4. Responsiveness check: keep dragging the window and switching tabs during conversion to confirm the UI does not freeze.
    5. Missing-dependency scenario: in a simulated environment without the transcoding component, confirm the message is friendly.

    Only by turning “no lag” into observable metrics (for example, whether the UI heartbeat continues and whether progress advances monotonically) does the evaluation become objective.

    7. Follow-Up Prompts and Iteration: How to Use Multi-Turn Dialogue Correctly

    After the first generation, follow-up prompts should focus on specific behavior rather than vague judgments. For example, ask “what is the default value of the output directory,” “how are same-name files handled,” and “are temporary files cleaned up after cancellation.” Such questions quickly expose how well the model understands the context state, and they help turn implicit conventions into explicit logic. Every follow-up round should produce a verifiable change, not a repeated description.

    8. Conclusion

    The value of LLMs in programming is not replacing the developer’s thinking, but rapidly turning structured constraints into a runnable skeleton. What really determines delivery quality is the granularity of requirement breakdown, the correctness of concurrency and state management, and checklist-style verification of edge cases. With this method, both small desktop tools and internal efficiency scripts can produce stable output at controllable cost; for more complex task scheduling and artifact management, the loop from generation to execution can be completed by combining general cloud capabilities such as container platforms, object storage, and log monitoring.