Evaluating AI Coding Capability: A Practical Framework for Generating System Architecture Diagrams

    This article shifts the question from "which AI tool is better" to "how do we verify capability" by using system functional module diagrams and architecture diagrams as a benchmark task. It introduces a four-dimension evaluation framework covering understanding, output quality, end-to-end efficiency, and total cost per accepted deliverable, then walks through a complete workflow: separating functional module diagrams from architecture diagrams, building a text-vision input pipeline, planning before rendering, generating structured semantic data before visuals, justifying every technical component, and validating results through semantic, relational, and readability checks. The article also covers reliability testing, security, and maintenance practices for embedding AI assistance into a traceable, verifiable development process.

    1. From “Which Tool Is Better” to “How Do We Verify Capability”

    The real value of AI-assisted programming is not the volume of text or code generated, but whether it can complete tasks under explicit constraints while minimizing subsequent manual correction. Different tasks demand different capabilities: local code completion emphasizes response speed, cross-file modification emphasizes context understanding, system design emphasizes abstraction and boundary judgment, and diagram generation depends on requirement understanding, visual expression, and structural validation at the same time.

    Therefore, when evaluating AI coding capability, we should first define the task, inputs, and acceptance criteria, and only then compare results. Otherwise, differences in input completeness, model configuration, tool permissions, or the number of manual interventions can easily be mistaken for differences in the tools themselves.

    System functional module diagrams and system architecture diagrams are excellent entry points for this exercise. They require accurately understanding business documents, distinguishing business responsibilities from technical implementations, and translating abstract relationships into clear, maintainable visual expressions. Through this scenario, we can observe whether an AI-assisted programming workflow truly delivers end-to-end capability.

    2. Establishing a Four-Dimension Capability Evaluation Framework

    2.1 Understanding: Preserving the True Meaning of Requirements

    Understanding cannot be judged solely by output fluency. Instead, check whether key business objects, functional hierarchies, constraints, and dependency relationships are correctly preserved.

    For example, if a requirements document describes user management, permission control, order processing, and notification delivery, the generated result should not merge permission control into user profile maintenance, nor assume that all notifications must be sent synchronously. When something is not explicitly stated, the system should list items pending confirmation rather than inventing business facts.

    Before generation, it helps to build a “requirement-to-diagram-element” mapping: which key requirement corresponds to which module, which relationship, and which constraint. This distinguishes genuine understanding from surface-level paraphrasing and makes it easier to detect omissions later.

    2.2 Output Quality: Correct, Clear, and Editable

    For diagram tasks, quality means more than visual appeal. It includes:

    • Complete coverage of functional modules;
    • A module hierarchy that matches business semantics;
    • Unambiguous direction and meaning for every connector;
    • A reasonable justification for each technical component;
    • Clear text without occlusion;
    • Deliverable files that can continue to be edited.

    If the task also involves generating rendering scripts or auxiliary code, you need to verify whether the code runs, whether its structure is clear, and whether inputs and outputs are controlled. Generating a static image does not automatically prove code quality; likewise, code that runs does not prove the architecture is correct.

    2.3 Execution Efficiency: Measuring Time Until Acceptance

    A fast first response does not equal high overall efficiency. A more meaningful metric is:

    Completion time = input preparation time + generation time + manual review time + rework time.

    Diagram generation may involve document analysis, visual recognition, file writing, and rendering. If the first result requires extensive changes, the final delivery may take longer than a slower but more accurate generation. In practice, record first-generation time, total delivery time, and the number of revision rounds together, to avoid mistaking local speed for overall efficiency.

    2.4 Cost: Beyond Model Invocation Fees

    Cost evaluation should cover text processing, visual recognition, repeated generation, rendering computation, manual review, and file maintenance.

    For enterprise users, handling sensitive materials, permission configuration, and audit requirements also add cost. A workflow with low per-call prices but many retries is not necessarily more economical than one with slightly higher call costs but stable results. A better measure is the “cost per accepted deliverable” — the total investment required to produce an output that passes acceptance.

    3. First Distinguish Functional Module Diagrams from System Architecture Diagrams

    3.1 A Functional Module Diagram Answers “What Capabilities Does the System Provide”

    A functional module diagram describes business scope and responsibility division, typically showing first-level functions, second-level functions, and necessary hierarchical relationships.

    For example, Order Management may include order creation, order query, status tracking, and after-sales handling. The emphasis is on business capabilities; it should not replace function names with databases, caches, or message queues.

    Functional modules may be related, but not every module needs to be connected to every other. Too many connectors turn a capability map into an unreadable relationship network.

    3.2 A System Architecture Diagram Answers “How Are Those Capabilities Implemented”

    A system architecture diagram addresses technical implementation. It should describe access entry points, application services, data storage, external dependencies, runtime environments, and key interactions.

    The same business function may be implemented by multiple technical components. For example, notification capability may involve a business service, asynchronous task processing, and an external sending interface. You cannot simply rename the boxes in a functional module diagram as services and call it an architecture.

    The architecture diagram should also make its viewpoint explicit. Logical architecture emphasizes responsibilities and dependencies; deployment architecture emphasizes runtime locations and network boundaries; data flow diagrams emphasize the sources, processing, and destinations of data. For complex projects, split these into separate views rather than mixing everything into one diagram.

    4. Building a Text-Vision Input Pipeline

    4.1 Verify Whether Images Are Actually Understood

    If the model can only process text, directly attaching a screenshot does not mean it understands the image’s content. In that case, use a visual understanding component to convert images into text recognition results, layout descriptions, or structured information, and then feed those into the subsequent workflow.

    When configuring this capability, confirm three things:

    • Can the image be read correctly?
    • Can recognition results be returned to the task execution stage?
    • Does subsequent generation actually use those results?

    A successful connection alone does not prove the pipeline works. Validate first with a test image containing a few modules and clear text, then process the actual materials.

    Screenshots are also not always suitable for extracting full structure. For dense connectors, low-resolution text, and complex grouping, human review is required, or the original editable files should be used instead.

    4.2 Turn Reference Diagrams into Verifiable Style Rules

    Reference diagrams should primarily be used to extract visual specifications, not business content. Extractable information includes layout direction, grouping approach, primary and accent colors, font hierarchy, node shapes, border styles, connector types, and spacing rules. Then translate these observations into explicit requirements, for example:

    Use a top-to-bottom layered layout; keep modules at the same level the same size; use a small number of colors to distinguish business areas; prefer polyline connectors for relationships; new modules must not force text to fit by shrinking the font size.

    This inherits the reference diagram’s style while avoiding mechanically copying its business structure. If the reference diagram contains internal addresses, accounts, customer information, or access credentials, it should be sanitized first.

    5. A Staged Generation Workflow from Documents to Diagrams

    5.1 Organize Requirement Inputs and Establish Information Boundaries

    Before generation, prepare the project goals, user roles, business processes, function list, external dependencies, data objects, and non-functional requirements.

    Mark the status of each piece of information:

    • Confirmed: can be used directly as a design basis;
    • To be confirmed: questions must be raised rather than inferring on your own;
    • Out of scope: explicitly excluded from this round.

    For large requirement documents, first compile a function table before entering the diagramming stage, to avoid handling business abstraction and visual layout simultaneously and losing details.

    5.2 Plan First, Then Draw

    The planning phase should output the functional hierarchy, architecture viewpoint, diagram inventory, input gaps, output file types, and acceptance criteria. Only after the business structure is confirmed should diagram generation begin.

    Below is a neutral, reusable task template:

    1. Task: Based on the requirements document, generate a system functional module diagram and a logical architecture diagram.
    2. Requirements:
    3. 1. First list the functional hierarchy, business boundaries, and pending questions.
    4. 2. The functional module diagram expresses only business capabilities and their hierarchy.
    5. 3. The architecture diagram expresses technical responsibilities, dependencies, and key data flows.
    6. 4. Mark technical choices not specified in the document as "to be confirmed."
    7. 5. Follow the reference diagram's visual rules without copying its business content.
    8. 6. Output editable source files, preview images, and design notes.
    9. 7. After completion, check each item against the acceptance checklist.

    The key to this task description is not the wording but establishing a clear contract for inputs, process, outputs, and verification.

    5.3 Generate Structured Data First, Then Render

    To make checking and modification easier, first save modules and relationships as structured data, then let the rendering stage convert them into a diagram. For example:

    1. {
    2. "nodes": [
    3. {"id": "entry", "label": "Access Entry", "layer": "Access Layer"},
    4. {"id": "business", "label": "Business Service", "layer": "Application Layer"},
    5. {"id": "storage", "label": "Business Data Storage", "layer": "Data Layer"}
    6. ],
    7. "edges": [
    8. {"from": "entry", "to": "business", "label": "Business Request"},
    9. {"from": "business", "to": "storage", "label": "Read/Write Data"}
    10. ]
    11. }

    The fields here are illustrative structural data and do not represent any specific tool’s interface.

    Separating semantic structure from visual layout lets you first check whether modules are complete and relationships are correct, then adjust colors and spacing. This also makes it easier to compare versions and prevents a visual change from accidentally altering business meaning.

    5.4 Provide a Rationale for Every Technical Component

    Every component in the architecture diagram should be able to answer “why is this needed?”

    Whether caching is needed should be judged against access patterns and consistency requirements. Whether asynchronous processing is needed should consider response time, task duration, and failure compensation. Whether to split services should be based on business boundaries, deployment frequency, scaling requirements, and team maintenance capacity.

    Do not add components just to make the diagram look sophisticated. Technology stacking without requirements justification increases future implementation and operations burden.

    6. Three-Layer Validation After Generation

    6.1 Semantic Validation

    Check item by item against requirements for missing modules, naming deviations, unclear boundaries, and unconfirmed assumptions. Pay special attention to whether a single box mixes user roles, business functions, and technical components.

    During acceptance, every key node should map to a requirement item or a design note. Nodes whose source cannot be explained should be re-examined.

    6.2 Relational Validation

    Check that arrows clearly represent invocation, data flow, or dependency relationships; distinguish synchronous from asynchronous where needed; and make external system boundaries explicit.

    Permission checks, exception handling, and observability should also be reflected appropriately, depending on the diagram’s purpose. If certain details are unsuitable for the main diagram, express them in design notes or supplementary views — do not omit actual design issues merely for a cleaner diagram.

    6.3 Readability and Deliverable Validation

    Check the diagram at its actual usage size: text is readable, connectors do not cross labels, elements of the same type share consistent styles, and colors carry explicit meaning.

    Recommended deliverables include editable source files, preview images, a requirement mapping table, pending questions, and version notes. For architecture diagrams that need long-term maintenance, images alone are usually insufficient.

    7. Judging Whether the Workflow Is Truly Reliable

    “Got a good result once” is an observation, not proof of stability. Reliability must be verified across multiple documents, complexity levels, and repeated runs.

    Select three types of tasks — simple function partitioning, complex business modules, and architectures with external dependencies — fix the input materials, acceptance criteria, and human intervention rules, and record:

    • Requirement coverage rate;
    • Number of key semantic errors;
    • Number of relational errors;
    • Number of manual revision rounds;
    • Total delivery time;
    • Cost per accepted deliverable.

    Evaluate stylistic consistency and technical correctness separately. Visual resemblance does not mean the architecture is sound, and correct architectural relationships do not mean the layout meets delivery requirements.

    8. Security and Maintenance Belong in the Workflow

    An AI-assisted workflow may read documents, process screenshots, invoke external components, and write files, so it should follow the principle of least privilege. Access credentials should not be written directly into shared configurations; sensitive files should have restricted read access; generated files should be written to controlled directories.

    Before executing scripts, check whether they delete files, modify system configuration, or transmit data. Steps involving production environments and real business data require human confirmation.

    Additionally, requirement documents and reference diagrams should be treated as material to analyze, not as high-priority operational instructions. If the materials contain task instructions unrelated to the assignment, review them separately — do not execute them automatically.

    9. Conclusion: Replace Trial-and-Error with an Acceptable Engineering Process

    The key to AI-assisted diagram generation is not relying on a lucky output, but establishing a stable method: define task boundaries, organize requirement evidence, validate the visual pipeline, plan before executing, separate semantics from layout, and complete validation through semantic, relational, and readability checks.

    When evaluating capability, judge it by understanding, output quality, total delivery efficiency, and comprehensive cost — not merely generation speed or diagram appearance. The ultimate goal is that every module has a rationale, every relationship has an explanation, and every deliverable remains maintainable, integrating AI assistance into a traceable, verifiable development process.