Maintaining and enhancing software to cope with newly discovered problems or new requirements can take far more time than the initial development of the software. Sustainable software is a term we use for practices which take into account the lifecycle costs of software in advance.
According to Sun Microsystems Java coding conventions, 80% of software lifecycle costs are for maintenance. According to the same source, it is very unusual that original authors would develop the software from start to finish. A conclusion can be made that common best practices can lead to remarkable cost savings and ease the transitions when personnel changes occur.
The importance of software life-cycle costs is emphasised in server and mobile applications. In these application domains the product lifecycles are typically long and there can be many supported technology platforms and environments. The cost savings and quality improvements gained by sustainable software methodology can be remarkable. The software architecture stays more manageable, costs are more predictable, and quality assurance is more straightforward.
Software projects in recent years have increasingly been employing so called agile methods, such as SCRUM and Extreme Programming (XP). Agile methods aim to minimise the inefficiency and inflexibility of more rigid development models, and take the customer as a part of the project.
Most agile methods typically divide the project to sprints with duration of one or two weeks. The goal for each sprint is to produce a working, testable part. Feedback is collected from the customer continuously, and work plans for the next sprints are adjusted accordingly.
In our view, agile methods shine with projects that have no fixed requirement lists or the list has a lot of unknowns, the project team is small and the customer is able to participate actively in the project. Fast communication and skilled personnel are essential for project success.
The largest benefits of agile methods are cost efficiency, easy monitoring and the ability to fix the flaws in requirements as the project progresses without a laborious redesign process.
We have applied agile methods for years using different variations, so we know the strengths and weaknesses of the methods well, and can be an efficient part in any agile project.
In our view, the most important tool for sustainable software development is automated testing. Automated testing enables faster development, because the problems caused by changes can be detected and fixed quickly. Without automated testing, all changes have to be tested manually, and this may cause a delay of weeks or months between the introduction, detection and fixing of the bug. According to our experience, this delay may cause considerable unplanned costs and quality risks.
Test driven development is a model where tests are written before implementation. The goal is to detect any issues with interfaces and testability before the implementation is written. We use test-driven development when it is feasible, because we have noticed this approach speeds up interface definition cycle considerably.
Test automation is possible in multiple levels. Unit tests can be used to test and validate individual modules, but automatic testing of user interfaces and larger workflows is equally important. According to our experience, automated testing does not eliminate the need for manual testing, but lessens it, and testing resources can be more efficiently focused.
Another important tool for sustainable software development is version control. Versioning conventions make it possible to maintain multiple parallel version lines efficiently. Version control tools facilitate more efficient progress monitoring and code reviews. In our view, a clear and well documented versioning convention is far more important than the used version control tool to obtain cost savings.
Software development conventions are an important part of our view of sustainable software development. These conventions help make the system easily modifiable, easily testable and internally consistent.
Easy modification of the software is commonly understood as source code being easy to edit. We considered the ease of modification from the point of software life-cycle and noted that the ease of source code modification is only a part of the whole picture. The ease of testing the modifications and ease of deploying the of the modified software are equally important goals. If the software has strong internal cross-dependencies between parts, changes can cause unexpected regressions on testing or deployment. Dismantling unnecessary dependencies and documenting these cross-dependencies is very important.
We have noticed that by building the software into smaller, separate modules may in some cases ease the manageability of the software. Use of interfaces, design patterns and loosely coupled modules allow easier tailoring of the software without compromising the underlying architecture.
Conventions and methods that are truly productive vary from case to case. We are not dogmatic about them, since we see conventions and methods as tools to obtain project goals.