Search
Close this search box.
Search
Close this search box.
Search
Close this search box.

Time To Reorg – An Intro to Refactoring

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Organizations reorg all the time. And again. Why do they do that? Setting cynicism aside, organizations reorg to adapt to new realities, to new demands. A team of 5 people that grew to 20 people needs to split to smaller teams. A business group dealing with a fast-growing market needs to come up with a new strategy to cope with the demand. A startup of 20 people will need a different structure than that of a company of 100 people. As business demands change there is a need to adapt the organization’s structure.

Reorg is an expensive venture, yet organizations do it again and again. Because they have to do it – they have no choice.

In a similar manner, the codebase of a product needs to be reorganized again and again to adapt to changing circumstances. A class that has more and more methods needs to split into smaller classes, otherwise, it will be very difficult to maintain it. A conditional (If-Else statement) that grew up to a monster needs to be shrunk again, otherwise, it will be prone to defects. A once simple interface that grew and expanded needs to have some wrapper to make clients’ work bearable.

In fact, taking a hike on Conway’s Law it makes sense that refactoring will somehow be related to reorg, at least in the sense that a change in the organization structure is related to adaptations in the codebase.

We call the process of adapting the codebase “refactoring” – changing the structure of the code not to get new functionality but to make the code better adapted to our new demands, business and technical alike.

Unlike reorgs, refactoring is part of the ongoing work of every developer. Every time a developer is handling code she needs to think about whether she should change the structure of this code. Should the method be renamed? Should a new interface be extracted? Should she replace the conditional with subclasses?

Just like dev doesn’t work without test, dev and test don’t work without refactoring. There are many cases where refactoring is a key player in making the code testable (but I’ll write about it some other time).

I’ve never been in a scouts’ camp but I hear they’re supposed to leave it in better shape than they found it. In the same spirit, a developer should leave the code in a cleaner state than she found it.

Two issues immediately arise, though: First, refactoring takes time. Correct. Reorgs also take time, yet we do them. Refactoring takes less time and provides faster results.

The second issue is that constant refactoring will make the system change all the time. Changing names, changing structure. Won’t that be counterproductive? Won’t that inhibit maintenance? “I’m used to looking for method err4get and now someone renamed it”. The idea is that refactoring should make the system more maintainable. If it makes it less maintainable – don’t do it. Names should be clearer, the structure should be easier to understand, and easier to test and change. Getting into a state of mind that we’re not afraid to make changes in our code is a healthy thing.

Every time your organization goes through another reorg you should ask yourself when did you invest such efforts in your codebase. Codebase reorg should happen all the time, on small scale, getting the code ready for the coming business challenges.

Subscribe for Email Updates:

Categories:

Tags:

Daily Scrum
ATDD
Lean and Agile Techniques
Scrum With Kanban
Business Agility
Scrum
Principles of Lean-Agile Leadership
WIP
NIT
Applying Agile Methodology
QA
Accelerate Value Delivery At Scale
Agile Project
Slides
Lean Budgeting
Agile Testing Practices
RTE Role
User stories
Story Slicing
System Archetypes
LAB
Lean Startup
Jira admin
Legacy Enterprise
DevOps
ART Success
Spotify
Kaizen
Perfection Game
Agile for Embedded Systems
Agile and DevOps Journey
Continuous Planning
Lean Risk Management
Release Train Engineer
Jira Plans
Games and Exercises
Process Improvement
Elastic Leadership
Advanced Roadmaps
Scrum Master Role
predictability
Code
Quality Assurance
Iterative Incremental Development
Test Driven Development
SPC
GanttBan
AgileSparks
Enterprise DevOps
Software Development Estimation
ROI
Agile Development
Agile Contracts Best Practices
BDD
The Agile Coach
Agility
Agile Community
Acceptance Test-Driven Development
Hybrid Work
Planning
Implementing SAFe
Nexus and SAFe
POPM
ScrumMaster Tales
Atlassian
Lean-Agile Budgeting
Limiting Work in Progress
Agile Delivery
AI Artificial Intelligence
SAFe Release Planning
Achieve Business Agility
Scrum Master
Engineering Practices
Entrepreneurial Operating System®
Reading List
Introduction to Test Driven Development
The Kanban Method
Scrum Guide
Professional Scrum with Kanban
Kanban 101
Sprint Planning
Certification
Managing Projects
Agile Risk Management
Sprint Iteration
Kanban Game
Agile India
Amdocs
Keith Sawyer
A Kanban System for Software Engineering
Scrum Values
Lean Agile Basics
Jira Cloud
Agile Project Management
ARTs
PI Planning
SAFe
Agile Product Development
Team Flow
LPM
Professional Scrum Master
Program Increment
RSA
Certified SAFe
Value Streams
Lean and Agile Principles and Practices
Risk Management in Kanban
Software Development
Artificial Intelligence
Agile Assembly Architecture
ALM Tools
Portfolio for Jira
Managing Risk on Agile Projects
LeSS
System Integration Environments
Nexus and Kanban
Kanban
Agile Exercises
Scrum.org
EOS®
Operational Value Stream
Agile
PI Objectives
Change Management
Coaching Agile Teams
Agile Outsourcing
Development Value Streams
Product Ownership
Continuous Integration
Tips
Frameworks
Lean-Agile Software Development
Self-organization
Nexus
Scrum and XP
Lean Agile Organization
Lean Agile Management
Implementation of Lean and Agile
TDD
Manage Budget Creation
Agile Basics
Agile Release Planning
agileisrael
Agile Mindset
Agile Israel
Tools
Webinar
Kanban Basics
speed at scale
Product Management
Continuous Improvement
ATDD vs. BDD
Scaled Agile Framework
Video
Risk-aware Product Development
Kaizen Workshop
Lean Software Development
Pomodoro Technique
Professional Scrum Product Owner
Continuous Deployment
AI
Agile Product Ownership
Rapid RTC
Built-In Quality
Scrum Primer
Lean Agile
An Appreciative Retrospective
Presentation
Jira
Covid19
Risk Management on Agile Projects
Agile Marketing
speed @ scale
Nexus Integration Team
Introduction to ATDD
Lean Agile Leadership
Agile in the Enterprise
Atlaassian
Agile Techniques
What Is Kanban
lean agile change management
Kanban Kickstart Example
Effective Agile Retrospectives
Nexus vs SAFe
Continuous Delivery
Systems Thinking
SAFe DevOps
IT Operations
Agile Games and Exercises
Agile Israel Events
RTE
Sprint Retrospectives
Agile Release Management
Large Scale Scrum
Agile Program
System Team
Releases Using Lean
chatgpt
Legacy Code
SA
AgileSparks
Logo
Enable registration in settings - general

Contact Us

Request for additional information and prices

AgileSparks Newsletter

Subscribe to our newsletter, and stay updated on the latest Agile news and events

This website uses Cookies to provide a better experience
Shopping cart