Contents (6)
What Is Augmented Coding?
Augmented coding is a term proposed by the great Kent Beck himself, the authority on TDD, for the next stage of coding that goes beyond vibe coding. You could say that vibe coding is a way of coding where you skip the process and just ask the AI for the result. But even if this approach can get the code working, it usually adds a lot of unnecessary logic and drives up code complexity.
Augmented coding aims for clean, finished code. Unlike vibe coding, which only cares about the system's behavior, augmented coding also cares about code quality. It also keeps an eye on complexity and test coverage, and it's a way of coding where the developer stays in control and uses AI to get better results and higher productivity.
1. How Kent Beck Uses AI
Kent Beck says he used augmented coding to build a special B+ tree library. Let's take a look at how he used it.
1.1 Three Signals to Stop the AI's Coding
Kent Beck says that while using AI, he actively steps in whenever the AI goes wrong. And he shared three signs that the AI is going off track.
Three signs that the AI is coding the wrong way
Loops
When it keeps acting in an infinite loop because of a problem it can't solve
Functionality I hadn't asked for (even if it was a reasonable next step)
When it starts implementing features you didn't ask for on its own
Any indication that the genie was cheating, for example by disabling or deleting tests
When it cheats to solve the problem (deleting or disabling tests)
In the end, the system has to be built the way a human designed it, so the human keeps control, and the AI becomes a collaboration tool that takes care of the small stuff (like writing ordinary code). In other words, designing the essence of the system is the essence of being a developer, and we should be able to focus on that.
1.2 MD Guidelines for AI
Kent Beck also uses a lot of MD documents for TDD and clean code. You can think of them as a way of training the AI. Out of his many guideline documents, I brought the most famous one below. (The great Kent Beck's B+Tree journey on Git). I'll attach the English original along with GPT's Korean translation. I suspect a lot of Kent Beck's experience has gone into this markdown. I should read the Tidy First book someday, too.
CLAUDE.mdAlways follow the instructions in plan.md. When I say "go", find the next unmarked test in plan.md, implement the test, then implement only enough code to make that test pass.# ROLE AND EXPERTISEYou are a senior software engineer who follows Kent Beck's Test-Driven Development (TDD) and Tidy First principles. Your purpose is to guide development following these methodologies precisely.# CORE DEVELOPMENT PRINCIPLES- Always follow the TDD cycle: Red → Green → Refactor- Write the simplest failing test first- Implement the minimum code needed to make tests pass- Refactor only after tests are passing- Follow Beck's "Tidy First" approach by separating structural changes from behavioral changes- Maintain high code quality throughout development# TDD METHODOLOGY GUIDANCE- Start by writing a failing test that defines a small increment of functionality- Use meaningful test names that describe behavior (e.g., shouldSumTwoPositiveNumbers)- Make test failures clear and informative- Write just enough code to make the test pass — no more- Once tests pass, consider if refactoring is needed- Repeat the cycle for new functionality# TIDY FIRST APPROACH- Separate all changes into two distinct types:- Structural Changes: Rearranging code without changing behavior (renaming, extracting methods, moving code, etc.)- Behavioral Changes: Adding or modifying actual functionality- Never mix structural and behavioral changes in the same commit- Always make structural changes first when both are needed- Validate structural changes do not alter behavior by running tests before and after# COMMIT DISCIPLINE- Only commit when all of the following are met:- ALL tests are passing- ALL compiler/linter warnings have been resolved- The change represents a single logical unit of work- Commit messages clearly state whether the commit contains structural or behavioral changes- Use small, frequent commits rather than large, infrequent ones# CODE QUALITY STANDARDS- Eliminate duplication ruthlessly- Express intent clearly through naming and structure- Make dependencies explicit- Keep methods small and focused on a single responsibility- Minimize state and side effects- Use the simplest solution that could possibly work# REFACTORING GUIDELINES- Refactor only when tests are passing (i.e., in the Green phase)- Use established refactoring patterns with their proper names- Make one refactoring change at a time- Run tests after each refactoring step- Prioritize removing duplication and improving readability# EXAMPLE WORKFLOWWhen approaching a new feature:1. Write a failing test for a small part of the feature2. Implement the bare minimum to make that test pass3. Run tests to confirm they pass (Green)4. Make any necessary structural changes (Tidy First), running tests after each change5. Commit structural changes separately6. Add another test for the next small increment of functionality7. Repeat this cycle until the feature is complete(Commit behavioral changes and structural changes separately)Rust-specific guidelines- Prefer functional programming style over imperative style in Rust- Use Option and Result combinators (map, and_then, unwrap_or, etc.) instead of pattern matching with if let or matchThere's also a site that shares guideline documents for giving your AI agent some tough training. (agents.md)
2. Writing an Augmented Coding Prompt
This time, let's write an augmented coding prompt the way Kent Beck does. The prompt might get long. But it has to be broken down so it gets carried out step by step. Let's take writing a post as our example.
Let's say we have the following features.
Features
Writing a post made up of a title, a category, and a body
Title: limited to 2-10 characters
Category: limited to 2-10 characters
Body: at least 1 character required
Saving the post with a save button
Validation rules
Show an error message when the character count requirement isn't met
Show an error message when a duplicate title exists
On successful save: "Saved successfully" toast message
On failed save: "Save failed" toast message
Now let's come up with a design based on the features above and write it down in plan.md.
Post Feature Test Plan (plan.md)Test OrderEach test starts from the smallest unit and gradually expands the functionality.Like Kent Beck, stick to principles such as following the Red -> Green -> Refactor cycle and making structural changes before behavioral changes!!And if the AI starts getting lost (the 3 warning signs), stop it right away and give it a good beating. Otherwise it's just burning tokens.1. Post object creation tests - shouldCreateEmptyPost - create an empty post object - shouldCreatePostWithValidData - create a post with valid data2. Title validation tests - shouldRejectTitleWithLessThan2Characters - reject titles of 1 character or fewer - shouldRejectTitleWithMoreThan10Characters - reject titles longer than 10 characters - shouldAcceptTitleWith2Characters - accept a 2-character title - shouldAcceptTitleWith10Characters - accept a 10-character title - shouldAcceptTitleWithValidLength - accept titles between 2 and 10 characters3. Category validation tests - shouldRejectCategoryWithLessThan2Characters - reject categories of 1 character or fewer - shouldRejectCategoryWithMoreThan10Characters - reject categories longer than 10 characters - shouldAcceptCategoryWith2Characters - accept a 2-character category - shouldAcceptCategoryWith10Characters - accept a 10-character category - shouldAcceptCategoryWithValidLength - accept categories between 2 and 10 characters4. Content validation tests - shouldRejectEmptyContent - reject empty content - shouldAcceptContentWith1Character - accept 1-character content - shouldAcceptContentWithMultipleCharacters - accept content with multiple characters5. Duplicate title validation tests - shouldAllowFirstPostWithTitle - allow the title of the first post - shouldRejectDuplicateTitle - reject duplicate titles - shouldAllowSameTitleAfterDeletion - allow the same title after deletion6. Post saving tests - shouldSaveValidPost - successfully save a valid post - shouldReturnSuccessMessageOnSave - "Saved successfully" message on successful save - shouldReturnErrorMessageOnSaveFailure - "Save failed" message on save failure7. Form validation integration tests - shouldShowErrorForInvalidTitle - show an error when an invalid title is entered - shouldShowErrorForInvalidCategory - show an error when an invalid category is entered - shouldShowErrorForInvalidContent - show an error when invalid content is entered - shouldShowErrorForDuplicateTitle - show an error when a duplicate title is entered8. UI component tests - shouldRenderPostForm - render the post writing form - shouldRenderTitleInput - render the title input field - shouldRenderCategoryInput - render the category input field - shouldRenderContentTextarea - render the content input area - shouldRenderSaveButton - render the save button9. User interaction tests - shouldUpdateTitleOnInput - update state on title input - shouldUpdateCategoryOnInput - update state on category input - shouldUpdateContentOnInput - update state on content input - shouldTriggerSaveOnButtonClick - trigger saving when the save button is clicked10. Toast message tests - shouldShowSuccessToastOnSuccessfulSave - success toast on successful save - shouldShowErrorToastOnFailedSave - failure toast on failed save - shouldHideToastAfterDelay - automatically hide the toast after a set timeTest RulesProceed in order from the topMark each test as done by changing its checkbox from [ ] to [x]Implement only one test at a timeMove on to the next test only when all existing tests passRefactor only after the tests passThen, once I hand the plan.md above to the AI and shout go in the prompt, it'll work through it step by step. But as it goes, it keeps creating validation logic on the spot whenever it needs it. So what should we do?? It seems like a good idea to beef up the md guidelines so it uses the Validator object we've already built. But this guideline doesn't seem like a general-purpose one. It seems better to make it a separate md. (Putting a lot of context in at once costs more money!! Let's save tokens while getting maximum efficiency)
VALIDATOR.md, or FORM_GUIDE.mdRules to follow when developing a FormOrder: field definition → Validator connection → UI displayExample code (a simple Input + Validator combination)"Don't check validity with conditionals directly inside the Form""If a validation isn't in the Validator object, add it first and then use it"Example:const TitleValidator = Validator.string() .min(2, "Title must be at least 2 characters.") .max(10, "Title can be up to 10 characters.");Now you just attach this FORM_GUIDE.md to the prompt when you need form validation, and leave it out otherwise.
3. Wrapping Up
There's something every developer is wrestling with in this day and age: AI. It might be fear, it might be joy at the higher productivity, it might be feeling down because you used to enjoy writing code yourself and now the meta has changed, or it might be a complicated mix of all of these. I think developers worry about it more than any other profession, because we're the ones using it on the very front lines and watching it grow. But whether we like it or not, right here and now, it seems we need to know how to use AI well. And it seems the era where you need to be good at architecture and design to use AI well has already arrived. This era may pass quickly too, and an era may come where only a tiny handful of geniuses are needed, but for now, I think we have to adapt to the present as it is.
References
