Dr. U. Assmann, Software
Engineering 1
Configuration Management
Dr. U. Aßmann
Research Center for Integrational Software
Engineering
Dr. U. Assmann, Software Engineering 2
Content
TBasic Concepts
TComponents
TComponent selection
TCollaboration
TProcess Support
TTools
Dr. U. Assmann, SoftwareBasic Concepts
Goal
T
Constructing software from components and frameworks
THave several products, but a large reuse
T
Have several versions
T A new version every 2 years
T
Have several variants
T Portability
Dr. U. Assmann, Software Engineering 5
Software Configuration
Components
Human
Collaboration
Process
Component Model Protection Build support Process support Version model Variant model MergingComponent Selection
Version Selection Variant Selection Component Selection Workspace Product model Composition languages Repository Remote work Consistency controlDr. U. Assmann, Software Engineering 6
History
T
SCCS (Rochkind) 1985
T Files in versions
T Deltas (diffs) between versions T Locking for collaborative work
T
Make (Feldman) 1985
TRCS (Tichy) 1987
TShape (Mahler) 1992
T
Feature Logic (Zeller, Snelting) 1995
Dr. U. Assmann, Software Engineering 7
The Version/Variant Universe
Versions Variants
Objects/Components
Dr. U. Assmann, Software Engineering 8
Alternative View
Historical
(Versions) Logical (Variants)
Dr. U. Assmann, Software Engineering 9
The Variant Parameter Universe
T
A n-dimensional space (with n parameters of k variants)
Parameter A
Parameter B
Parameter C
Dr. U. Assmann, Software Engineering 10
The Variant Parameter Universe
T
A n-dimensional space (with n parameters of k variants)
OS Processor Window system NT Win Linux Mac XSunNews i486 Alpha PowerPC
The Version Universe
T
A branching tree of unknown depth
T
Every new modification either generates a new child
T
Or a branch
0.2 0.3 1.0 0.2.1.1 0.3.1.1 0.3.1.2 1.1 Dr. U. Assmann, SoftwareComponents in Repositories and
Workspaces
Dr. U. Assmann, Software Engineering 13
Components
T Component modelT Files (main case, unfortunately) T Objects T Documents T Often untyped! T Version model T Branching T Variant model T N-dimensional space
T Often realized by conditional compilation with #ifdef’s T Baseline
T Identify a product as a set of components with specific version and variant configuration
Dr. U. Assmann, Software Engineering 14
Repository and Workspace
T
To allow programmer modifications, SCM tools always
maintain a repository and programmer-specific
workspaces
T
Repository realization:
T File (SCCS, RCS) T Set of files
T Tree of files (cvs, subversion) T Object base (Damokles) T Data base (ClearCase) T Graph of files
T Special repository on file system level (odin, prcs)
Dr. U. Assmann, Software Engineering 15
Files As Components (SCCS, RCS)
T The earliest configuaration management tools provided versioningon files.
T There is a working version and a repository version of the file T A change that is commited from the working version to the
repository file is called a delta
T Users may “undo” changes/deltas and retrieve old versions with version identifiers
T 0.1, 0.2, 0.3, …., 1.0, 1.1, …. 2.0, ….<current>
T If two programmers change concurrently, version numbers branch: T 1.0, 1.1,
T 1.2.1.1, 1.2.1.2, 1.2.1.3, …, 1.2.1.7 T 1.2.2.1, 1.2.2.2
T Two branches may be also merged
Dr. U. Assmann, Software Engineering 16
RCS commands
T Checkin (ci)T Create a repository file or update it with a working version T Checkout (co)
T Create a working version from a repository file T Rcsdiff
T Diff two versions T Rcsmerge
T Merge two versions
T RCS stores the newest file as such in the repository file and recalculates older versions by undoing deltas (reverse delta technique)
T SCCS stores the oldest file and recalculates newer versions by applying deltas (forward delta technique) Usually slower!
Dr. U. Assmann, Software Engineering 17
RCS symbolic versions
T
RCS can maintain a baseline, I.e., a set of versions of
files that belong together
T And assign the baseline a symbolic name, I.e., “newYork”
T
RCE (extended RCS) can treat trees and has a visual
user interface
Dr. U. Assmann, Software Engineering 18
View Pathing on Component Trees
(nmake, gmake)
T
Programmers have a view on the test version which has
a view on the official version
... ... ... ... ... ... ... ... ... Official (repository) test Programmer workspace (development)
Simple View Pathing on Trees (cvs)
T
Programmers have a view on the official version
TAll files are physically copied
... ... ... ... ... ...
Development
repository
Commit (checkin) update (checkout)Operations in CVS
TCheckout
T Copy a repository (tree) into a development workspace tree. T Cvs memorizes the repository location, also on the internet T This allows internet collaboration
T All open source projects use CVS
T
Update
T Update the workspace with newer contents of the repository
T
Checkin
T Copy a development workspace into the repository. Merge differences.
T
Diff
Dr. U. Assmann, Software Engineering 21
Optimistic Strategy
T
CVS uses optimistic commit, i.e., repositories are not
locked
T
During update operations, it is hoped that the newer
contents of the repository can be merged with the
workspace easily (that’s the optimism)
T
If two programmers changed the same line in a file
differently, a conflict occurs that cannot be merged
automatically
T
The merged file has to be edited by hand to eliminate
the “diffed” lines.
Dr. U. Assmann, Software
Engineering 22
Component Selection
Dr. U. Assmann, Software Engineering 23
Component Selection
T ..also called Artefact or Variant SelectionT Component selection selects a set of components with version and variant from a repository.
T The selected items form a partial baseline or a complete baseline. T Selection language:
T Files with piece lists (enumeration of files and version numbers) (cvs, prcs)
T Attributes of components (variants, versions, branches, symbolic names, states “locked” “frozen”, …)
T Pattern matching on attributes
T Logic language to build expressions on patterns
T Set based language (Adele) T Feature logic (Zeller ICE)
T The more powerful the language is the better conflicts and inconsistencies can be avoided!
Dr. U. Assmann, Software Engineering 24
Adele
T
Estublier, Universite de Grenoble
TEntity-relationship database
TDependency relations
TSymbolic variant names
T
Set expression based variant selection on attribute
values, constraints, and preferences
T
Query example
Baseline = (window-system=x11
(current status zexperimental))
Dr. U. Assmann, Software Engineering 25
Shapetools
T Lampen, Mahler, University of Berlin T On top of the UNIX file system
T Or the object-oriented data base DAMOKLES T Attributed file system, I.e., nicely integrated with OS
T Variants are expressed as attributes
T Name=myfile, type=c, generation=4, revision=3.0, state=saved,
mode=06444, testlevel=low, project=newYork
T Files have states busy, saved, proposed, published, accessed, frozen T Configuration selection by attribute patterns
T , expresses AND ; expresses OR . expresses end-of-rule: doAnAction:
*.c, attr(author,andy), attr(state, busy) ; *.c, attr(mode=755), attrmax(version).
Dr. U. Assmann, Software Engineering 26
ICE
T
ICE builds on feature logic (A. Zeller)
TIn feature logic terms with attributes
screen1 = [object:screen, resolution:high, speed=high] screen2 = [object:screen, resolution:medium, speed=low]
T
Query example
Baseline = [window-system:x11, {current:C~C, status: ~ experimental}
T
Feature logic unification and resolution can be used for
deduction
T
Easy consistency checking
Dr. U. Assmann, Software
Collaboration
Collaboration Strategies
T
Pessimistic:
T Programmer has to lock parts or the whole repository T Others may read, but not change
T Too restrictive for groups
T
Optimistic:
T Updates are allowed speculatively T Merge problems must be solved by hand T Almost all tools are now optimistic
Dr. U. Assmann, Software Engineering 29
Combination with Regression Tests
T
A regression test feeds a product with a large test suite,
and compares the results with that of the previous
version
T
Regression tests are often poorly supported by SCM
tools
Dr. U. Assmann, Software Engineering 30
Internet Development
T
Cvs has a browser interface, cvsweb
T
That is the basis of almost all large open source projects
now
T
Large sites offer space for open source projects and use
cvs as the base configuration tool
T www.sourceforge.netDr. U. Assmann, Software
Engineering 31
Process Support
Dr. U. Assmann, Software Engineering 32
Build Support
T
Main tool: make (Feldman 1975)
T Exists in about 30 variants
T Gmake (gnu) is one of the powerful ones T Cook, odin, are other nice ones
T
Rule based
T If component A is newer than its dependent component B T Then redo B’s production
T
Lazy system builds
T Systems are rebuilt (recompiled, relinked, reconfigured) only if something has changed
Dr. U. Assmann, Software Engineering 33
Make as Wavefront
T It builds a graph ofdependencies between components from the rules
T Annotates the actions from the rule to the edges T That must be acyclic T Make detects which nodes in
the graph have changed, I.e., are newer as their successors T And then executes a wavefront
on the dag
T Executing the production actions annotated to an edge
Base components
Product changed
Dr. U. Assmann, Software Engineering 34
Auto Configuration
T
Gnu autoconf is a makefile generator
T Generates a configure script
T configure generates at installation time makefiles for different machines, operating systems, environments automatically
T
Based on macro processing and a macro library
TOther tools
T Amake T Perl tools Dr. U. Assmann, SoftwareOther Tools
PRCS
THilfinger, Berkeley
TIs a nice improvement of cvs
T
Usually faster since after a commit it does not update
workspace files (which cvs does)
T
Maintains information about the product centrally in a
project file *.prj
T
Simpler management of the projects
TInternet version is being worked on
Dr. U. Assmann, Software Engineering 37
Rational ClearCase
T
One of the market leaders in commercial SCM
TGood quality control over complete projects
TStores attributes with files
T
Files are stored in a database
T
Support of subsystems (packages): identifiers, releases
TActivity table for merge of subsystems
T
Smart recompilation of parts
Dr. U. Assmann, Software Engineering 38
Subversion
T
Newest hit of the internet open source projects
Thttp://subversion.tigris.net
T
Allows everything based on html browsers
TFully internet based
T
Automatic conversion from cvs
Dr. U. Assmann, Software Engineering 39
Literature
T J. Estublier. Software Configuration Management: A Roadmap. Future of Software Engineering, Limerick, Ireland. ACM 2000. T A. Midha. Software Configuration Management for the 21stCentury.
Bell Labs Technical Journal 1997.
T S. Dart. Concepts in Configuration Management Systems. CMU. T A. Zeller. Unified Versioning through Feature Logic. ACM
transactions on Software Engineering and Methodology. Vol 6, No 4, 1997.
T A. Mahler, A. Lampen. An Integrated Toolset for Engineering Software Configurations. IEEE Sup. On Practical Software Development Environments. SE Notes 13, No 5. T R. Conradi, B. Westfechtel. Version Models for Software
Configuration Management. ACM Transactions on Programmming Languages and Systems.