We all run into this, whatever the industry. Few companies can afford to deliver a product to a client and then forget about the work they produced. Statistics show that the often underestimated software maintenance phase takes at least 60 percent of the time of the whole project, and that figure often reaches 80 percent. That is an enormous amount and seems unrealistic, but unfortunately many of us would confirm these proportions from our own experience. Sometimes we estimate the effort for the whole IT system quite accurately, but wrongly assume that there will be next to no corrections along the way. Unfortunately for us, the reality is quite different, and budgets are usually exceeded "thanks to" these corrections.

Today let's talk about what the maintenance phase consists of, and how to make it a bit easier. From experience we can distinguish several kinds of work that take place during this phase. The article linked above confirms this.

1. Changes

This is one of the reasons the agile movement and the Agile Manifesto came about. The details of requirements rarely stay unchanged from the beginning to the end of a project. Sometimes even things that are crucial for the business side of the whole undertaking change, and that is completely natural. Every idea for an application evolves. A client who comes to a software house with an idea for an IT business has in mind its shape, its business model and, in general, a vision and hopes for the project. But we know that what works in theory won't necessarily work in practice. Some features that seemed to be what users needed most turn out to go unused, and the users themselves ask for something completely different that was not even in the plans before. The idea collides with reality and with actual business requirements. In short, during or after work on the software there is often a need to introduce fixes or new capabilities.

The problem this creates for IT teams and clients alike is that if such modifications are to be introduced while the original scope is still being built, they usually require a new quote and a new effort estimate. Sometimes, however, changes are so inconspicuous that, in the interest of good relations with the client, we introduce them right away, at no extra cost. But we forget that, however small they may seem:

  • they may turn out not to be that small, and in the course of the work it may emerge that implementing them takes real effort,
  • there may be many of them.

Moreover, the time spent on such changes can be quite long and significantly affect the project budget, which always gives rise to misunderstandings if the situation is not explained well. Fortunately, there are several methods an IT team can use to cope with changes in software without taking a loss.

  1. the agile methodologies mentioned earlier, specifically sprints. I have already written about them earlier on the blog, so to learn the concept, I invite you to read that (short) text. The idea of splitting work into short, fixed periods of time, planned according to the client's most immediate needs, naturally helps deal with changes of plan tied to bigger modifications, because there are no such plans. In classic Scrum, future sprints are not laid out in advance, and billing happens for each completed sprint. This means that if the client wants to introduce changes and fixes, they don't have to wait long until the end of the sprint, and the IT team has "room" for such work.
  2. quoting with a buffer, or even listing a buffer for fixes separately. This technique is good in theory, although it may be of limited use: on the one hand it raises questions from the client when they analyze the quote, and on the other we will never estimate the time needed accurately anyway. Still, it's worth keeping in mind.
  3. using prototypes. This applies to fixes that don't change the software dramatically but, for example, add fields or modify behavior in specific places. In that case it's worth spending a moment beforehand to "mock up" the relevant screens and try to "click through" them mentally with the client. That way things nobody thought of earlier, but which will be needed, come up early. I wrote more about prototyping recently.
  4. a service contract, a sensible course of action in a typical maintenance phase, after the main part of the project is finished. The software house then provides the client with services for an agreed number of hours per month, which creates room for introducing changes. There will probably be a separate blog article covering this topic in more detail.

2. Bug fixes

Bugs happen in the software we build. This has been known for years and is often laughed at by many industries, including programmers themselves. I have to admit here that, apart from some cases (especially those related to fintech), IT teams have it blissfully easy compared with builders, for example: corrections can usually be applied quite quickly, "on the fly", and rarely threaten human health, property or life (although the history of computing, sadly, knows such situations too).

Of course, bugs caused by programmers or, say, administrators must be fixed under the warranty (which usually lasts 12 months from the deployment of the software or of the change that caused the bug) and this is not charged extra. Still, such corrections take time and sometimes force urgent action (especially if the software is already publicly available), turning the schedule upside down. We can't escape that, so we have to look for solutions in prevention or in actions that reduce the impact of such bugs on the cost of building the project. It's also worth noting that we are not talking only about typical functional bugs, but also about those that result from misunderstanding the client's requirements.

What can we suggest here?

  1. fixing them as early as possible. Research has long shown that the cost of a fix grows with the phase in which the bug is detected or corrected. One explanation is that a bug in the software may be replicated in other parts of it, or there is simply so much code that any action can trigger an avalanche of corrections. Of course, this is also tied to maintaining a proper architecture and so on, but it's still worth making changes relatively early (which doesn't mean the software house will always drop everything and start diagnosing the problem at once). Prototyping comes in again here, as it helps reduce problems caused by misunderstanding the client's needs.
  2. testing. Everyone understands this topic intuitively and knows that everything introduced into the system should be verified, ideally in a repeatable way and with various scenarios. There is also some tension here (especially in small teams) between manual and automated tests, although that is a somewhat different thread. Either way, a good process for verifying code and functionality helps avoid "pushing" at least the most embarrassing bugs out to the client.
  3. frequent releases. Here we return to agile methodologies and sprints, but this time let's focus on what happens after such a stage ends. The client gets a piece of the product and can see it, click through it, test it and evaluate it. Then various needs for changes come up, along with bugs that did slip through to the server, and with them reports (of course, submitted through Feedybacky). Sometimes, though, clients (usually for lack of time) don't verify what the IT team has published, which is a big mistake and a recipe for higher costs: the sooner imperfections are noticed, the sooner they can be corrected and the less they affect the budget. That's why it's worth asking the client as often as possible to "click through" the system, or even sitting down with them and doing it together.

