> Markdown version of [/videos/381-keep-your-code-refactorable](https://www.wearedevelopers.com/videos/381-keep-your-code-refactorable). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Keep your code refactorable Fragile code isn't just a technical annoyance; it's a silent financial threat. Learn how TDD, expressive naming, and rich commit histories keep your systems safely refactorable. - **Speakers:** Gerrit Stapper - **Event:** World Congress 2022 - **Published:** June 15, 2022 - **Duration:** 26:46 - **URL:** https://www.wearedevelopers.com/videos/381-keep-your-code-refactorable ## Summary Refactoring is often defined as altering the internal structure of software without changing its observable behavior—a practice heavily championed by software engineering pioneers like Martin Fowler. However, in environments driven by tight deadlines and intense pressure, developers frequently fall into a vicious cycle of cutting corners by skipping tests and documentation. This "it works" mindset degrades codebase quality over time, replacing development speed with a deep-seated fear of breaking fragile systems. To combat this, development teams must cultivate a state of "refactorable code"—an environment that continuously supports safe improvements and feature extensions based on developer confidence. The journey to building this confidence revolves around a continuous coding cycle of reading, concluding, and adjusting. First, improving technical comprehension requires writing highly readable, "speakable" code. By focusing on expressive naming conventions and strict separation of concerns, teams can avoid monolithic god classes that drain mental energy. Transitioning from technical understanding to business context means making implicit domain knowledge explicit. This is achieved by leveraging written unit tests as living technical documentation and maintaining rich Git commit histories that explain not just what was changed, but why certain approaches were chosen and others were abandoned. When it comes time to adjust the codebase, methodologies like test-driven development (TDD) should be viewed primarily as design techniques rather than mere verification steps. Writing tests first forces developers to articulate their desired API before implementation, providing immediate safety and feedback loops. Furthermore, adopting the philosophy of taking much smaller steps allows teams to continuously build, learn, and re-evaluate rather than adhering to rigid, failing project plans. By utilizing version control commits as quick restore checkpoints, developers can confidently iterate without the risk of catastrophic failure. Ultimately, maintaining refactorable code is not just about developer satisfaction; it is a critical financial strategy that prevents costly total system rewrites and ensures the long-term sustainability of the product. **Keywords:** code refactoring, technical debt management, test-driven development, clean code architecture, behavior-driven development, codebase maintenance, git version control, software development lifecycle, separation of concerns, unit testing methodologies, extreme programming, software design techniques, continuous code improvement, agile development practices, living documentation ## Chapters 1. **Defining refactoring and the need for a safe environment** (00:00) — To extend applications without breaking features, improving existing software structure without altering observable behavior establishes a safe development environment. 1. **Vicious cycles caused by time pressure and tight deadlines** (02:57) — Cutting corners on testing and documentation due to tight deadlines creates an ignorant environment where fear prevents developers from making code adjustments. 1. **Building developer confidence to sustain stable software iteration** (06:37) — Treating developers as structural stakeholders who require situational confidence ensures predictable application behavior and mitigates the risk of failing releases. 1. **Producing readable code to speed up technical understanding** (08:38) — Creating speakable syntax and separating business concerns simplifies complex architectures so teams can efficiently navigate and collaborate on shared codebases. 1. **Sharing implicit business knowledge via tests and commits** (14:21) — Creating explicit technical documentation via unit tests and detailed commit histories helps incoming developers grasp legacy logic and correct edge cases. 1. **Safely adjusting code through small isolated test steps** (18:00) — Leveraging test-driven development to establish desired interface layers and committing frequent version control checkpoints reduces the risk of breaking existing features. 1. **Balancing urgent feature deadlines with ongoing refactoring needs** (24:20) — Navigating management pressure requires establishing a functional testing baseline and clearly communicating the systemic risks of continued technical debt. ## Related Moments - [Balancing technical debt and clean code practices](https://www.wearedevelopers.com/videos/100360-developing-the-backend-with-stefan-lingler-cto-at-shpock) (from "Developing the Backend with Stefan Lingler, CTO at Shpock") - [Applying targeted practices to reduce waste and technical debt](https://www.wearedevelopers.com/videos/343-get-old-go-slow-write-code) (from "Get old, go slow, write code!") - [Managing the core conflict over software refactoring](https://www.wearedevelopers.com/videos/787-product-managers-eternal-battle-with-refactoring) (from "Product Managers' Eternal Battle with Refactoring") - [Balancing technical debt reduction with feature delivery](https://www.wearedevelopers.com/videos/1206-single-server-global-reach-running-a-worldwide-marketplace-on-bare-metal-in-a-cloud-dominated-world) (from "Single Server, Global Reach: Running a Worldwide Marketplace on Bare Metal in a Cloud-Dominated World") - [Building and maintaining sustainable software architectures](https://www.wearedevelopers.com/videos/411-it-s-all-about-the-domain-honey-experiences-from-15-years-of-domain-driven-design) (from "It’s all about the domain, honey ! Experiences from 15 years of Domain-Driven Design") - [Introduction to keeping test code clean](https://www.wearedevelopers.com/videos/515-dirty-tests-and-how-to-clean-them) (from "Dirty Tests And How To Clean Them") ## Related Articles - [How to Avoid Over-Engineering](https://www.wearedevelopers.com/magazine/546-how-to-avoid-over-engineering) - [The real reason we document our code](https://www.wearedevelopers.com/magazine/518-the-real-reason-we-document-our-code) - [Get Old, go Slow, Write Code!](https://www.wearedevelopers.com/magazine/81-get-old-go-slow-write-code) - [The Importance of "Not Done"](https://www.wearedevelopers.com/magazine/529-the-importance-of-not-done) ## Related Jobs - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Tribe Lead - ( Software) Engineering Centre of Excllence](https://www.wearedevelopers.com/jobs/ext/1475530-tribe-lead-software-engineering-centre-of-excllence) at **SD Worx** - [Senior Software Engineer, Client Apps Platform](https://www.wearedevelopers.com/jobs/ext/1773893-senior-software-engineer-client-apps-platform) at **GitHub** - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/159190-senior-software-engineer) at **GitHub** - [Software Engineer](https://www.wearedevelopers.com/jobs/ext/1304673-software-engineer) at **Bitpanda** - [Senior Software Engineer, Enterprise Products](https://www.wearedevelopers.com/jobs/ext/1841248-senior-software-engineer-enterprise-products) at **GitHub**