Incrementalism

Incrementalism is defined as follows: “Incremental design is directly related to any modular design application, in which components can be freely substituted if improved to ensure better performance.” 1

Working incrementally is about building value progressively. Put simply, this is about taking advantage of the modularity or componentization of our systems.

If working iteratively is about refining and improving something over a series of iterations, then working incrementally is about building a system, and ideally releasing it, piece by piece. This is captured beautifully in Figure 6.1 , taken from User Story Mapping [Patton]. 2

Figure 6.1
Iterative versus incremental

  1. Source: Wikipedia, https://en.wikipedia.org/wiki/Continuous_design

  2. I first saw this comparison between the “iterative” and “incremental” approaches in the book User Story Mapping by Jeff Patton. See https://bit.ly/3s9jvY6 .

To create complex systems, we need both approaches. An incremental approach allows us to decompose work and to deliver value step-by-step ( incrementally ), getting to value sooner and delivering value in smaller, simpler steps.

Importance of Modularity

Modularity is an important idea. It is important in the development of technology but is not specific to information technology. When stone-age craftspeople made flint axes with a wooden handle, this was a modular system. If you broke the handle, you could keep the ax-head and make a new handle. If you broke the ax-head, you could lash a new one to your old, trusty handle.

As machines got more complex, the importance and value of modularity grew along with them. Through all but the last few years of the twentieth century, when an airplane designer wanted to do something new, they divided their work into two major modules: the power plant (engine) and airframe. A large proportion of aviation advancement was carried out as a kind of technical relay race. If you wanted to try a new engine, you tried it first in a proven airframe. If you wanted to try a new airframe, you used a proven power plant.

When the Apollo program started in the 1960s, with the goal of sending men to the moon, one of the early leaps forward was creating a mission profile called a lunar orbit rendezvous (LOR). LOR meant that the spacecraft would be divided into a series of modules, each focused on a specific part of the challenge. There was the Saturn V whose job was to get everything else into Earth’s orbit, and then the final stage was to have another task-specific module propel the rest of the components of the spacecraft from Earth to the moon.

The rest of the Apollo spacecraft was composed of four main modules:

  • The Service Module’s job was to get everything else from Earth to the moon and back again.

  • The Command Module was the main habitat for the astronauts; its main job though was to return the astronauts from Earth’s orbit to the surface.

  • The lunar excursion module (LEM) was made up of the other two modules: the Descent and Ascent modules. The Descent Module got the astronauts from lunar orbit to the surface of the moon.

  • The Ascent Module returned the astronauts to lunar orbit where they rendezvoused, docked, with the Command and Service Modules before heading back to Earth.

This modularity had lots of advantages. It meant that each component could be built to focus on one part of the problem and would need to compromise less in its design. It allowed different groups—in this case completely different companies—to work on each module largely independent of the others. As long as the different groups agreed on how the modules would interface with each other, they could work to solve the problems of their module without constraint. Each module could be lighter because, for example, the Lunar Module didn’t need to carry the means of returning to Earth all the way to the surface of the moon.

Although it is a stretch to call any Apollo spacecraft simple, each module could be simpler than if they were designed to cope with a larger part of the whole problem.

I hope that this diversion is making you think about how this relates to software. Although none of these complex machines was simple, they were minimalist in terms of meeting their needs.

This is really the philosophy of component-based approaches to design, like microservices, or actually any service-oriented design.

Divide the problem into pieces aimed at solving a single part of a problem. This approach has many advantages. Each component of the system is simpler, more focused on the task at hand. Each component is easier to test, is faster to deploy, and sometimes may even be deployed independently of the others. Once you reach that point, and not before, you are really in the realm of microservices.

However, microservices are not the only approach where we can achieve and benefit from modularity in any software system. It is really a matter of taking design seriously.

Taking a modular approach forces you to consider the boundaries between the modules of the system and take them seriously. These boundaries are important; they represent one of the key points of coupling in the system, and focusing on the protocols of information exchange between them can make a significant difference to how easy it is to isolate work and increase flexibility. I explore these ideas in more detail in later chapters.

Organizational Incrementalism

One of the huge benefits that modularity brings is isolation; the internal details of one module are hidden from, and irrelevant to, other modules. This is important for technical reasons, but it is even more important for organizational reasons.

