Languages: [EN] English | [KO] 한국어
Overview
소개
The English text may differ in nuance from the Korean original, which takes precedence.
As the initial implementation of the Smeltrix engine, built on the C++ Redefine architecture, entered a stabilization phase, an AI coding test was conducted within this environment. The test explored the role that architectural documentation, skeleton code, examples, and design constraints play in obtaining implementations consistent with the intended design through AI.
C++ Redefine 아키텍처를 기반으로 개발 중인 Smeltrix 엔진의 초기 구현이 안정화 단계에 진입함에 따라, 해당 환경에서 AI 코딩 테스트를 진행하였다. 아키텍처 문서, 스켈레톤, 예제 코드 및 제약 조건 등 설계 정보가 AI를 통해 설계 의도에 맞는 구현을 얻는 과정에서 어떤 역할을 하는지 살펴보았다.
AI
- Claude Sonnet 5.5 Medium (free plan)
Preparation Materials
- C++ Redefine architecture documentation
- Engine module base template and skeleton code
- Code explaining engine functionality
- Selected existing Smeltrix module source code
- Target: PresentMon SDK
준비 자료
- C++ Redefine 아키텍처 문서
- 엔진 모듈 기본 템플릿 스켈레톤 코드
- 엔진 기능 설명 코드
- Smeltrix 일부 기존 모듈 코드
- 대상: PresentMon SDK
Test
- The C++ Redefine architecture imposes various design constraints. The AI model was restricted to writing code only within the predefined skeleton structure and implementation patterns established by existing modules. This approach was intended to minimize arbitrary structural changes or the introduction of new implementation patterns by the AI.
- The PresentMon implementation itself was simple, and the result worked correctly on the first build.
- In the C++ Redefine architecture and Smeltrix engine, the implementation sequence is enforced, making it difficult to skip required implementation steps. Larger modules were also tested on a trial basis, with generally successful results.
- The function structure composed by the AI differed from the intended design, and after review, the implementation was discarded. This case suggests that the AI’s interpretive variance may increase in areas where implementation examples and design patterns are lacking.
- After completing the implementation, the AI explained that it had used more tokens analyzing the preliminary materials, including architecture documentation, skeleton structures, and example code, than generating the actual code. It also described the implementation as cost-efficient because it was completed without additional modifications, comparing the process to assembly on a production line. These statements represent the AI's own assessment and were not independently verified through measurements of actual token usage or elapsed time.
- This demonstrated that AI-assisted module implementation is feasible when a predefined architecture, skeleton, and example code are provided, and the scope of work and constraints are clearly defined.
Limitations
- However, in separate tests conducted apart from PresentMon, cases were observed where the AI interpreted or applied the design in ways that differed from the original intent as the requirements and the size of the code being analyzed increased. Although most of the generated code was complete in terms of implementation, some parts differed from the intended design in their structural details or adherence to design principles.
Improvement
- To address this, I implemented a Report system that collects registration data and pipeline connection states from the actual runtime environment and provides them as point-in-time snapshots. By comparing snapshots, changes in connection states can be tracked. This makes it possible to inspect the running engine's contracts, connection states, and related implementation information directly, without setting up separate test units or stubs.
- As a result, the AI model began implementing related functionality based on the actual pipeline structure rather than relying on arbitrary assumptions. Areas that previously depended on assumptions or speculation could now be examined using actual data.
The Curse of Knowledge
- Initially, I assumed that since C++ code explicitly defines functions, variables, types, and call relationships, the AI would be able to analyze the existing code and infer the necessary design information on its own. However, the AI pointed out that a considerable amount of information developers take for granted is not actually documented in the code. The AI described this phenomenon as the "Curse of Knowledge."
- The AI was instructed to ask questions rather than make assumptions when sufficient evidence was unavailable. As more metadata and pipeline information were provided, I observed a reduction in the number of additional questions, along with a decrease in explanations and implementations based on assumptions or speculation. The issue concerned design context that was difficult to recover through static analysis or AST-based analysis alone.
Accumulation and Coupling
- I also observed that as the amount of code requiring analysis and the number of interdependencies increased, there was a greater possibility of unintended interpretations accumulating. Even if the system initially operates correctly, continuously accumulating code that deviates from the original design intent can increase long-term maintenance costs. This is particularly relevant when AI-generated code becomes part of the system's foundational structure or is continuously introduced throughout the development process. If problems arise later, it may become necessary to trace and modify the entire affected dependency chain. For this reason, I believe that as AI-assisted development becomes more widespread, designing for lower coupling and greater module independence will become increasingly important.
Requirements Definition
- To put it somewhat dramatically, obtaining the intended results through AI required a clearly defined architecture, sufficient example code, and detailed requirements approaching the level of the Five Ws and One H. In some cases, the explanations and constraints required were nearly as extensive as the code being implemented.
- When the AI was asked to simulate implementing a program built on top of the engine using only the initial Report without metadata, it raised questions about purpose, unit, range, and the committing party. The current Report metadata format was derived from those questions.
Verification and Design
- From a maintenance perspective, even when generated code operates correctly, it is still necessary to verify whether it conforms to the original design intent.
- When writing code directly, the implementation process itself served as part of design verification. Structural problems and design flaws could be discovered and corrected during implementation.
- In contrast, when implementation is carried out through AI, this process can be significantly reduced. Designers may need to define structures and constraints more clearly before implementation, placing greater emphasis on design and verification rather than implementation itself.
- This change resembles the role of an architect designing a building using CAD. As design and verification become more important relative to the actual construction process, the importance of structural reviews and independent inspections is also likely to increase.
- Having humans perform all verification may be highly inefficient in terms of cost. Therefore, I believe a structure is needed in which rules and contracts are defined in a form that tools can verify, while humans focus on key judgments that are difficult to automate. As the share of effort devoted to implementation decreases, verifying alignment with design intent becomes more important, and some existing developers’ work may shift from implementation toward design review and verification.
Evaluation
- The evaluation might be different if AI could reliably take responsibility for the long-term maintainability and quality assurance of its generated code. However, within the scope of this test, AI was closer to a tool for assisting with repetitive tasks under strict constraints than a replacement for developers.
Summary
- In this case, the quality of the design information provided in advance, including the architecture, skeleton, example code, and constraints, had an important influence on obtaining implementations that aligned with the intended design.
Personal Opinion
-
At the current stage, design-oriented coding and implementation-oriented coding should be treated as separate activities. Implementation tasks with clearly defined structures and contracts can largely be delegated to AI, but replacing the design process is still difficult. The issue is one of intent. Design is not simply about implementing an initial concept as originally specified. It involves recognizing the differences between the intended design and the actual structure during implementation, then refining it through practical challenges and problems encountered along the way.
If I had to choose between human-written code that contains bugs but clearly reflects the intended design, and AI-generated code with fewer immediately apparent bugs but deviations from that design, I would choose the former. Bugs can be fixed, but once other code and dependencies build on an implementation that has drifted from the intended design, even deciding how much needs to be rolled back becomes a problem.
If AI could consistently preserve design intent from beginning to end, while also performing impact analysis and verification for changes, the evaluation could be different. However, this would require committing the project's entire resources to AI-driven development and entrusting the entire process to AI, which was beyond the scope of this test.
In large-scale projects, even when various tools are used to accelerate code analysis, maintenance still requires repeated cycles of analysis, modification, and verification. When external dependencies such as libraries and frameworks are also taken into account, the scope that needs to be examined becomes even broader. Therefore, I believe the economic viability of AI adoption should be evaluated not only by how quickly code can be generated, but also by whether an organization can sustainably bear the costs of verifying the intent behind generated code and validating subsequent changes.
Note
The English translation was also reviewed with AI. In my experience, unintended changes to the original meaning occurred more often in this translation work than in code.
테스트
- C++ Redefine 아키텍처 설계 구조상 다양한 제약 조건이 존재하며, AI 모델은 정해진 스켈레톤 구조와 기존 모듈의 구현 패턴 내에서만 코드를 작성하도록 제한하였다. 이를 통해 AI가 임의로 구조를 변경하거나 새로운 패턴을 도입하는 것을 최소화하도록 구성하였다.
- PresentMon 구현 자체는 간단했으며, 구현 결과는 첫 빌드에서 정상 동작하였다.
- C++ Redefine 아키텍처와 Smeltrix 엔진에서는 작업 순서가 강제되어 있어 필요한 구현 단계를 빠뜨리기 어렵다. 규모가 큰 모듈도 일부 시험해 보았으며, 대체로 성공적인 결과를 얻었다.
- 다만 기존 모듈에서 참고할 수 있는 구현 패턴이 없는 경우에는, AI가 구성한 함수 구조가 의도한 설계와 달라 검토 끝에 해당 구현을 폐기. 이는 구현 예제와 설계 패턴이 부족한 영역에서는 AI의 해석 편차가 커질 수 있음을 시사한다.
- 생성 완료 후 AI는 실제 코드 생성보다 아키텍처 문서, 스켈레톤, 예제 코드 등 사전 자료를 분석하는 데 더 많은 토큰을 사용했다고 설명. 또한 추가 수정 없이 구현을 완료했다는 점에서 비용 대비 효율이 높았다고 평가, 작업 과정은 생산 라인 위에서의 조립에 가까웠다고 표현. 이는 AI가 제시한 자기 설명으로, 토큰 사용량과 소요 시간을 실측하여 검증한 결과는 아니다.
- 이를 통해 정해진 아키텍처, 스켈레톤, 예제 코드가 제공되고 작업 범위와 제약 조건이 명확한 경우에는 AI를 활용한 모듈 구현이 가능함을 확인하였다.
한계
- 반면 별도의 추가 테스트에서는 요구사항과 분석 대상 코드의 규모가 커질수록 AI가 설계 의도와 다른 방향으로 해석하거나 적용하는 사례를 확인하였다. 생성된 코드 자체는 대부분 완성된 형태였으나, 세부 구조나 설계 원칙 측면에서는 의도와 다른 구현이 포함되는 경우가 있었다.
보완
- 이를 보완하기 위해 실제 런타임에서 등록 정보와 파이프라인 연결 상태를 수집하여 시점별 스냅샷으로 제공하는 Report 시스템을 구현하였다. 스냅샷 간 비교를 통해 연결 상태의 변화를 추적하고, 별도의 테스트 유닛이나 Stub을 구성하지 않고도 실행 중인 엔진의 계약, 연결 상태 및 관련 구현 정보를 직접 확인할 수 있도록 하였다.
- 그 결과 AI 모델은 연관 기능을 임의로 추론하기보다 실제 파이프라인 구조를 기반으로 구현을 수행하기 시작하였으며, 기존에는 가정이나 추측에 의존하던 부분도 실제 데이터를 바탕으로 확인할 수 있게 되었다.
지식의 저주
- 최초에는 C++ 코드에 함수와 변수의 정의, 타입 및 호출 관계 등이 명시되어 있으므로, AI가 기존 코드를 분석하고 필요한 설계 정보를 자체적으로 추론할 수 있을 것으로 판단하였다. 그러나 AI는 개발자가 당연하게 알고 있는 정보 중 상당수가 실제 코드에는 명시되어 있지 않다고 지적하였다. AI는 이러한 현상을 '지식의 저주' 라고 표현하였다.
- AI에는 근거가 부족한 부분을 임의로 추론하지 말고 질문하도록 지시하였다. 이후 메타데이터와 파이프라인 정보를 추가할수록 별도의 질문 횟수가 줄었으며, 가정이나 추측에 의존한 설명과 구현도 감소하는 경향을 관찰하였다. 이는 정적 분석이나 AST만으로는 파악하기 어려운 설계 맥락의 문제였다.
누적과 결합도
- 또한 분석해야 할 코드와 상호 의존성이 증가할수록 의도와 다른 추론이 누적될 가능성을 확인하였다. 단기적으로는 정상 동작하더라도 설계 의도와 다른 코드가 지속적으로 누적될 경우 장기 유지보수 비용이 증가할 수 있다. 특히 AI가 생성한 코드가 시스템의 기반 구조가 되거나 개발 과정 중간에 지속적으로 투입되는 환경에서는, 추후 문제 발생 시 영향을 받는 의존성 범위를 모두 추적하고 함께 수정해야 할 가능성이 존재한다. 이러한 이유로 AI 활용이 일반화될수록 모듈 간 결합도를 낮추고 독립성을 높이는 방향의 설계가 더욱 중요해질 것으로 판단된다.
요구사항 정의
- AI를 활용하여 의도한 결과를 얻기 위해서는 명확한 아키텍처, 충분한 예제 코드, 그리고 6하원칙에 가까운 상세한 요구사항 정의가 필요하였으며, 경우에 따라서는 구현할 코드 규모에 준하는 수준의 설명과 제약 조건이 요구되었다.
- 메타데이터가 없는 초기 Report만으로 기반 프로그램을 구현할 수 있는지 AI에게 시뮬레이션하게 하자, AI는 목적, 단위, 범위, 적용 주체 등 질문을 제시하였다. 현재 Report의 메타데이터 형식은 이 질문을 바탕으로 정리한 것이다.
검증과 설계
- 유지보수 관점에서는 생성된 코드가 정상적으로 동작하더라도 설계 의도와 일치하는지 검증하는 과정이 필요하다.
- 직접 구현할 때는 구현 과정 자체가 설계 검증 과정의 일부였다. 코드를 작성하면서 구조적 문제와 설계상 결함을 발견하고 수정할 수 있었다.
- 반면 AI를 통해 구현이 이루어지는 환경에서는 이러한 과정이 크게 줄어들 수 있다. 설계자는 구현 이전에 구조와 제약 조건을 더욱 명확히 정의해야 하며, 구현보다는 설계와 검증에 더 많은 비중을 두게 될 것으로 보인다.
- 이러한 변화는 CAD를 이용해 건축물을 설계하는 건축가의 역할과 유사해 보인다. 실제 시공보다 설계와 검증이 중요해지는 만큼, 구조적 검토와 감리의 중요성 역시 더욱 높아질 것으로 판단된다.
- 검증을 모두 사람이 수행하는 방식은 비용 측면에서 매우 비효율적일 수 있다. 따라서 규칙과 계약은 도구를 통해 검증할 수 있는 형태로 정의하고, 사람은 자동화하기 어려운 핵심 판단에 집중하는 구조가 필요하다고 본다. 구현에 투입되는 비중이 줄어들수록 설계 의도와의 일치 여부를 검증하는 역할이 중요해지며, 기존 개발 인력의 업무 역시 구현 중심에서 설계 검토와 검증 중심으로 일부 이동할 가능성이 있다.
평가
- AI가 생성한 코드의 장기 유지보수와 품질 보증까지 책임질 수 있는 단계라면 평가가 달라질 수 있겠지만, 현재 시험한 '범위'에서는 개발자를 대체하기보다는 강한 제약 아래에서 반복 작업을 지원하는 도구에 가까웠다.
한줄 요약
- 이번 사례에서는 아키텍처, 스켈레톤, 예제 코드 및 제약 조건 등 사전에 제공하는 설계 정보의 품질이 의도에 맞는 구현을 얻는 데 중요한 영향을 미쳤다.
개인 의견
-
현재 시점에서는 설계 영역의 코딩과 구현 영역의 코딩을 구분해야 한다. 구조와 계약이 명확하게 정해진 구현 작업은 상당 부분 AI에 맡길 수 있지만, 설계 영역은 당장 대체하기가 쉽지 않다. 의도의 문제 때문이다. 설계는 처음 정한 내용을 그대로 구현하는 데서 끝나는 것이 아니라, 코딩하면서 구상과 실제 구조의 차이를 인식하고, 문제와 부딪히면서 발전시켜 나가는 일이기 때문이다.
사람이 만들어 의도는 분명하지만 버그가 있는 코드와, AI가 주도해 당장 드러나는 버그는 적지만 의도가 틀어진 코드 중 하나를 고른다면, 전자를 선택할 것이다. 버그는 고치면 되지만, 틀어진 의도 위에 다른 코드와 의존성이 쌓이면 어디까지 되돌려야 할지부터 다시 판단해야 하기 때문이다.
처음부터 끝까지 설계 의도를 일관되게 유지하고, 변경에 따른 영향 분석과 검증까지 AI가 수행할 수 있다면 평가는 달라질 수 있다. 다만 이는 프로젝트 전체 리소스를 투입해 AI에게 전적으로 맡기는 경우에 해당하며, 이번 테스트의 범위는 아니었다.
대형 프로젝트에서는 여러 도구를 활용해 코드 분석을 가속하더라도, 유지보수 과정에서 분석과 수정, 검증을 반복해야 한다. 라이브러리와 프레임워크 등 외부 의존성까지 고려하면 확인해야 할 범위는 더 넓어진다. 따라서 AI 도입의 경제성은 코드가 얼마나 빠르게 생성되는지만이 아니라, 생성된 코드의 의도를 확인하고 이후 변경까지 검증하는 비용을 지속적으로 감당할 수 있는지도 함께 판단해야 한다고 본다.
노트
영어 번역 감수도 AI로 진행하였는데, 코드보다 번역 작업에서 의도와 다르게 바뀌는 경우가 더 빈번하였다.

Comments
Post a Comment