AI-Assisted Coding: Efficiency and Limits in a Six-Month Refactor
A six-month solo refactoring effort illustrates why faster code generation does not necessarily mean faster software delivery. This article examines scope growth, review bottlenecks, legacy behavior, independent validation, incremental migration, and developer workload, outlining how to turn AI-assisted coding into reliable, sustainable delivery.
1. What a Six-Month Refactor Really Reveals
An engineer with years of production development experience decided to refactor an internal web application alone. The system combined implementations copied from earlier projects with problems accumulated through years of maintenance. The goal was not simply to clean up the code, but to improve workflows and automate some manual operations.
AI-assisted coding tools increased the engineer’s confidence in what one person could deliver. The commitment was to redesign and rework a codebase of roughly 100,000 lines within a few months. Six months later, fatigue and pressure from sustained, intensive work began to expose flaws in the original estimate.
This experience cannot be reduced to “the tools were not powerful enough.” Nor does it support the idea that success requires only more working hours. It highlights a broader engineering reality: faster code generation does not produce a proportional increase in end-to-end software delivery speed.
The reported code volume, tool spending, and personal strain also need to be considered separately. Lines of code do not directly indicate functional completeness. Tool fees represent only part of the cost. Expressions of physical or mental exhaustion should not be treated as medical conclusions.
The more useful questions are which stages become bottlenecks when implementation capacity grows, and how those bottlenecks should be managed.
2. Why Easier AI-Assisted Coding Can Make Projects Harder to Control
2.1 Lower Implementation Costs Encourage Scope Growth
In traditional development, an additional feature usually comes with visible scheduling and staffing costs. Teams therefore have a reason to question whether it is worth building.
AI-assisted coding makes prototypes, pages, and basic business logic easier to produce. Developers may keep adding seemingly reasonable goals: reorganize permissions, unify data models, replace older pages, add reporting, and automate more workflows.
Individually, these changes may make sense. Together, they can create a project whose boundaries keep moving. What began as a refactor gradually becomes a combined effort to redesign business processes, migrate data, change deployment practices, and improve operational capabilities.
At the outset, divide the work into three categories:
- Must complete: Issues affecting security, data correctness, or essential end-to-end business workflows.
- Appropriate for this phase: Changes that directly improve the target workflow and have manageable validation costs.
- Out of scope for now: Improvements with uncertain benefits or substantially expanded dependencies.
This classification does not restrict innovation. It prevents faster generation from being mistaken for unlimited project capacity.
2.2 Faster Coding Does Not Accelerate Every Delivery Stage
Delivering a feature typically involves understanding requirements, designing a solution, implementing it, reviewing changes, testing, deploying, and observing production behavior.
AI-assisted coding primarily helps with implementation. It can support other stages, but it does not guarantee that they will accelerate at the same rate.
A simplified model is:
Delivery time = requirements and design time + implementation time + validation time + coordination time + rework time
Even if implementation becomes much faster, the overall schedule can grow when validation and rework increase.
This is particularly important in legacy systems. Code that runs demonstrates only that certain execution paths do not immediately fail. It does not establish that authorization, exception handling, or data compatibility is correct.
2.3 Generation Can Outpace Review Capacity
A developer may generate far more changes in a day than they can carefully understand and validate. When accumulated review work is skipped, it becomes hidden maintenance debt.
The practical output limit should therefore be determined not by how much more the tool can generate, but by how much the team can reliably accept.
This matters especially in solo projects. One person interprets requirements, implements the solution, and judges whether it is correct. Repeatedly reviewing their own approach can reinforce confirmation bias.
3. Map the System Before Generating Code
3.1 Assess Business Capabilities, Not Directory Size
A codebase of roughly 100,000 lines provides only a rough indication of system size. It says little about business complexity.
A short settlement rule may be harder to migrate than many presentation pages. An inconspicuous state update may encode business conventions developed over years.
System discovery should focus on capabilities such as:
- User identity and access control.
- Business object creation, approval, and state transitions.
- Data imports, exports, and batch processing.
- Notifications, background jobs, and failure retries.
- Audit trails, exception handling, and manual recovery.
For each capability, identify who uses it, which data it reads, which states it changes, which external steps it depends on, and how failures are recovered.
The result should be a maintainable system map, not just a one-time set of meeting notes.
3.2 Establish a Verifiable Baseline for Legacy Behavior
Legacy behavior is not necessarily sensible, but it may reflect genuine business requirements. “Correcting” old logic without confirmation can introduce compatibility problems.
Before refactoring, use characterization tests to capture important inputs and outputs, retain representative anonymized data samples, and document typical business workflows.
Behavior that cannot yet be explained should be marked for clarification rather than left to an AI coding tool to infer.
A behavioral baseline does not mean preserving every old defect forever. Its purpose is to distinguish intentional changes from accidental deviations, giving each behavior change an explicit justification.
3.3 Express Refactoring Goals as Acceptance Criteria
Goals such as “make the system more modern” or “clean up the code” are difficult to verify.
More useful goals describe observable business outcomes: whether a workflow eliminates duplicate data entry, whether an operation has a complete audit trail, or whether a critical task can be retried and recovered after failure.
Define nonfunctional requirements as well, including access control, data consistency, responsiveness, recoverability, and maintainability.
Performance targets should come from the existing baseline and business needs, rather than arbitrary numbers that merely look impressive.
4. Give AI Coding Tools Explicit Boundaries
4.1 Provide Relevant Task Context, Not the Entire Project
For a large codebase, the problem is usually not a lack of information. It is identifying the information relevant to the current change.
Each task should include the business rules, interface contracts, data structures, and test entry points directly related to that work.
An effective task description should contain at least:
- Goal: Which behavior needs to change?
- Scope: Which modules may be modified?
- Constraints: Which behaviors must remain unchanged?
- Acceptance: How will correctness be demonstrated?
- Uncertainties: Which questions require clarification rather than assumptions?
For example, “build a better approval module” is insufficient. The task should specify allowed state transitions, operation permissions, duplicate-submission handling, and behavior after rejection, withdrawal, or an unexpected interruption.
4.2 Discuss the Approach Before Implementing in Batches
Requesting a complete module immediately can embed questionable assumptions in a large amount of code.
A safer sequence is to identify affected components and data, explain the proposed approach and risks, obtain confirmation, implement the smallest necessary change, and then add verification.
Tasks involving data models, authorization rules, or cross-module calls should include explicit human approval checkpoints.
Design suggestions from a tool can be considered as options. A polished explanation is not evidence that a design has undergone sound engineering scrutiny.
4.3 Keep Changes Reviewable
Each change should have a clear purpose. Business behavior changes, data migrations, and large-scale formatting should generally remain separate. Combining them makes diffs harder to review and can cause rollbacks to affect unrelated work.
Every commit should explain why the change was needed, what changed, how it was tested, and which risks remain.
Generated code should be treated as an implementation awaiting review, not as a trusted final answer.
Sensitive information also requires care. Follow organizational data-use policies. Production credentials, personal information, and unauthorized business data should not be entered into a tool simply to provide more complete context.
5. Build an Independent Validation Chain
5.1 Test Business Risks, Not Just Code Paths
A large test count does not guarantee effective validation. Tests should address actual risks:
- Unit tests verify local rules and boundary conditions.
- Integration tests verify data access, transactions, and module interactions.
- End-to-end tests verify the complete path through critical user tasks.
- Regression tests check that the new implementation preserves required existing behavior.
The highest-risk cases are often outside the normal workflow: duplicate requests, concurrent updates, insufficient permissions, interrupted jobs, missing data, and recovery after partial success.
5.2 Avoid Shared Assumptions Between Implementation and Tests
If an AI coding tool generates both the implementation and its tests from the same understanding, the result may be internally consistent but wrong for the business.
Critical acceptance checks should draw on independent sources: rules confirmed by business stakeholders, samples of legacy behavior, explicit invariants, and security requirements.
For an approval workflow, those invariants might be:
Unauthorized actors cannot change approval status; repeated requests cannot apply the same action more than once; every state change must leave a traceable record.
Such constraints are a stronger basis for reliability than “all AI-generated tests pass.”
5.3 Include Security Checks in Every Change
Security should not be deferred until the end of the project. Authentication, server-side authorization, input validation, sensitive-data protection, and audit logging belong in routine reviews.
In particular, hiding a button in the interface is not access control. The server must decide whether an operation is permitted using a trusted identity and business rules, rather than relying on a role field supplied by the client.
6. Migrate Incrementally to Reduce Rewrite Risk
6.1 Deliver Independently Usable Business Slices First
Instead of rewriting every module at once, choose a capability with clear boundaries, visible benefits, and relatively few dependencies. Deliver its complete workflow, from the interface through data processing.
This provides an early test of whether the technical approach is suitable. It also lets business users identify missing requirements.
Later migration work can then respond to real feedback, rather than waiting six months for the first acceptance review of the entire system.
6.2 Plan Data Migration for Recovery, Not Just Execution
A migration plan should cover field mapping, historical data handling, invalid-data checks, and post-migration reconciliation.
Before release, rehearse the migration with anonymized or simulated data and assess how the migration window will affect business operations.
Rolling back the application does not necessarily roll back the data. If the new version has already written data that the old version cannot understand, restoring old code may make the situation worse.
For structural changes, prioritize a compatibility transition and explicitly define rollback limits and recovery paths.
6.3 Verify Business Outcomes After Release
Technical monitoring can reveal system failures, but it cannot fully establish business correctness.
Alongside error rates, latency, resource consumption, and job backlogs, observe whether core workflows complete, how many exceptional states arise, and how often manual recovery is needed.
A migration succeeds when business operations remain stable and critical constraints are satisfied—not merely when the new version has been deployed.
7. Treat Cost and Personal Workload as Engineering Concerns
The cost of AI-assisted coding is not limited to subscriptions or API usage. It also includes reading generated output, testing, rework, deployment, and ongoing maintenance.
Code that is inexpensive to generate but difficult to maintain may ultimately cost more than manually written code.
Teams can track change acceptance rates, defects discovered after delivery, rollbacks, review time, and requirements-to-delivery cycle time.
Lines of code can help describe scale, but they are a poor primary performance metric. Removing duplicate implementations, reducing combinations of states, and shortening troubleshooting paths can create substantial value without increasing code volume.
For solo refactoring projects, limit concurrent tasks, maintain reusable operating instructions, and arrange independent reviews.
Relying on sustained overtime can degrade judgment and allow issues that could have been detected early to reach production.
Fatigue is not evidence of insufficient willpower. It can signal a mismatch between project resources and goals. Repeated delays, rework, and declining attention should trigger a reassessment of scope, priorities, and delivery commitments—not simply longer working hours.
8. Turn Generation Capacity into Sustainable Delivery
The most useful lesson from this intensive six-month refactor is not how much code one engineer can generate. It is that AI-assisted coding changes where software engineering bottlenecks occur.
As implementation becomes faster, requirements boundaries, architectural constraints, validation capacity, and release governance become more important.
A mature approach neither delegates every task to a tool nor rejects the tool altogether. It uses AI within boundaries that remain explainable, reviewable, and reversible.
Ultimately, a refactor should be judged by whether business workflows are more reliable, maintenance costs are lower, risks are better controlled, and developers can continue delivering sustainably.
Only when those conditions hold does faster AI-assisted coding translate into lasting engineering value.