A modular approach frees teams to work more independently. They can each make small incremental steps forward without needing to coordinate, or at least with minimal coordination, between teams. This freedom allows organizations that embrace it fully to move forward and innovate at unprecedented pace.

Beyond the value of the ability to make technical changes incrementally, this approach also frees organizations to adopt an incremental approach to cultural and organizational change.

Many organizations struggle to achieve effective changes in their working practices. Such “transformations” are notoriously difficult. The main barrier to making such a change is always how you spread a solution across an organization. There are two barriers that make this spread of changes difficult. The first is explaining and motivating people to make the change, and the second is overcoming the organizational or procedural barriers that limit its adoption.

The most common approach to implementing change seems to be to try to standardize processes across an organization. “Process mapping” and “business transformation” are big business for management consultancies. The problem is that all organizations, certainly those involved in creative work, are dependent on human creativity. If we could “standardize” the process into a series of steps, we could automate it and eliminate the costly, error-prone people. How many times have you used an automated telephone filtering system and gotten to some menu that doesn’t have an option that matches your inquiry or simply dumps the call? This is because some things aren’t simple to break into simple steps, as anyone who has ever written a computer program will attest.

When we are discussing software development, we are nowhere close to being able to eliminate human creativity from this endeavor. So to enable human creativity, we need to leave room in the process and policies that structure our work for creative freedom. One of the defining characteristics of high-performing teams in software development is their ability to make progress and to change their minds, without asking for permission from any person or group outside of their small team. 3

Let’s pick this apart a little. Let us start with “small teams.” Although we now have more data to back up the assertion, 4 it has long been known that small teams outperform large ones. In his book The Mythical Man Month, Fred Brooks wrote:

The conclusion is simple: If a 200-man project has 25 managers who are the most competent and experienced programmers, fire the 175 troops and put the managers back to programming.

These days, most agile practitioners would consider a team of 25 to be a large team. Current thinking is that the optimum team size is eight or fewer people.

Small teams are important for a variety of reasons, but their ability to make progress in small, incremental steps is an important one. To carry out organizational change, the most effective strategy is to create many small, independent teams and allow them the freedom to make their own changes. This progress can, and should still, be structured. It should be constrained to some degree to allow separate, independent teams to head in a roughly similar direction, targeted at fulfilling a larger-scale organizational vision, but still this is a fundamentally more distributed approach to organizational structure than has been traditional for most big firms.

The key transformation then that most organizations need to make is toward greater autonomy for people and teams to deliver high-quality, creative work. Distributed, incremental change is the key.

Modular organizations are more flexible, more scalable, and more efficient than more traditional organizational structures for software development.

Tools of Incrementalism

My five principles for learning and my five principles for managing complexity are deeply interlinked. It is hard to talk about any of them without referring to the others.

  1. The Accelerate Book describes how teams that take a more disciplined approach to development spend “44% more time on new work” than teams that don’t. See https://amzn.to/2YYf5Z8 .

  2. In their book Accelerate: The Science of Lean Software & DevOps , Nicole Forsgren, Jez Humble, and Gene Kim describe the characteristics of high-performing teams. See https://amzn.to/3g0Lvup .

The most profound tools to enable incrementalism are feedback and experimentation , but we also need to focus on modularity and separation of concerns .

Beyond those deeper principles, though, what are the less abstract ideas that can help us achieve a more incremental approach to change? What is it that we need to do that will allow us to work incrementally?

Incrementalism and modularity are closely linked. If we want to make a change incrementally, we must be able to make that change while limiting its impact in other areas. Working to improve the modularity of our system is a good idea, so how do we do that?

If my code is a big spaghetti ball-of-mud and I make a change in one place, I may inadvertently affect another part of the code. There are three important techniques that will allow me to make such a change more safely.

I can architect my system to limit the scope of the change. By designing systems that are modular and have a good separation of concerns, I can limit the impact of my changes beyond the area of the code that is my immediate focus.

I can adopt practices and techniques that allow me to change the code with lower risk. Chief among these safer practices is refactoring . That is the ability to make changes in small, simple, controlled steps that allow me to improve or at least modify my code safely.

Refactoring skills are often undervalued by developers who seem to miss their import. If we can make changes in often tiny increments, we can be much more confident in the stability of that change.

If I use the refactoring tools within my development environment to, say, “extract a method” or “introduce a parameter,” then I can be confident that the change will be done safely, or I can buy better development tools.