3. Preventive actions

These are all modifications that result not so much from client reports as from our own predictions about where it's worth protecting ourselves before something bad happens. Most often this covers two kinds of actions:

  • refactoring, which improves the software architecture (or at least its code) and makes working with it more pleasant, thereby reducing the likelihood of introducing faulty changes or replicating "code smells",
  • updating libraries. This is a much harder topic, because such updates can quite often break the software, especially if the new version of a module is not backward compatible.

This kind of fix is particularly problematic because it concerns something the client has every right not to worry about. They care that the application works, and how it is built inside is the software house's responsibility. On the other hand, doing nothing in this area can lead to very ugly code and a faster slide into the "legacy" phase. What's more, after many years we may have to explain to the client that we can't apply certain solutions because they are only supported by newer versions of a library, and that this change will now take a great deal of time.

The solution here is the service contract mentioned earlier, but we should also propose something for the project phase itself. Agile methodologies introduce the retrospective, which helps the team discuss what went wrong in a given sprint and what is worth improving or keeping. That is a much broader topic, but what interests us here are the programmers' proposals about agreeing to write code in a certain way. Again, the earlier certain recommendations are put into practice, the longer the architecture stays "clean". Regular code reviews, and with them the exchange of knowledge, are invaluable here.

For my part, I propose introducing one rule about improving code that helps avoid the really high cost of such "full" refactoring: the Boy Scout Rule, promoted by Robert C. Martin, which says to always leave the code in a better state than you found it. In other words, if while developing the software we see something that isn't necessarily well written, and fixing it takes at most 15 minutes (in the ideal case, of course), then in most situations it's worth doing right away. That way, at a small cost, we gradually improve the structure of our application. It's worth noting, though, that this method will hardly fix huge architectural mistakes.

4. Adaptive changes

This is a variant of the kind of change in the maintenance phase described above, but this time resulting from a mutual decision, and often from the client's choice. It most often concerns the deployment of the software and the discussion about which server will be best. I have written many times on this blog that it's worth discussing such plans at a very early stage of the project, because they can determine the choice of technology. It may turn out, though, that in the meantime the hosting market has changed, or the application is doing so well that, for example, the services have to be moved to the cloud. And that can bring adaptive changes with it.

What I mean here is the need to adapt the software to the conditions of a given infrastructure, different from those we prepared for. Most often these are changes in the backend, introducing statelessness, modifying SQL queries (database engines differ a bit in this respect), but it may also suddenly turn out that, for example, the WebSocket server we carefully prepared cannot be deployed, and live notifications for users have to be handled differently. Generally speaking, these are often very painful changes for a project.

One remedy is the discussion about the planned server solutions mentioned earlier, which lets us prepare the architecture accordingly. It's always better to assume a more pessimistic scenario and possibly modify the application later (improving its performance and so on), because those are the "positive" situations in which the project has succeeded, the client is happy and will spend money on architectural development with more understanding. On the other hand, the situation will almost never be calm when it suddenly turns out that, for example, the server doesn't offer PostgreSQL but the far more popular MySQL, and some of the queries have to be rewritten.

That's why it's worth assuming the pessimistic scenario, although it also pays to "stretch" the architecture if there is even a shadow of a chance that, for example, an API, statelessness or other modifications that strongly affect how the code is written will be needed. This is a very broad topic and involves analyzing specific cases.

Is there only one maintenance phase?

Strictly speaking, yes, and we mean the period that begins when the system is published and made available to users for production use. But there are really several periods in which the changes listed above can occur, after each publication of a version and each release. We rarely remember that when we release even the result of the first sprint, the client may submit comments that we have to address in the second sprint or shortly after it. That's why I like to think that we really have more maintenance phases, and that we can treat them as one zone starting much earlier than the production release.

Summary

The maintenance phase is a difficult and always underestimated topic. It can also potentially cause bigger problems in any project, which is why it's worth knowing how to approach it. What I have presented above are only ideas for "handling" this phase, which in many cases require deeper analysis and planning, and sometimes a change of habits. Whatever else you do, it's worth discussing with the client in advance a plan for jointly reviewing progress and a procedure for handling fixes. It will help avoid misunderstandings and can become the foothold for a longer and fruitful cooperation that both sides are happy with. And I wish that for every project, for you and for myself.

Best regards and thank you, Jakub Rojek