Maturity of Code MGMT 2016 04 06
Maturity of Code MGMT 2016 04 06
Maturity of Code MGMT 2016 04 06
Abstract. Source code quality is often viewed only through the prism of the static analysis and good programming
practices. But there are many other code characteristics which if treated carelessly can entail loss of the entire code or
increased number of incidents in the production environment. The purpose was to depict the neglected traits of source
code management (SCM) and to propose a tool which should address some process vulnerabilities – the encapsulation,
in which the contamination of deployed code is prevented by limiting the input points and the dependency on humans
are minimized. Additionally to the tool a metric has been proposed to measure the extent to which the process is made
hermetic (SCM maturity), preventing code contamination. Finally statistical data is provided for the code integration
pattern – one of the neglected trait of SCM.
Keywords. Source code, quality, proces maturity, software process improvement, SPI, SCM.
1. Introduction
Source code is a vital company asset – it is the core of the digital business. It determines the
behavior of computer systems but is often not visible by the business staff and is not managed
explicitly. When “good code quality” is required, “the compliance with good programming
practices” is meant. It is overlooked that any perfect code can by outdated or licenses
unconsciously used by developers can obligate code’s owner to share it with the whole Internet.
The code can even be completely useless (any further change or maintenance blocked) as there
might be no knowledge or tools to compile it. Missing know-how can effectively limit the
competition between potential suppliers and can strengthen the negotiating position of the current
one. One should also know that it is technically feasible to deliver a fully functional IT solution
without having delivered the compiled part of the source code with all negative consequences for
future development and maintenance.
In less scary scenarios the way you use source code affects the efficiency of IT departments
and the user experience. If you construct 90% of code during integration or user acceptance tests
(see Section 7), either the tests are costly or the production environment is exposed to a serious
threat. All three project dimensions - cost, time, scope/quality are badly affected.
This article is based on author's experience in an implementation of the source code
management process (SCM) in a large telecommunication company using hundreds of computer
systems. The goal of the effort was to depict both threats arising from mismanagement of source
code and ways to avoid negative consequences of the materialization of risks. The following key
questions were formulated at the beginning of the research:
1. What configuration items should be managed to protect the source code?
2. What are the aspects of code quality?
3. What are the risks of a mismanagement?
4. How to design the SCM process in order to address these risks?
5. Can a performance indicator be proposed for the process?
6. Are there any other vital process metrics? For example – how much of the code is
constructed during tests?
As a result of the research a tool has been proposed, which addresses some process
vulnerabilities – the encapsulation, in which the contamination of deployed code is prevented by
1
limiting the code delivery points and the dependency on humans is minimized by enclosing their
knowledge into the process (eg compilation and deployment scripts and tools). The improving
performance of the process can be measured using a commonly understood scale – maturity,
which may be also a part of a customized software maintainability measure, as the ISO 25010 [1]
sees it but does not operationalize it. The term “SCM maturity” was used in a similar context eg
by Forester Consulting [2] and there were many other attempts to create a software maturity
model [3], not to mention ISO/IEC 33004 [4].
The maturity scale is proposed in Section 6, two snapshots of its progress measured during a
vast IT transformation are provided. It is worth mentioning that the scale was used not only for
measurement itself but also as an improvement guide - a checklist of good practices, a target to
be achieved by managers. The goal of the SCM transformation was to provide complete and up
to date source code for a vendor consolidation programme, so the idea behind was to concentrate
on the asset management, not on agility or efficiency.
Three traits from the table will be discussed in more detail later on.
Any discourse about code quality should (but very often fails to) start with its completeness (or
integrity, if ISO terminology is to be followed) and being up-to-date. In order to protect these
valuable characteristics it is proposed to meet a few requirements regardless to what extent the IT
services have been outsourced:
• take care of legal aspects, including the right to independently modify the source code if it
3
is reasonable.
• store the code in your own repository (revision/version control system, in other words) or
at least in one which is maintained by a trusted third party (escrow).
• oversee your manufacturing process to be sure that your source code repository is
consistent at least with your production environment. You can do it by encapsulation of
the code management process (recommended, see below) or by a periodic comparison of
the repository with runtime environments.
• automate as many steps of the process as feasible. Get rid of the human factor.
• review (inspect) your code manually or automatically and measure other process
characteristics (the code integration pattern – see below).
All source code should be conserved, not only that of the biggest or critical systems. It
happens that a loss of source code of a seemingly irrelevant module, which is integrated
(sometimes in an undocumented way) with crucial systems blocks an important change in these
crucial systems. That was exactly the case that gave the author of this article the stimulus to take
up the matter and to spend a few years on it.
5
mainly about the loyalty of supervisors, ownership of tools and procedures and their
location.
When the transformation started more than half of the code was not in the repository. After
fifteen months nearly all compiled systems had their own compilation automation, many
compilation scripts were written from scratch as suppliers did not want to provide them or there
was not any contract relationship with any supplier at that time. About one third of systems (71 of
total 197) stayed at the level 3 as they had no compiled components.
Fig. 2. The progress of code maturity within a SCM transformation carried out by the author
– the share of maturity levels within 197 systems.
7. The code integration pattern – have the changes been well tested?
There is a trait of code that requires special attention and which characterizes both the trust in
code and the quality of the whole SCM process. The following questions may be raised during a
software project:
- were all changes planned for the next release ready to be merged to the integration branch
before starting tests?
- in other words - did the changes have the opportunity to be tested?
- were all functionalities expected by business owner developed? At least developed before the
code affected a test case?
This might resemble the “fully merged” trait (see table 1) but it is not about forgetting to conduct
a merge but about an intentional behavior – a decision to start integration or acceptance tests
without having closed the development. Unfortunately the practice to construct source code
7
during tests is very common and may be caused by poor requirements management or inadequate
volume of human resources (developers, testers). This is a pathological phenomenon - a disease
which should be fought as it ruins quality. When there are fixed release deadlines it implies
running untested functionalities. The source code repository lets you easily, quickly and cheaply
measure the percentage of source code delivered at each project phase. If you use Subversion
then 'svn diff' does the trick. If a reasonable threshold is exceeded you can analyze the causes and
risks. This is feasible provided that also the test environments are made hermetic (encapsulated;
see Section 4), not only the production ones. This metric is like a clinical thermometer, it
aggregates all the pathologies which pollute today’s software processes.
The concept to pay attention to the extent of code being constructed during particular project
phases is not new. The code integration pattern was mentioned by Stephen Kan [5] as a “simple
and useful project management and quality management tool” (see also [9]).
The author measured the percentage of code constructed during integration and user
acceptance tests during eighty-one projects, which changed five systems. The value (see table 2)
is underestimated by at least ten percent points as in most cases there was a delay in the code
delivery to the repository or indicated code revisions were late. On average 43% of the code was
constructed during tests.
Number
Average
System of
[%]
projects
System1 5 56,3
System2 12 40,5
System3 14 33,9
System4 10 50,7
System5 40 43,8
Table 2. Average percentage of code constructed during tests
Moreover, the number of projects with the value exceeding 80% was nearly the same as these
below 20%.
Fig. 3. Frequency of particular code integration patterns (the percentage of code constructed
during tests)
This data is presented to visualize the scale of the problem within modern companies, which
aspire to become “digital” ones.
8. Some other interesting topics
Many other interesting aspects related to the management of source code have been omitted here,
which are a source of potential risks and opportunities, for example:
• organization of work in the repository, including issues so meticulous as permitted
directions of promoting bug fixes in the project branches, regime of code merges, naming
of branches.
• measurement of size changes in a software (backfired function points)
• monitoring of code delivery and its impact onto work efficiency (Hawthorne effect [10])
• which programming language to choose to reduce lock-in to suppliers or meet expected
performance goals?
Summary
There are many code characteristics which if treated carelessly can entail loss of the entire code
or increased number of incidents in the production environment. Most of the risks described
above are due to innate imperfect human nature. Software suppliers and employees will always
want to have a better negotiating position by monopolizing know-how wherever possible. By
automating tasks we can make the software process repeatable and self-documenting and the
negative consequences of losing an employee are mitigated. Instead of a vague Word document
XML files are used (eg. Jenkins jobs). The automation is often already used by software
suppliers, mainly to oversee the work of subcontractors and their employees. No additional effort
to be claimed and reimbursed!
Therefore, the code management is not just a matter of engineering – it helps maintain
competition in the supply of software and exerts pressure on the suppliers bids, thus it assists in
building competitive advantage.
References
1. ISO/ IEC CD 25010, Software Engineering: Software Product Quality Requirements and
Evaluation (SQuaRE) Quality Model and guide. (2008)
2. Continuous Delivery: A Maturity Assessment Model. Forrester Consulting (2013)
https://info.thoughtworks.com/Continuous-Delivery-Maturity-Model.html [16 March 2016]
3. Schweigert T., Vohwinkel D., Korsaa M., Nevalainen R., Biro M.: Agile maturity model:
analysing agile maturity characteristics from the SPICE perspective. Journal of Software:
Evolution and Process. DOI: 10.1002/smr
4. ISO/IEC 33004 2nd Edition, Information technology — Process assessment — Requirements
for process reference, process assessment and maturity models. (2015)
5. Kan, S. H.: Metrics and Models in Software Quality Engineering. pp. 242, Addison-Wesley,
Boston (2004)
6. ISO/IEC TR 9126-3, Software Engineering - Product Quality - Part 3: Internal Metrics.
(2003)
7. DeMarco, T.: Controlling Software Projects: Management, Measurement and Estimates. pp.
3, Prentice Hall, Upper Saddle River (1982)
8. Wagner S.: Software Product Quality Control. pp. 36, Springer-Verlag, Berlin (2013)
9. Laird, L.M., Brennan, M.C.: Software Measurement and Estimation: A Practical Approach.
pp. 186, IEEE Computer Society Press, Los Alamitos (2006)
9
10. Landsberger, H. A.: Hawthorne Revisited: Management and the Worker, Its Critics, and
Developments in Human Relations in Industry. Ithaca, Cornell University (1958)