Such tiny changes are also easy to back away from if I decide that I don’t like the results; I can work iteratively as well as incrementally. If I combine my fine-grained incrementalism with strong version control , I am always only a small number of steps away from a “safe place.” I can always withdraw to a position of stability.

Finally, there is testing. Testing , and specifically automated testing, gives us protection to move forward incrementally with significantly more confidence.

There are subtleties to working effectively with high levels of automated testing that we will explore in later chapters, but automated testing is an important component of our ability to make change quickly, with assurance.

There is one more aspect to automated testing that is often missed by people who have not really adopted it as a pervasive part of their daily working practice. That is the impact that testing has on design and specifically the modularity and separation of concerns in our designs.

A test-driven approach to automated testing demands that we create mini executable specifications for the changes that we make to our systems. Each of these little specifications describes the necessary conditions to begin the test, executes the behavior under test, and then evaluates the results.

To manage the amount of work necessary to achieve all of this, we are crazy if we don’t try to make our lives easier by keeping the tests as simple as we can and by designing our system as testable code.

Since testable code is modular with a good separation of concerns, automated testing creates a positive feedback loop that enhances our ability to design better systems, limit the blast radius of mistakes, and make changes more safely. Ultimately, the combination of these three techniques provides a massive step forward in our ability to make changes incrementally.

Limiting the Impact of Change

Our aim is to manage complexity with these techniques, so we allow ourselves to develop systems more incrementally. We will always prefer to make progress in many small steps, rather than a few larger, riskier steps.

As we have already explored, if we have an organization of more than one small team of people creating software, then we can do that most efficiently if those different groups of people are able to make progress independently of one another.

There are only two strategies that make sense, and both are incremental in nature.

We can decompose our systems into more independent pieces, as we have already described in this chapter, or we can improve the speed and quality of feedback that we gather when we integrate our changes through continuous integration.

To make the pieces of our system more independent, we can use the powerful technique of the Ports & Adapters pattern. 5

At any interface point between two components of the system that we want to decouple, a port , we define a separate piece of code to translate inputs and outputs, the adapter . This allows us more freedom to change the code behind the adapters without forcing change on other components that interact with it through this port.

This code is the core of our logic, so being able to change this without coordinating with other teams or people is a big win. As a result, we can safely make incremental progress in this part of the code and then deal with the significantly trickier and costly changes in the agreed-upon protocols of information exchange between components. These changes should, ideally, happen a lot less often, so teams will break one another’s code significantly less often, too.

We should always treat these integration points, these ports, with a little more care than other parts of our systems because they cause more pain when things need to change here. The Ports & Adapters approach gives us a strategy to embody that “more care” in our code.

  1. Ports & Adapters is an architectural pattern aimed at producing more loosely coupled application components; it is also known as Hexagonal Architecture. See https://bit.ly/3cwH3Sd .

Note, this has nothing to do with the technology in use. Ports & Adapters is just as useful—probably more useful—for binary information sent through a socket than it is for structured text sent via a REST API call.

The other important, and often overlooked, tool in managing the impact of change is speed of feedback. If I write some code that breaks your code, then how much that matters is very different depending on when we find out that I broke it.

If we only discover that I broke something months later, then the implications may be serious. If our code is already in production when we find the problem, the implications could be very serious.

If, on the other hand, we find out within a few minutes of my making the change, then it is no big deal. I can resolve the problem that I created, maybe before you even notice. This is the problem that continuous integration and continuous delivery solve.

This means that we can use either, or both, of these strategies to limit the impact of change. We can design our systems to enhance our ability to make changes, without forcing the need to change on others, and we can optimize our working practices to make changes in small, incremental steps. Committing those small changes to some shared evaluation system and then optimizing that evaluation system give us feedback quickly enough to allow us to react to it and to manage any problems that our changes may cause.

Incremental Design

I have been a long-time advocate for agile approaches to software development. In part this is because I see agile as an important step, a “beginning of infinity” step, as I described in an earlier chapter. This matters because it means that we can begin work before we have all the answers. We learn as we incrementally make progress, which is an idea at the heart of this book.

This challenges many software developers preconceptions. Many people that I talk to struggle with the idea of being able to write code before they have a detailed idea of the design they want to create.

Even more find the idea of incrementally architecting a complex system almost inconceivable, but both of these ideas are at the heart of any high-quality engineering approach.

Complex systems don’t spring fully formed from the mind of some genius creator; they are the fruits of working through problems, deepening our understanding, and exploring ideas and potential solutions through sometimes hard work.

