Software Engineering Theory Software configuration management Lena Buffoni/ Kristian Sandahl Department of Computer and Information Science 2015-09-30
2 Maintenance Requirements System Design (Architecture, High-level Design) Validate Requirements, Verify Specification Verify System Design Acceptance Test (Release testing) System Testing (Integration testing of modules) Module Design (Program Design, Detailed Design) Verify Module Design Verify Implementation Module Testing (Integration testing of units) Implementation of Units (classes, procedures, functions) Unit testing Project Management, Software Quality Assurance (SQA), Supporting Tools, Education
3 What is configuration management? Configuration Item Identification Source code modules Test scripts Design documents Build systems SCM
4 What is configuration management? File A v.03 File C v.3.3 File B v0.1 Change File A v.03 File C v.3.4 File B v0.1 Change File A v.03 File C v.3.3 File B v0.11 Baseline - a "snap-shot" of configuration items. Known to work together. Normally reviews in some way. For example a release. How do we control changes?
5 What is configuration management? Configuration Item Identification Source code modules Test scripts Design documents Build systems CHANGE REQUEST Project: Classification: Priority: Date: Change Description: SCM Change Control Board (CCB) Make change decisions. Only large changes (e.g. new major requirements) Configuration control Only authorized people may make changes Larger changes - change requests
6 What is configuration management? Configuration Item Identification Source code modules Test scripts Design documents Build systems Auditing Ensure that the items are complete and consistent. Make sure that the configuration is tested and meets requirements. SCM Configuration control Larger changes - change requests Status accounting Document and report changes to those involved.
SCM tools 7 Change Management Workflow systems Define processes for change requests Change report system Bug-tracking New features Change request (e.g free alternatives: Bugzilla, Trac) What is a bug / what is a feature? Tool examples: Clear Case, Visual Source safe Perforce, CVS Subversion Git Revision Control Systems
8 Zip and E-mail 6. Sends a zip file with code Nahid BAD IDEA 1.Creates GUI module 5. Updates GUI module 8. Sends a zip file with code Daniel 7. Solves a bug in the DBMS Anna 2. Sends a zip file with code 4. Sends a zip file with code Mohamed C RELEASE!! 3. Creates DBMS module
File Server Sharing 9 5. Mohamed uploads the file 4. Anna uploads the file FILE A RG File Server 1. Anna and Mohamed copy file A from server ALSO, A BAD IDEA 2. Anna edits the file FILE A GR 6. Both synchronize, i.e. they copy the files from server FILE A G 3. Mohamed edits the file (independently) Anna Mohamed Anna s change is lost in space
SCM: Lock-Modify-Unlock 10 4. Anna uploads the file, and unlocks 2. Anna locks the file, only she can modify FILE A R SCM Repository 1. Anna and Mohamed copy file A from server A BETTER IDEA, but Rigid, developers cannot work on the same file False sense of security. Can modify two dependent files Ex. Microsoft Visual SourceSafe 5. Mohamed locks the file 3. Anna edits the file FILE A R FILE A G 6. Mohamed edits the file Anna Mohamed
SCM: Centralized modify-merge 11 YR FILE A SCM Repository Pretty good Example CVS, Perforce, Subversion 8. Mohamed commits his change. 4. Anna commits the changes to the repository 2. Anna edits the file FILE A Anna R 1. Anna and Mohamed copy file A from server. This is called Check-out. 7. Mohamed resolves the conflict. FILE A 5. Mohamed makes an update (also called sync) GY Mohamed 3. Mohamed edits the file 6. The system tries to merge the files, but we have a conflict.
SCM: Decentralized modify-merge 12 Pretty good 8. Anna pulls (fetches and merges) down the new changes to her repository. FILE A Public Repository 1. Anna and Mohamed clone the public repository to local repositories. For example Git (quite new, used by e.g. Linux kernel) 5. Mohamed pushes the changes to the public repository. 2. Anna changes and commits to the local repository FILE A Anna 3. Anna sends a patch to Mohammed using email. FILE A Mohamed 4. Mohamed merges, and makes some more changes and commits (locally).
13 History Tree Some concepts Trunk Development Branch Merge and Commit Release branch, tags, baseline
14 History Tree Test Development Branch(s) v1.1.24.1 v1.1.24.2 Commit Merge Trunk v1.0.23 v1.0.24 v1.0.25 v1.0.26 Release Branch(s) or tags v1.2.24
Integration Problem 15 Developer Developer Developer Independent work during weeks How do we integrate? How do we know that integration is correct? Continuous integration Integrate frequently ( Daily ) Important practices: Automated build Automated Test Use of SCM systems
Continuous Integration - Workflow 16 1.Checkout 2. Coding and new tests SCM Repository 8. Update 4. Update 7. Commit Build and Integration Server 9. Automatic Build, Test, Integration 10. Report Web, email etc. 3. Automated build and test locally 5. Resolve conflicts 6. Automated build and test locally
Automation 17 Automated Build Update from SCM (if server) Compile code (make, Maven etc.) Generate documentation (e.g. Doxygen) Daily build, SCM triggered etc. Automated Test Run test suite (Unit tests) Automated system tests Performs automatic regression testing Smoke testing can be used Automated Integration (post processes) Typically just the integration server Create deployment packages (msi, RPM etc.) Automated tags in SCM Automated version numbering
18 Commit and build strategy On commit builds vs periodic builds Push vs. pull requests, code review Test the changes before you commit to the trunk Commit messages
19 Guidelines Automation means that a build must be easy to trigger Continuous integration goes hand in hand with version control Be careful of what you put in the trunk
20 CI tools : Hudson/Jenkins support for version control build/test software projects continuously monitor externally run jobs customizable and extensible
21 A tool does not continuous integration make! Continuous integration is a process Commit regularly Define a commit strategy Keep the trunk stable Maintain the test-suite
The end. Thank you! Questions? www.liu.se www.liu.se