Lecture Notes On Software Configuration Management: Zia Syed Carnegie Mellon University
Lecture Notes On Software Configuration Management: Zia Syed Carnegie Mellon University
Lecture Notes On Software Configuration Management: Zia Syed Carnegie Mellon University
Lecture Notes on
Software Configuration
Management
Zia Syed
2
Carnegie Mellon University
v The problem:
w Multiple people have to work on software that is changing
w More than one version of the software has to be supported:
– Released systems
– Custom configured systems (different functionality)
– System(s) under development
w Software must run on different machines and operating
systems
v Definition:
w A set of management disciplines within the software
engineering process to develop a baseline.
Forward Definition!
v Description:
w Software Configuration Management encompasses the
disciplines and techniques of initiating, evaluating and
controlling change to software products during and after the
software engineering process.
v No fixed rules:
w SCM functions are usually performed in different ways
(formally, informally) depending on the project type and life-
cycle phase (research, development, maintenance).
v What are
w Configuration Items
w Baselines
w SCM Directories
w Versions, Revisions and Releases
promote()
release()
Define
Defineconfiguration
configurationitems
items
Examples:
Baseline A: The API of a program is completely defined; the bodies of
the methods are empty.
Baseline B: All data access methods are implemented and tested;
programming of the GUI can start.
Baseline C: GUI is implemented, test-phase can start.
Baseline A (developmental)
All changes relative to baseline A
Baseline B (functional)
All changes relative to baseline B
Official Release
v Programmer’s Directory
w (IEEE Std: “Dynamic Library”)
w Completely under control of one
programmer.
Promotion
v Master Directory
w (IEEE Std: “Controlled Library”) Central source
w Central directory of all code archive
promotions.
Release
v Software Repository
w (IEEE Std: “Static Library”)
Foo’95 Foo’98
w Externally released baselines.
Promote Release
Policy Policy
User
Master Software Repository
Programmer
Promotion Directory Release
v Approaches for controlling change to libraries (Change Policy)
w Informal (good for research type environments)
w Formal approach (good for externally developed CIs and for releases)
Define
Defineconfiguration
configurationitems
items
Define
Definepromote
promote/release
/releasepolicies
policies
v Version:
w An initial release or re-release of a configuration item
associated with a complete compilation or recompilation of
the item. Different versions have different functionality.
v Revision:
w Change to a version that corrects only errors in the
design/code, but does not affect the documented
functionality.
v Release:
w The formal distribution of an approved version.
Define
Defineconfiguration
configurationitems
items
Define
Definepromote
promote/release
/releasepolicies
policies
Define
Defineresponsibilities
responsibilities
v Examples:
w RCS
– very old but still in use; only version control system
w CVS
– based on RCS, allows concurrent working without locking
w Perforce
– Repository server; keeps track of developer’s activities
w ClearCase
– Multiple servers, process modeling, policy check mechanisms
Define
Defineconfiguration
configurationitems
items
Define
Definepromote
promote/release
/releasepolicies
policies
Define
Defineresponsibilities
responsibilities
Set
Setup
upconfiguration
configurationmanagement
managementsystem
system
v Configuration Manager
w Creates one central repository for all developers.
w Structures the repository by defining modules which
represent directory trees.
v Developer
w Has his/her own working directory.
w Selects the part of the repository (modules) he wants to work
with.
w Receives copies of all these modules. He can then work on his
local copies.
w Adds new files to the repository.
w Modifies existing ones.
w Resolves conflicts when two developers have edited the same
part of the same file simultaneously.
v Before you can use CVS, you have to set the following
two environment variables:
w Variable: CVSROOT
w Value: <Directory has to be defined>
w Variable: EDITOR
w Value: <Your preferred editor>
v Set this variables in your login-scripts so that you can be
sure, that they definitely exist when you are working in
the computer lab.
There
Thereisisnothing
nothingspecial
specialto
todo
dowhen
whenyou
you
create
createthe
theworking
workingdirectory.
directory.All
Allyou
youneed
need
isisaadirectory
directory (here called Example) andtwo
(here called Example) and two
environment variables indicating where
environment variables indicating where to to
find
findthe
therepository
repositoryand
andwhich
whicheditor
editorshould
should
bebeused
usedfor
fortyping
typingcomments,
comments,etc.
etc.
Thecvs
The cvscheckout
checkoutcommand
commandcreates
createscopies
copies
of
ofthe
thefiles
filesin
inthe
therepository
repositoryin inyour
yourlocal
local
directory.
directory.YouYoucan
canretrieve
retrieveeither
eithersingle
single
files or complete directories
files or complete directories . .
The
Theletter
letterininfront
frontof
ofthe
thefile
filename
name
indicates the performed operation
indicates the performed operation
on
onthe
thefile.
file.The meansupdated.
TheUUmeans updated.
Create
Createaanew
newfile
filein
inthe
theeditor
editor
You
Youcan
canwork
workwithwiththe
thefiles
filesin
inthe
theworking
working
directory
directory as if CVS does not exist. Youcan
as if CVS does not exist. You can
edit
editor
orcompile
compilethem
themand
andyou
youcan
canalso
alsocreate
create
new
newfiles (hereGoodbyeWorld.java).
files(here GoodbyeWorld.java).
Files
Filesand
anddirectories
directoriescan
canbe
beadded
addedwith
with
thecvs
the cvsadd
addcommand.
command.The Theadded
addedfiles
files
become
become visible to other developersafter
visible to other developers after
the next cvs commit (see slides 48/49).
the next cvs commit (see slides 48/49).
To
Toupdate
updateyour
yourlocal
localworking
workingdirectory,
directory,runruncvscvsupdate.
update.
You
Youget
getaalist
listof
ofall
allfiles
fileswith
withaaletter
letterindicating
indicatingthe the
performed
performed operation on the file during the update.The
operation on the file during the update. The
most common operations are “U” (file has been
most common operations are “U” (file has been updated), updated),
“M”
“M”(file
(filehas
hasbeen
beenmerged),
merged),and
and“?”“?”(file
(fileisisunknown).
unknown).
CVS
CVSdoes
doesnot
notlist
listthe
theknown,
known,unchanged
unchangedfiles. files.In
Inthis
this
example,HelloWorld.java
example, HelloWorld.javahas hasbeen
beenupdated.
updated.The Thenew
new
version prints the string three times.
version prints the string three times.
v The text from your working file appears at the top, after
the `<<<' characters; below it is the conflicting text from
the other developer. The revision number `1.9' indicates
that the conflicting change was introduced in version
1.9 of the file, making it easier for you to check the logs,
or examine the entire change with cvs diff.
Thecvs
The cvsupdate
updatecommand
commandthrows
throwsaawarning
warning
when
when a merging conflict occurs. Youhave
a merging conflict occurs. You havetoto
resolve
resolvethis
thisconflict
conflictmanually
manuallybefore
beforeyou
youcan
can
commit
commityour
yourchanges.
changes.
These
Theseare
arethe
theconflicting
conflictinglines
linesof
ofcode.
code.The
The
developer has to select the correct version
developer has to select the correct version
and
andremove
removethe
the
For
Foreach
eachcommit,
commit,CVS
CVSrequests
requestsananentry
entryfor
forthe
the
log
logfile.
file.The
Theeditor
editorspecified
specifiedby theEDITOR
bythe EDITOR
environment
environmentvariable
variableisisused
usedtotocreate
createthese
theselog
log
file entries. Empty entries are not accepted.
file entries. Empty entries are not accepted.
After
Afterentering
enteringthe
thelog
logfile
filecomments,
comments,all
all
locally
locallymade
madechanges
changesare
arecommitted
committedto
to
the
the repository. Other developers nowhave
repository. Other developers now have
access to them.
access to them.
v You will see the log for this particular file. You get a list
of all revisions including the name of the developer, the
message describing the changes he/she did, the date
and time of the commit and the differences between the
revisions.
v You can find a description of the diff-format in the CVS
documentation on the homepage of this course!
Thecvs
The cvslog
logcommand
commanddisplays
displaysinformation
information
about
about the revisions of a file includingthe
the revisions of a file including the
name
name of the author, date and time whenhe
of the author, date and time when he
committed a particular revision and
committed a particular revision and thethe
comment
commenthe hespecified.
specified.
To
Toremove
removeaafile filefrom
fromthe
therepository,
repository,
remove
removeititfirst
firstfrom
fromyour
yourworking
working
directory.
directory. Otherwise you’llget
Otherwise you’ll getan
an
message
message from CVS. You can thenremove
from CVS. You can then remove
the file from the repository with
the file from the repository with the the
commandcvs
command cvsremove.
remove.This
Thisbecomes
becomes
effective
effectiveafter
afterthe nextcvs
thenext cvscommit.
commit.