In part, this is challenging because it requires that we flip some kind of mental switch, and it demands a certain level of self-confidence that we will be able to solve problems that we don’t yet know anything about when they eventually surface.

My arguments in this book about what engineering really is and what software development really is are intended to give you some help in flipping that mental switch, if you haven’t already.

The confidence to make progress in the face of ignorance of the future is a different kind of problem. In some ways it’s one that has some more practical solutions.

First, we need to accept that change, missteps, and the impact of the unexpected, as our knowledge deepens, are all simply inevitable, whether you acknowledge them or not. It is simply the reality of all complex creation of any kind, and in the context of software development specifically, it is the nature of the beast.

Complaints that “they” always get the requirements wrong are one symptom of this. Yes, no one knows what to build at the start. If they tell you that they do, they really don’t understand the problem.

Accepting that we don’t know, doubting what we do know, and working to learn fast is a step from dogma toward engineering.

We use facts about what we know and have discovered incrementally and, at every stage, look to extrapolate our next step forward into the unknown, based on all of the stuff that we currently believe that we know. This is a more scientifically rational worldview. As physicist Richard Feynman once said, science is “a satisfactory philosophy of ignorance.” He also said:

The scientist has a lot of experience with ignorance and doubt and uncertainty, and this experience is of very great importance, I think.

The techniques of managing complexity are important for several reasons, but in this context of software development, as an act of discovery it is a vital one because they allow us to limit the “blast radius” when our “step forward” turns out to be a misstep. You can think of this as defensive design or defensive coding, but a better way to think of it is as incremental design .

We can choose to write code in ways that are merely a sequence of steps organized, or rather not organized, as a big ball of mud, poorly compartmentalized. Alternatively, we can write code in ways that effectively acknowledge and manage its complexity as it evolves.

If we do the former, then the more tightly coupled, less modular, less cohesive the code, the more difficult it is to change. That is why the properties that allow us to manage the complexity in our code that I keep repeating are important. If we adopt these ideas at every level of granularity pervasively in our work, then we close fewer doors on change, and we leave more options open to make change—even unexpected change—in the future. This is different from over-engineering and writing code that copes with every eventuality. This is code that is organized to make change easier , not code that does everything that you can think of right now.

If I begin writing a system that does something useful and requires that I store results somewhere, then I could do what many developers do and mix the code that does the useful things with the code that does the storage. If I do this and then find out that the storage solution I picked is too expensive, too buggy, or too slow, my only option is to go and rewrite all of my code.

If I separated the concerns of “something useful” from “storage,” then I may factionally increase my line count in code. I may have to think a tiny bit harder about how to establish that separation, but I have opened the door to incremental working and incremental decision-making.

I don’t believe that I am being immodest when I tell you that I think that I am regarded by people who have worked with me as a good programmer. Occasionally, people have called me a 10x programmer. If these things are true, they are not true because I am cleverer than other people or type faster or have access to better programming languages. They are true because I work incrementally. I do what I describe here.

I am wary of over-engineering my solutions. I never aim to add code for things that I don’t know are needed now. However, I do always try to separate the concerns in my design, break out different parts of the system, design interfaces that abstract the ideas in the code that they represent, and hide the detail of what happens on the other side of the interface. I strive for simple, obvious solutions in my code, but I also have some kind of internal warning system that sounds off when my code starts to feel too complex, too coupled, or just insufficiently modular.

I could name a few rules of thumb, such as that I don’t like functions longer than about ten lines of code or with more than about four parameters, but these are only guides. My aim is not small, simple code, but rather code that I can change when I learn new things. My goal is code that I can grow incrementally to fulfill its function as that function becomes clearer to me over time.

Working in ways that allow us the freedom to change our code and change our minds as our understanding deepens is fundamental to good engineering and is what incrementalism is built upon. Striving to be able to work incrementally then is also striving for higher-quality systems. If your code is hard to change, it is low quality, whatever it does.

Summary

Working incrementally is fundamental from building any complex system. It is an illusion to imagine that such systems spring “fully formed” from the minds of some expert or experts; they don’t. They are the result of work and the gradual accretion of knowledge and understanding as we make progress. Organizing our work to facilitate and validate this learning allows us to take, as yet unseen, routes in the direction of progress. These ideas are at the core of what allows us to make progress effectively.