Blog

Strategic Software Modularization – Develop Better Software Faster

By Karl Bråtegren 

What is a Strategic Software Module?

- an introduction to Strategic Software Modularization

Today's software systems consist of a large amount of code, usually a mix of your own and 3:rd party software. The amount of code is a challenge for the human brain, and it is just too much information for us to handle. We need tools to develop, test, and maintain the system efficiently.

Modularization of the system is such a tool, commonly known in the software world as modular programming. Modularization decomposes a system into smaller well-defined pieces, known as modules. The size of a module is manageable for a human. They also have a lot of other benefits for the organization, not only the programmer. Increasing the modularity of the software system will increase the flexibility, agility, and efficiency of the modular system over time.

 In this article we will explain what a software module is and the benefits of a modular system for software.

Document your strategic software module

What is a Software Module?

In software, the term Module has a wide range of different definitions, much like the term Component. Even though it is a term with many different definitions there are commonalities in the descriptions. Let's have a look at some of these descriptions.

Starting with:

A module is a piece of code that can be independently created and maintained to be (re)used in different systems.

and Wikipedia describes modular programming as:

"Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules …"

Which are the commonalities?

A Software Module is Independent

A module shall be independent of other modules, in the sense that it is possible to develop and maintain a module without, or very little, impact on other modules. It does not mean that a module has no dependencies to other modules when running the program.

This is an important aspect of a software module because it helps to increase productivity. Independent modules make the engineering teams more independent of each other when creating, maintaining, and testing the code.

A Software Module is Reusable and Interchangeable

A module can be reused in different systems, and it is also interchangeable (replaceable) within a system. To be able to reuse a module in different systems or products without modification is very beneficial and will help to shorten the time to market.

Interchangeable means that you can replace a module without impacting the rest of the system. This is an important property when upgrading a system because of new features or bug corrections. If you can limit changes to one or a few modules, less time is needed to implement and test changes. More frequent and smaller releases, in terms of impacted parts of the system, enables agility. Smaller releases also mean that you take less risk when releasing new features.

 A Software Module is a Piece of code and a Function

A module is a part of something bigger, a system. The first description above defines the decomposition in terms of code and the second in terms of functionality. Is that a similarity or a difference?

- We would say both. It is about decomposing the system into smaller parts, but:

  • Decomposition in terms of code is about organizing the code where a module is a structural unit. Different programming languages support the software modularization concept but not exactly in the same way. For example, a Python module is a file, but a Java module is much more. A Java module consists of one or many packages (another structural unit) and a descriptor that defines the packages that are exported from the module and the other modules that it requires to work. It is only the exported packages that are accessible for other modules to use.

  • Separating functionality is about organizing logical functions into logical software modules. This is useful when specifying and documenting the architecture of a system. A logical module may be realized by a code module or another structural unit, like a package. In UML (Unified Modelling Language) a modular system can be described with a UML Component diagram.

How Can a Software Module be Independent, Reusable and Interchangeable?

There are some important properties of a software module that make it possible for teams to work independently, making the software module reusable in many systems and interchangeable.

A module…

  1. encapsulates functionality and data. Encapsulation is about hiding the implementation details of a module. The less a module knows about other modules the less dependent it will be to changes in other modules. Other modules can only access functionality and data via the provided interface. Generally, it is good to encapsulate as much as possible.
  2. provides an interface to other modules for accessing its functionality and data. The software module interface should be as abstracted and as small as possible, less details means looser coupling between software modules and makes them more independent, reusable, and interchangeable.
  3. requires interfaces provided by other software modules. To realize the functionality of a software module, it must sometimes use the provided interfaces of other modules. A software module that uses another module through its interface has a dependency to that other module. The fewer dependencies the better. Since non-backward compatible interface changes may occur in a software module’s lifecycle, an update to a module can be forced without any benefit to customers such as better performance, functionality or quality. Forced software updates that do not improve customer benefit should be seen as a cost of complexity in software development.

 Let’s illustrate.

Software Module 1A software module provides and requires interfaces

 

Module B1 provides an interface B to Module A and required two interfaces C and D. Assume we have a new module B2 with improved performance. If Module B2 provides the same interface and requires the same interfaces as B1, then it is interchangeable with B1.

Software module 2

Two software modules that provide and require the same interfaces are interchangeable

 

A module that defines provided and required interfaces become reusable in other systems, e.g. Module B1 can be reused in another system as long as the required interfaces are provided.

Software interfaces - UML component

UML component diagrams can be used to document modules with provided and required interfaces.

 What is a Strategic Software Module?

An often-overlooked aspect of forming software modules is a company strategy. When creating a module with the properties as described above, we typically have a specific intent in mind, and this should be explicit. The intent is expressed by answering strategic questions, such as:

 

  • Is the module formed to collect aspects of the system that will frequently undergo changes?
  • Is the module formed to allow for sourcing the code from a strategic partner?
  • Is the module formed because it requires a certain skill set to develop that only very few people have?

 

As software architecture can easily be circumvented or misunderstood by the coders, it is important to repeatedly go back and look at the reasons why certain functions were grouped into modules. For this reason, we believe it is crucial to state and document the strategic intent of a module. A defined module strategy could even be considered a criterion to call something a module. A software module with a defined module strategy is a strategic software module.

 

In our colleague’s blog post “What is a good modular system", he explains that a modular system must be both flexible for a large scope and live for a long time. By creating strategic software modules, the chance of a longer lifetime is increased, and robustness becomes less person-dependent.

 

How to Document a Strategic Software Module

Documenting a strategic software module is different from traditional software documentation. The strategic software module should encapsulate function, define interfaces, and be driven by strategy. This is what needs to be documented in a way that is easily communicated, discussed, and explained. One way of doing it is to create a one-page strategic software module specification stored in your document management system. Another flexible way to document these aspects is a wiki.

Strategic software module specification templateExample of a Strategic Software Module Specification in a one-page slide

Strategic software modules deliver increased value over time

To enable efficiency, flexibility, and agility, large and complex systems must be decomposed into smaller parts or modules. Independent modules make the development teams more autonomous, resulting in improved efficiency and shorter time to market. A module is also reusable in different products, and companies with a modularized product portfolio build their products from a mix of common reusable modules.

 

By defining the strategic intent of a software module, you create a strategic software module, which will be more resilient towards change since the reasons of why the modules were formed are documented.

 

It is fascinating that a module with only three simple attributes - encapsulation, interfaces and strategy – can deliver so much value.  Download our PowerPoint template for documenting your Strategic Software Module Specifications below. 

Strategic Software Module template

 

 

KB_thumb2-180x180

AUTHOR

Karl Bråtegren

Senior Manager 

T: +46 8 456 35 00
E: karl.brategren@modularmanagement.com