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:

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