1 / 35

Software Engineering 2 Configuration Management

Software Engineering 2 Configuration Management. Exercise Timo Wolf Bernd Bruegge. Exercise Requirements. Your Laptop with WLAN Java 1.4 or 1.5 (J2SDK) http://java.sun.com/ Ant http://ant.apache.org/ Subversion Client (SVN) http://subversion.tigris.org/

alena
Download Presentation

Software Engineering 2 Configuration Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Software Engineering 2Configuration Management Exercise Timo Wolf Bernd Bruegge

  2. Exercise Requirements • Your Laptop with WLAN • Java 1.4 or 1.5 (J2SDK) • http://java.sun.com/ • Ant • http://ant.apache.org/ • Subversion Client (SVN) http://subversion.tigris.org/ • Windows Client: http://tortoisesvn.tigris.org • Unix Client: http://subversion.tigris.org/project_packages.html • Mac OS X: http://www.codingmonkeys.de/mbo/

  3. Outline • Mapping the IEEE Standard to Subversion (SVN) • Introduction to Subversion • Subversion exercises • Exercise 1: Create your local Working Directory • Exercise 2: Adding your SPMP to svn • Exercise 3: Check in your changes • Exercise 4: Update your Working Directory • Exercise 5: Managing concurrent changes

  4. User Master Directory Software Repository Programmer Promotion Release CM:Controlling Changes • Two types of controlling change: • Promotion: The internal development state of a software is changed. • Release: A changed software system is made visible outside the development organization.

  5. Standard SCM Directories • Programmer’s Directory • (IEEE Std: “Dynamic Library”) • Completely under control of one programmer. • Master Directory • (IEEE Std: “Controlled Library”) • Central directory of all promotions. • Software Repository • (IEEE Std: “Static Library”) • Externally released baselines. Promotion Central source code archive Release Foo’95 Foo’98

  6. Add Controlled Item Delete Controlled Item Create Release Configuration Manager Copy Create Branch Status Identify Changes Diff Log Check out Add Developer Modify Controlled Item Modify Change Check in Delete Configuration Management Use Cases

  7. Subversion • Subversion is an Open Source SCM • Subversion is based on CVS • Subversion properties: • Atomic commits • File moves and copies are recognized • Branching and tagging are cheap • Designed for the network • Good binary file handling • Directory versioning • Metadata

  8. Apache:Webserver Subversion:SCM trunk :MasterDirectory Working Directory tags :SoftwareRepository Working Directory Mapping SCM Directories to Subversion :Server Computer :Programmer’s Computer :Configuration Manager’s Computer

  9. Apache:Webserver Subversion:SCM trunk :MasterDirectory Working Directory tags :SoftwareRepository Working Directory Event Flow for Use Cases ‘Modify Controlled Item’ and ‘Create Release’ :Server Computer :Programmer’s Computer 1. Commit changes 1.1 Delegate changes 2.1 Delegate 2. Create Release 1.2 Apply changes :Configuration Manager’s Computer 2.2 Copy trunk to tags

  10. Network access over http or https Explore repository with web browser :Mac OS X :Windows :Linux Apache:Webserver Subversion:SCM Berkeley:Database TortoiseSVN :SVN Client Command line :SVN Client Eclipse :SVN Client Data integrity Atomic writes Recoverability Hot backups Subversion Hardware Software Mapping :Server Computer • Many SVN Clients are possible. • Clients are available for • Windows, Unix, Mac OS X. • Integrated Development • Environment plug-ins are available.

  11. Exercise Example Project • Up to 40 multiple users • user1 ... user40 • pass_1 ... pass_40 • One Master Repository containing the source code for a project called ARENA • One Software Repository • URL for Master and Software Repository http://tum.globalse.org/projects/SE2005/svn/

  12. Example Project: SVN Repository Structure http://tum.globalse.org/projects/SE2005/svn/ trunk/ arena/ docs/ branches/ issue-1003/ wolf/ tags/ alpha-1/ 1.0.0/ 1.0.1/ Just an example – you are free to structure the repository in whatever way fits your project’s needs and goals

  13. Example Project: Screenshots of Browser Window and Mac OS X Finder Window http://tum.globalse.org/projects/SE2005/svn/

  14. SVN Revision Numbering • Small terminology change • IEEE version => SVN Revision • Global revision number rather than individual numbers • Example: • Allows you to talk about “revision 050204” • Unique identifier for different development states of your system • Each revision corresponds to a single check in of a Controlled Item • Each revision consist of: Number, author, log message, and date • SVN Client View is tree based, similar to names in hierarchical File System • Directories are also controlled items

  15. Realizing releases with SVN Tags • Subversion implements “cheap copies” • Releases are realized as Tags • Tags are copies of the SCM directory (called trunk in svn) which cannot be changed • Might not even be necessary if you simply record the global revision number that built your product • Branches are just copies of the SCM directory • Make changes in the copy • Merge the changes back to the main trunk

  16. Exercise 1: Create your local Working Directory • Create a local working copy from the example project % svn checkout http://tum.globalse.org/projects/SE2005/svn/ A svn/trunk A svn/trunk/arena A svn/trunk/arena/LICENSE.txt A svn/trunk/arena/xdocs A svn/trunk/arena/xdocs/images : : Checked out revision 4. % cd trunk % ls -aF ./ ../ .svn/ ... %

  17. Exercise 2: Add your SPMP to your Working Directory • Add new files and directories • Create a subdirectory with your name under trunk/docs • Copy your SPMP and another text file to the new subdirectory • Add the subdirectory to svn % mkdir wolf % cp ../../SPMP.txt wolf/ % touch wolf/text.txt % svn add wolf A wolf A wolf/SPMP.txt A wolf/text.txt

  18. Exercise 3: Check in your changes • Commit changes to the repository % svn commit -m 'Initial check in' Adding docs/wolf Adding docs/wolf/SPMP.txt Adding docs/wolf/text.txt Transmitting file data . Committed revision 5. %

  19. Exercise 4: Update Working Directory • Retrieve changes made by other users % svn update U ./file2 A ./newfile Updated to revision 12. % The above example assumes that another user has created revisions 6 - 12. As a consequence, we update the working copy from revision 5 to 12.

  20. Identify your modifications in the SPMP file: % svn status Commit your changes % svn commit -m ‘yours log message’ Update your working directory % svn update Identify the changes that were done to your SPMP file: % svn log SPMP.txt : % svn diff SPMP.text -r 5:9 Exercise 5: Managing concurrent changes • Modify a SPMP file form another user • To avoid conflicts: • Select the lexicographically closest user • For instance : docs/Anton -> docs/Berta

  21. File Conflict Exercise 5: Managing conflicts • Conflicts occur during concurrent modification of the same Configuration Item. • Version conflicts occur when committing changes of a Configuration Item, having a lower version number than the version number of the Master Directory • File conflicts occur when different file changes can not be applied automatically. Version Conflict

  22. SVN Client 1 Subversion Server SVN Client 2 SPMP.txt:File :SVN Client :SVN Server SPMP.txt:File :SVN Client SPMP.txt:File Peter :Developer Max :Developer Change Change Check in Commit file changes Change file Check in OK OK Commit file changes Conflict! Conflict! Example of a Version Conflict

  23. Two ways of resolving conflicts in a text file Automated Merge • File changes are in different lines and do not overlap • Example: • Developer Peter changed the first paragraph of the SPMP • Developer Max added a new paragraph at the end of the SPMP • Subversion merges to two file versions Manual Merge • File changes are in the same lines and overlap • Example: • Developer Peter changed the first paragraph of the SPMP • Developer Max deleted the first paragraph of the SPMP • The merge of the two file versions must be manual

  24. Screenshot Session I: A SPMP and its changes SPMP 1. Introduction 2. Project organization 3. Managerial process 4. Technical process 5. Work elements, schedule, and budget Flow of events: • Peter adds a new line under ‘Introduction’. • Max adds a new line under ‘Work elements’. • Peter check in his SPMP version. SPMP 1. Introduction The purpose of this document... 2. Project organization 3. Managerial process 4. Technical process 5. Work elements, schedule, and budget SPMP 1. Introduction 2. Project organization 3. Managerial process 4. Technical process 5. Work elements, schedule, and budget The work elements are...

  25. Screenshot Session I: A version conflict Flow of events: • Max check in his SPMP version. • Max gets a version conflict. % svn commit Sending Management/SPMP.txt svn: Commit failed (details follow): svn: Your file or directory 'SPMP.txt' is probably out-of-date svn: The version resource does not correspond to the resource within the transaction. Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit). svn: Your commit message was left in a temporary file: svn: '/home/wolft/SEII/E2/trunk/docs/svn-commit.tmp'

  26. Screenshot Session I: Automated Merge Flow of events: • Max checks out the current version of the SPMP • The different versions get automated merged by subversion % svn update G SPMP.txt Updated to revision 37. SPMP 1. Introduction The purpose of this document... 2. Project organization 3. Managerial process 4. Technical process 5. Work elements, schedule, and budget The work elements are...

  27. Screenshot Session II: The SPMP and its conflicting changes SPMP 1. Introduction The purpose of this document... 2. Project organization 3. Managerial process 4. Technical process 5. Work elements, schedule, and budget The work elements are... Flow of events: • Peter changes the line under ‘Introduction’. • Max changes the line under ‘Introduction’. • Peter check in his SPMP version. SPMP 1. Introduction The purpose of this document build the SPMP 2. Project organization 3. Managerial process 4. Technical process 5. Work elements, schedule, and budget The work elements are... SPMP 1. Introduction The SPMP describes the management plan. 2. Project organization 3. Managerial process 4. Technical process 5. Work elements, schedule, and budget The work elements are...

  28. Screenshot Session II: A version conflict Flow of events: • Max check in his SPMP version. • Max gets a version conflict. % svn commit Sending Management/SPMP.txt svn: Commit failed (details follow): svn: Your file or directory 'SPMP.txt' is probably out-of-date svn: The version resource does not correspond to the resource within the transaction. Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit). svn: Your commit message was left in a temporary file: svn: '/home/wolft/SEII/E2/trunk/docs/svn-commit.tmp'

  29. Screenshot Session II: Manual Merge Flow of events: • Max checks out the current version of the SPMP • Subversion indicates file conflicts with a ‘C’. • Subversion adds both versions in the file. • The conflict and the merge must be resolved manually SPMP 1. Introduction <<<<<<< .mine The SPMP describes the management plant. ======= The purpose of this document build the SPMP >>>>>>> .r42 2. Project organization 3. Managerial process 4. Technical process 5. Work elements, schedule, and budget The work elements are... % svn update C SPMP.txt Updated to revision 42.

  30. Exercise 6: Working with conflicts • Identify another student to work with. • Select a Master Directory text file to change. • You and your partner student should change the file on different computers • Try to check in the changes and resolve the conflicts. NOTE: Binary files can not be merged by subversion.

  31. Extended Subversion Documentation • SVN Book • http://svnbook.red-bean.com/ • PDF and HTML Format • Subversion Home page • http://subversion.tigris.org/

  32. Additional Examples

  33. :SVN Server Max :Developer Checkout Get latest revision [No conflicts in file changes] apply update Latest revision OK Check in Commit file changes change OK OK Resolving Conflicts with Automated Merge SVN Client 2 Subversion Server SPMP.txt:File :SVN Client SPMP.txt:File Check in Commit file changes Conflict! Conflict!

  34. :SVN Server Max :Developer [Conflicts in file changes] - Keep local changes - Add server changes File Conflicts! Resolve Conflicts Check in Commit file changes change OK OK Resolving Conflicts with Manual Merge SVN Client 2 Subversion Server SPMP.txt:File :SVN Client SPMP.txt:File Check in Commit file changes Conflict! Conflict! Checkout Get latest revision Latest revision

More Related