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:

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