Chapter 6 - Software Configuration Management
Chapter 6 - Software Configuration Management
Objectives
for the 6th Chapter
Software Configuration
Management
•Program families
•Derivations
•Interfaces
•Baselines and private workspaces
•Procedures
•Applying the principles
On any team project, a certain degree of confusion is inevitable. The goal is to minimise the
confusion so that more work can get done.
The co-ordination of the software development to minimise this particular type of confusion is
called configuration managementSE 2020 -. Vasile Stoicu-Tivadar 4 / 63
Configuration Management - the
problem - continued 2
Configuration management can be applied to project materials other than software:
documentation, test reports, schedules, specifications, plans etc.
Examples: maintainers might find that test cases change mysteriously, or that bug reports
remain open long after the bug is fixed. Managers might find that milestones are accomplished
on schedule, but nobody can agree exactly which schedule was met.
Every software project should have someone assigned to be the configuration manager.
On a project too small for the services of a full-time configuration manager, the job can be
combined with other responsibilities.
The shared data problem - arises when many people are simultaneously accessing and
modifying the same data (eventually program code):
when programmers are modifying a single copy of a program, then changes made by one
programmer can interfere with the progress of others
the most obvious case of interference is when the modification is wrong (a bad fix)
even when a modification is valid, it might change the behaviour of the program in ways that
the entire programming team needs to understand (example: a subroutine is passed arguments
whose meanings are now slightly different)
there are always going to the problems when programmers work together on one piece of
source-code; regardless of how well programmers communicate with each other, there will be
SE 2020 - Vasile Stoicu-Tivadar
times when changes introduced by one programmer are an unpleasant surprise to the others.
6 / 63
Configuration Management - the
problem - continued 4
The simultaneous update problem - because of the shared data problem:
a programmer who wants to modify a module makes a copy of it and changes the copy
the programmer then tests the change to make sure it is valid before making the change in the
shared copy
the likelihood of team progress being spoiled by a defective fix is thereby minimised
when two people are simultaneously updating the same software, is possible to overwrite one
person’s updates
an even worse case can arise when a programmer makes a change that spans multiple
modules (and the update refers only to one of them)
We have a dilemma:
if we keep multiple copies we have the double maintenance problem
if we keep one shared copy of the whole project, the shared data problem is our penalty
if we try to get around the shared data problem by allowing people to make temporary copies
of modules so that they may test without affecting others, then we will losing time because of
the simultaneous update problem
solution
When it comes time to configure a new version the programmer picks from the
library the relevant ones to link together (but chooses the correct version of
each module).
The revisions are illustrated as a stack of cards, with the oldest at the back.
But why are the older versions kept in the library ? (the newest version is intended to supersede the
older ones):
•one reason is that despite the intentions of the programmer, revision N+1 might not be
better than revision N ( perhaps revision N+1 has more bugs than revision N; even if
N+1 has fewer bugs, its bugs may not be a subset of the bugs in revision N - example: 3
bugs fixed, 1 new created)
•they may be needed to reproduce bugs that are present in older software (especially
for the maintenance - reported form the field)
SE 2020 - Vasile Stoicu-Tivadar 11 / 63
Variations
Module variations fulfil the same function for slightly
different situations The variations are illustrated as
coequal alternatives
Are therefore intended to be alternative, implementing a variation set.
interchangeable parts
The hexagon is not itself a
A configuration includes only one variation of any module but a is a notational
given module. mechanism for showing the
The new variations do not supersede old, multiple organisation of the variation
variations coexist as equal alternatives set.
Variations are named, not numbered (because is no
meaningful linear order among them); the name
reflects the purpose it serves.
Reasons why a library might include multiple
variations of a module:
1. alternative variations might support different
types of hardware
2. multiple variations that fulfil alternative
functionalities (example: in a payroll system, multiple The naming convention is an
variations of the state-tax withholding module might exist to important tool for describing the
reflect the differences in the tax lows of each state; or in a relationship among the variations
building security system, variations might describe
SE 2020 theStoicu-Tivadar
- Vasile different
12 / 63
floorplans)
Variations - continued 1
Sometimes a library contains module variations that exist only for purposes of
testing and debugging (might include traces, assertions and data dumps
designed to aid debugging).
Another variation used only during program development: stub
A stub of a module is a variation that does nothing but without crashing
(gracefully). Programmers might build a configuration that references stubs of
those modules they do not want to test, without the risk of being blocked by
bugs other than the ones they are seeking.
The disadvantages:
if the original file should be lost or corrupted, then the entire set of versions is lost
(but regular backup procedure minimises the risk)
the complication involved in representing transformations
Example: if we use the reference to line numbers, if the original file is modified,
such a scheme fails - more sophisticated algorithms are necessary.
Deltas are a good method for representing revisions of modules. It is possible to
use either forward or reverse deltas (forward deltas start with the oldest revision - N-
>N+1 and reverse deltas start with the most recent revision - N-> N-1). Advantage for
the reverse delta - the most recent revision is immediately available. Since the recent
revisions are accessed more often than the older ones, reverse deltas are an
optimisation of retrieval effort, but the drawback is that the most recent revisions might
be subject to change, which would
SE 2020require
- Vasilerecreation of the deltas.
Stoicu-Tivadar 15 / 63
Storing versions of modules - continued 2
3. Conditional compilation - to represent all the versions using one copy of source
code and to include the differences by conditional compilation: source code that is
relevant to only some versions is bracketed by macro commands so that the compiler
can recognise which statements are relevant for which versions. When the compiler is
invoked, it is told which version is to be produced (and it automatically ignores source
statements that are not part of the proper version).
The advantages:
shared code is represented only once, so fixes to the code are effective for all
versions (no double maintenance problem)
avoids the combinatorial explosion that can result if the module is varied for multiple
reasons
Example: if a particular module must support 3 types of input devices and 4 types of output devices,
we will have 12 variations and 12 files. But if conditional compilation is used, the source code will probably
contain 3 conditionally bracketed sections for input and 4 sections of code for output, with no multiplicative
effect.
Disadvantage: vulnerable to loss of all versions if the one file is lost (like the delta
approach)
Conditional compilation can be an effective scheme until the differences between versions become so
complex that the source code is impossible to read (for this reason is used primarily to store
variations, not versions - differences among variations are typically localised and stable, as
contrasted with the random nature of bug fixes).
If we want to use conditional compilation
SE 2020for revisions,
- Vasile the complexity of the source code would
Stoicu-Tivadar 16 / 63
become unmanageable.
Derivations
Many times the fastest approach to find a bug is analysis
of the history of the program - how it was created.
The history of the program is called its derivation.
A programmer can compare the derivations of the last program builds and of the actual
program build and see what modules might introduce errors (modules with higher-
numbered revision). Also, he can compare the differences between the revisions and
identify the possible cause. Thus, the programmer can locate the bug without not one line
of code has been examined.
A precise derivation of a program or module requires:
1. An identification of the tool that created it (example: integrated development
environment used for)
2. An identification of the data that was input to the tools
3. An identification of the options and arguments given to the tool (example: compiler
options)
4. The reason why that particular data, arguments and options were given to the tool
5. The person who was responsible for creating the data
6. The date and time
A derivation should be kept for every file used by the software team (source code,
object code, executables, documentation, schedules, budgets etc.). We can locate
bugs only if we examine a chain of derivations. Each file has attached to it a
derivation; each derivation references other files, and thereby other derivations,
producing a genealogy that SE can be traced until the error is found.
2020 - Vasile Stoicu-Tivadar 17 / 63
Derivations - continued 1
A precise derivation depends on strict control of file names.
Example: is not sufficient to identify all the different stages
simple as module A, the different stages could be named A(1),
A(2)a.s.o. or they could be named A from Sept., 20, 2001, A from
Oct., 10, 2001 a.s.o. (they must be distinguish).
An essential principle of configuration management is that file
names must never be reused. If a file is modified, then a
new version has been created and must receive a new
name.
The derivation of a readable file (source-code, documentation)
includes an explanation of the reason the file was created and
an emphasis on the differences between this file and other
versions. When programmers create a new version of source
code, they record in the derivation the version and the motivation
and details of the changes they made.
•the way that the module accomplishes its purpose -> its implementation
•the logical separation between interface
SE 2020 -and implementation
Vasile Stoicu-Tivadar is essential 21 / 63
Interfaces - continued 1
The author of any given module need
understand only the interfaces between the
module and the others, and need not
understand the implementation of any other
module.
A well-defined interface is useful :
•for debugging - when an author is fixing a bug, as long
as conformity with the interface is maintained,
The interface is like the top of
modifications will not affect the operations of any other
the iceberg, it’s a small part,
module
the only part that anyone sees
•for version development - all of the revisions and
variations are interchangeable
But the real-word solution is not as simple as all those above (bugs, staff turnover, tight
deadlines):
• The author of a module must sometimes help other programmers to find bugs in their
code. Having only one person who understands a critical portion of code creates
unnecessary management exposure.
• Programmers maybe want to improve their professional skills and accordingly to this, to
study other software than the own developed solutions.
Interfaces and implementation must be properly for the software development but not
SE 2020 - Vasile Stoicu-Tivadar
necessarily for people involved. 22 / 63
The Hierarchy of Interfaces
Part of the job of the design phase is to define interfaces that will allow
interchangeability of versions and thereby facilitate configuration management.
Interfaces themselves are objects to be controlled by the configuration manager. Just
like source code, each interface is likely to be revised and varied into multiple versions.
Interfaces are in fact the primary output and purpose of the design phase:
• design begins with the entire software product viewed as a single entity; its
interfaces with the outside world are called the functional requirements
• designers break down (decompose) the software product into a group of
modules and designate the interfaces among the modules
• the process continues recursively until the submodules are so small that their
implementation is obvious
• then the design is complete
At each iteration the designer specifies the component submodules (what they are,
purpose, interaction between submodules).
The interfaces
the module must
meet
SE 2020 - Vasile Stoicu-Tivadar 23 / 63
The Hierarchy of Interfaces - continued 1
The design of the implementation is then expressed with smaller boxes that represent
submodules.
Interfaces among
submodules
As the design process recurses, the submodules are similarily designed, starting with their
interfaces and developing their implementation (what is implementation for the designer of the
module is interface to the designer of the submodule).
A large software development process must maintain a hierarchy of interfaces that reflects the
decomposition of the software:
• top level - functional requirements
• next levels - interfaces among the modules,
- interfaces among the submodules a.s.o.
The decomposition of the software into modules is frequently reflected in the organisation of the
project into teams and subteams -> the interfaces between modules become the interfaces
between teams.
Example: The designer of a product has specified that 2 of the submodules are called
Shelf-Space Allocation and Parts-Description Database. The system designer specifies
SE 2020 - Vasile Stoicu-Tivadar
an interface between the 2 modules called Shelf-Allocation Attributes Interface. 25 / 63
Precision of Interfaces - continued 1
The first revision is
specified by the product designer:
The succeeding revisions describe the exact format of the inquiry, the types and ranges of the data
passed in and out, the handling of errors and further details.
SE 2020 - Vasile Stoicu-Tivadar 26 / 63
Precision of Interfaces
- continued 2
The interface might define special data types (is the used language permits).
2. data interfaces
describe data that is accessed by more than one module (if only one module references data, then
the definition is part of the implementation)
describe shared data (global variables, data stuctures, disk files, external inputs and outputs)
include name, type, meaning, record structures field by field (typically using the precise syntax of the
used programming language),SE time and- circumstances
2020 under which the data is to be changed,
Vasile Stoicu-Tivadar 28 / 63
including the initialisation
Types of Interfaces - continued
Example for the Shelf-Allocation
Module presented above:
The distinction between data and call interfaces is frequently an artificial one. In modern
programming practice, most significant data structures are isolated within modules whose
purpose is to provide access to the data for the other modules.
Often, physical organisation of the databases is hidden as part of the implementation of the
module, and the interface is a call interface to a database manager rather than to a data
SE 2020 - Vasile Stoicu-Tivadar
structure. 29 / 63
Automatic enforcement
There are special text editors that allow free access to one part of the file (the
implementation) and prohibit access to other parts (the interface).
Also, compilers for modern programming languages are designed to help check
for particular kinds of nonconformance to interfaces. It is common to
automatically check subroutine calls to make sure that actual parameters match
the types shown in the subroutine definition.
SE 2020 - Vasile Stoicu-Tivadar 30 / 63
Automatic enforcement - continued
Example: the language ADA represents further advancement in the area of automatic interface
enforcement. The major element of program structure is the package, which is a module with a
precisely defined interface to the other modules of the program. A package’s interface is called its
specification and includes definitions of variables, data types and calling sequences for subroutines.
In the next example, a stack package specifications is shown (includes the definition of the type of
data to be stacked, a publicly accessible variable that holds the number of entries currently on the
stack and the definitions of two procedures – Push and Pop):
The compiler checks for conformance to the
interface even though the interface and the
module that references the interface are
presented in separate compiler invocations.
For our programmer the stability is the issue, not mistakes. He wants a shared database will be unchanged
for his tests. But all the other programmers also want full control, and their productivity depends on it. This need
can cause conflicts. This is the essence of the team coordination problem.
•A solution : In the early stages of the development process, programmers can use private copies of the
source code for individual use, under absolute control. The programmers can work in complete isolation. But they
work for a single product, so when the integration is needed, the isolation is unnaceptable.
•But if each programmer has a copy of the whole source code, we have a double maintenance situation. If a
programmer fix a bug, he must transmit the fix to the other programmers, who must make the change in
their private source code. The workload might be unnacceptable.
•We must devise a mechanism for granting programmers a measure of control over their own stability and
at the same time allow them to integrate their work with the other team members to produce a complete
SEenhanced
product (individual less productivity but 2020 - Vasile
teamStoicu-Tivadar
productivity). 32 / 63
Private Workspaces
One solution to the team coordination problem:
use of project baseline & individual workspaces.
It is necessary for all team members to be able to read the baseline copy
of a module but only one team member has a copy into his private
workspace for update (only one person at a time can borrow, all can read).
We keep a record of who the borrower is so that no one is permitted to
return something that he has not borrowed.
SE 2020 - Vasile Stoicu-Tivadar 35 / 63
Locking - continued 1
The facilities for borrowing and
returning:
charge-out - copies a module from
the baseline into the programmer’s
workspace and puts a lock on the
module so that nobody else may
perform a charge-out
charge-in - copies the module from
the workspace, creating a new
revision in the baseline, also removes
the lock so that other programmers
may make further revisions.
•Providing procedures for every exceptional circumstance results in procedures that are
complicated and difficult to use
•It is more important that the procedures be easy to use in the common case than that they
handle all the cases; no set of procedures can be powerful enough for all eventualities
•The initial designer of the procedures should attempt to foresee the common configuration
management needs
•If pervasive symptoms of confusion appear, new procedures can be developed to address
the problem
•Modification of the procedures must be carefully measured because stability is essential
for productivity (“better” procedures are not necessarily better if the increment in quality is
offset by the instability caused by modification)
•The danger in introduction new adaptation of the procedures is that will induce a greater
confusion than ii removes: a perceived inadequacy in the configuration management might
be just an exceptional circumstance requiring manual intervention rather than a
requirement for new procedures
The detailed design for a module is finished when its packages are described. At
this point the project has a baseline containing a skeleton for each package in the
module. SE 2020 - Vasile Stoicu-Tivadar 50 / 63
Applying the Principles - The coding phase
Goals:
•to minimise divergence between the code and the detailed design
•to structure the code to simplify debugging
•to maximise compile-time checking of conformance to interfaces
Strategy:
•the programmer writes the code for his package by charging-out the existing source-code
(the skeleton) and filling in the algorithms of the subroutines (without manually copy any
design information)
•the strategically placed comments within the skeleton act as reminders of the expected
purpose, side effects, assumptions, error detection a.s.o., encouraging the programmers to
keep them up to date by correcting commentary errors as they find them
•when a package enters the coding phase, a procedure places into the baseline a
specification file for the package - the configuration manager’s mechanism for obtaining
compile-time checking of conformance to interfaces (these will be included by other
packages that make use of the interface provided)
Example: # include directives in C programs
Implementation:
•the configuration manager must
provide a procedure that produces a
specification for each package and
places it into the project baseline
Implementation:
The configuration manager must provide procedures to allow programmers to perform:
•charge-out and charge-in source code for packages
•read-only specifications
•compile and link packages against the most recent copies of specifications and object code
present in the baseline
•a manual procedure for proposing and seeking approval for changes to package
specifications
•procedures restricted for use only by the configuration manager for charging-out and
charging-in specifications SE 2020 - Vasile Stoicu-Tivadar 55 / 63
Applying the Principles - QA, Delivery and
Maintenance
•As delivery nears, the project seeks Quality Assurance certification. It is now necessary to
identify, track and fix bugs in an organised manner so management can decide when to
deliver to the customer.
•After the delivery, bugs will continue to be identified.
•The customer will expect revised deliveries in which the bugs are fixed and new functions
are provided.
Strategy:
•the project continues to use charge-out and charge-in
•in this phase, the programmers no longer make changes on their own initiative, only in
response to reported bugs (to the configuration manager by the customers or by the
programmers)
SE 2020 - Vasile Stoicu-Tivadar 56 / 63
Applying the Principles - QA, Delivery and
Maintenance - continued 1
•for each bug reported, the
configuration manager prepares a
bug report, which contains a
description of the bug and a list
of tests that fail due to the bug
and keeps a log of all bug reports
with open and closed bugs (when
a bug has been fixed)
The team working on the new functionality (development path 2) has one revision
series whereas the rest of the team (development path 1) has its own parallel series.
as team
- to work together and to collaborate with the configuration manager in
order to implement the concepts of the configuration management