Evaluating LLMs for Complex Engineering Code Generation: Observations and Best Practices
This article shares observations from multi-round internal tests of Chinese large language models (LLMs) in complex engineering code generation. Covering desktop, mobile, and frontend scenarios, it highlights challenges like long-context degradation and cross-layer debugging, and provides actionable best practices for developers to manage LLM output effectively.
This article documents observations from a series of internal, multi-round tests on Chinese large language models (LLMs). The tests did not use a unified public benchmark, and model names and versions were not disclosed. Therefore, the conclusions apply only to this specific sample and cannot be used to rank models or assess industry standards.
Complex code generation requires models to understand underlying logic, integrate cross-domain knowledge, manage long contexts, and design engineering structures. Below, we detail observed phenomena across test scenarios and provide actionable countermeasures.
- Desktop Native Applications: Quality Fluctuations in Long Conversations
The desktop tests used specific native development languages and low-level graphics rendering interfaces, conducting over ten rounds of iteration to simulate a real continuous development process.
During the first nine rounds, the code quality generated by the model remained generally stable. Some architectural designs provided useful insights, comparable to other common models on these specific points. Since there was no unified control group, this only reflects the sample and lacks quantifiable conclusions.
After round 9, as conversation history and project context accumulated, the model exhibited significant attention degradation. It began making destructive changes to trivial issues, failing to fix original defects while introducing new compilation errors, leading to a noticeable drop in project scores.
This phenomenon relates to how long contexts are handled. As token counts increase, the model’s ability to manage early core constraints and the global architecture declines, causing it to get stuck on local issues. Current context windows and attention allocation mechanisms pose practical limits on complex engineering. Developers must anticipate this when using long sessions.
- Mobile Applications: Collaboration Between Cross-Platform Frontend and Backend Services
Mobile testing focused on the collaborative development of mainstream cross-platform UI frameworks and backend compiled languages. In this test, the model performed more stably in handling boundary conditions than in the past, though two issues remain noteworthy.
The backend service part had no logical errors throughout the test, showing good code rigor. However, the backend engineering structure was relatively simple, merely meeting operational requirements. The application of layered architecture and design patterns was limited, a gap compared to top-tier models.
The cross-platform frontend exposed the model’s lack of proficiency in understanding framework lifecycles. Testers provided only one error log, and the model successfully located and fixed the issue, demonstrating strong self-correction capabilities in this instance.
These results indicate that while models are maturing in single-language syntax and basic logic, they still lack overall architectural consideration when organizing code into an engineering project. Developers need to supplement engineering specifications in prompts to obtain structures that meet team standards.
- Frontend Engineering: Hidden Bugs at the Intersection of Component Frameworks and Browser APIs
Frontend testing evaluated functional implementation, UI effects, and complex state management. Compared to earlier models, the UI structures generated in this test were more complete, and the visual presentation was more standardized.
Around round 8 of iteration, a hidden bug emerged, triggered by mixed interactions between the frontend component framework and browser Web APIs. At this stage, the model failed to analyze the root cause from a global system perspective; instead, it blindly added logs, barely resolving the issue after multiple debugging attempts. This consumed many interaction rounds and tokens.
For such cross-layer issues, we recommend troubleshooting in the following order:
- Minimal Reproduction: Isolate the problem to a single component and a page with minimal dependencies to ensure stable reproduction.
- Bisection Localization: Segment the code by lifecycle or call chain to identify where behavior deviates from expectations.
- Cross-Layer Boundary Check: Verify component states, event callbacks, and Web API invocation timing and return values one by one.
- Single Change at a Time: Modify only one place at a time, recording the change and result to prevent changes from masking each other.
The troubleshooting is complete when reproduction steps are stable and the root cause is proven via logs or breakpoints.
- Developer Strategies and Best Practices
Based on the three test scenarios, models can provide practical assistance in complex engineering, but long-conversation stability, engineering structure, and cross-layer debugging still require process supplements. The following four practices can be directly applied to daily development, each including trigger conditions, actions, acceptance criteria, and rollback methods.
- Micro-Task Splitting
- Trigger: A single session accumulates about 8 to 10 rounds of iteration, or involves more than two independent modules.
- Action: Summarize current progress, list confirmed interfaces and constraints, and start a new session, bringing only the relevant module’s code and constraint descriptions.
- Acceptance Criteria: The new session accurately recites the constraints and passes compilation and basic tests.
- Rollback: Keep the code version from the previous session; revert to the latest stable commit if issues arise.
- Injecting Architecture Constraint Prompts
- Trigger: Generating directory structures for backend services or frontend projects.
- Action: Specify layering methods (e.g., MVC or Clean Architecture), directory structures, naming conventions, and prohibited actions in the prompt.
- Acceptance Criteria: The generated file structure matches the agreement, with no direct cross-layer calls.
- Rollback: If the structure fails to meet conventions, use the specification document as the source of truth and regenerate only that module.
- Human Review Blocking Mechanism
- Trigger: The model fails to resolve an issue after two consecutive modifications, or the scope of changes exceeds the problem itself.
- Action: Pause automated model modifications, have the developer read the diff line by line, provide a system-level analysis, and then direct the model to modify in the specified direction.
- Acceptance Criteria: Every change corresponds to a specific issue.
- Rollback: Revert changes unrelated to the issue.
- Cloud Toolchain Integration
- Object Storage: Used to save static resources. Access permissions should be set to the minimum scope, and keys must not be written into code or frontend packages.
- Log Service: Used to collect runtime exceptions and verify if model fixes are truly effective. User data in logs must be desensitized and retention periods set to control storage costs.
- Container Platform: Provides an isolated environment for each build to automatically run unit tests and build checks. Set resource limits based on concurrency needs to avoid unexpected costs.
- Data Security: Before submitting code to third-party models, confirm whether it contains customer data or credentials, complying with team data usage regulations.
The value of this closed loop lies in ensuring AI-generated code passes automated tests and runtime monitoring rather than entering the release pipeline directly. Teams must define owners for each step, or automated checks will easily be ignored.
In these tests, Chinese LLMs completed parts of multi-round full-stack development. However, long-conversation stability, engineering architecture completeness, and complex bug troubleshooting still fall short. By splitting tasks, defining constraints, setting human review checkpoints, and leveraging cloud toolchains, developers can control model output within a verifiable range.
