3. Software Engineering - software configuration-management


Published on

Source Control Systems
Telerik Software Academy: http://academy.telerik.com/school-academy/meetings/details/2011/09/27/software-engineering
The website and all video materials are in Bulgarian

Systems for Software Configuration Management (SCM);
Version Control;
Basic notions and principles;
Versioning Models;
Tags and Branching

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

3. Software Engineering - software configuration-management

  1. 1. Software Configuration Management Source Control Repositories for Enabling Team WorkingDoncho MinkovTechnical Trainerhttp://minkov.itTelerik Software Academyacademy.telerik.com
  2. 2. Table of Contents1. Systems for Software Configuration Management (SCM)2. Version Control  Basic notions and principles3. Versioning Models  Lock-Modify-Unlock  Copy-Modify-Merge4. Tags and Branching
  3. 3. Software Configuration Management (SCM) Version control ≈ Software Configuration Management  A discipline of the software engineering  Consists of techniques, practices and tools for their application  Mechanisms for management, control and accounting of the changes.  Defines the process of change  Keeps track of what is happening in the project  Solves conflicts in the changes
  4. 4. Why do We Need SCM? To control the process of software development:  Many people working on the same source code or document  Concurrent access management  Projects with many builds and releases  Tracking the evolution of the software throughout the project:  Status, progress, defects, functionality
  5. 5. Advantages of SCM Systems Control of changes  Control over the product development and changes Indicating the progress  Tracking of the status of the separate components and Review and audit  Possibility of changes reviewing Build control  Track the builds and the info about them
  6. 6. Advantages of SCM Systems (2) Process control  Track the development process Team working  Easier to cooperate with the other team members
  7. 7. SCM and the Software Development Process Release The Final Product Testing Text Analysis Requirements Scripts and Data Build SCM Scripts, Final Product ModelsRelease Design Source Code Implementation
  8. 8. The Market ofSCM Products
  9. 9. The Market of SCM Products Application life-cycle management (ALM) Process-centric software configuration management Software configuration management (SCM) Version control
  10. 10. Version Control Systems Functionality  File versions control  Simple merge and differences search  Branching  File locking  Console and GUI clients Well known products  CVS, Subversion  Git, Mercurial  Perforce, TFS
  11. 11. SCM Systems Functionality  Groups of documents control  Better merge and differences search  Work space control  Workflow control  Build and release control Well known products  Borland StarTeam Standard  IBM Rational ClearCase  MKS Source Integrity  Serena ChangeMan Professional
  12. 12. Process-Oriented SCM Systems Functionality  Process, Design and implementation templates  Requirements Control  Issue tracking  Tasks and task changes control  Permission control (clients, groups, …)  Analytical tools and progress reports Well known products  Borland StarTeam Standard  IBM Rational ClearCase  MKS Source Integrity
  13. 13. Application Lifecycle Management (ALM) Systems Functionality  Close integration of processes with the tools for their usage  Design tools  Development tools  Testing tools  Project control tools Better known products  Microsoft Visual Studio Team System Server  Borland StarTeam Enterprise Advantage  Telelogic SYNERGY
  14. 14. Version ControlManaging Different Version of the Same File (Document)
  15. 15. Version Control Constantly used in software engineering  While working with documents  During software development Changes are identified with an increment of the serial number  “version number”, for example 1.0, 2.0, 2.17 Version numbers are historically linked with the person who created them
  16. 16. Change Log Systems for version control keep a complete change log  The date and hour of every change is stored  The user who made the change is stored Old versions can be retrieved, examined and compared It is possible to return to an old version (revert)
  17. 17. Vocabulary Repository  A server that stores the files (documents)  Keeps a change log Revision, Version  Individual version (state) of a document that is a result of multiple changes Check-out  Retrieves a working copy of the files from the repository into a local directory  It is possible to lock the files
  18. 18. Vocabulary (2) Change  A modification to a local file (document) that is under version control Change List  A set of changes to multiple files that are going to be committed at the same time Commit, Check-in  Applying the changes made on the work copy to the files in the repository  Automatically creates a new version  Conflicts may occur!
  19. 19. Vocabulary (3) Conflict  The simultaneous change to a file by multiple users  Automatic and manual solving Update, Get Latest Version  Checking-out the changed files from the repository to a local directory Undo Check-out  Cancels the changes to a group of files  Restores their state from the repository
  20. 20. Vocabulary (4) Merge  Combining the changes to a file simultaneously made by different users  Can be automated in most cases Label, Tag  Labels mark with a name a group of files in a given version  For example a release Branching  Division of the repositories in a number of separate work flows
  21. 21. Version Control: Typical ScenarioUsers Repository Main User A development Version A Branch line Version A.1 Branch Check Out Check In C A User B B Version B Branch Check Out D Merge E Check In
  22. 22. Versioning Models Lock-Modify-Unlock and Copy-Modify-Merge
  23. 23. Versioning Models Lock-Modify-Unlock:  Only one user works on a given file at a time  no conflicts  Example: Visual SourceSafe Copy-Modify-Merge:  Users make parallel changes to their own working copies  The parallel changes are merged and the final version emerges  Examples: CVS, Subversion
  24. 24. Locking Problems Administrative problems:  Someone locks a given file and forgets about it  Time is lost while waiting for someone to release a file Unneeded locking of the whole time  Different changes are not necessary in conflict  Example: Andy works on the begging of the file and Bobby works on the end
  25. 25. Merging Problems If a given file is concurrently modified it is necessary to merge the changes  Merging is hard!  It is not always possible to do it automatically Responsibilityand coordination between the developers is needed  Commit as fast as you can  Do not commit code that does not compile or blocks the work of the others  Add comments on commit
  26. 26. File Comparison / Merge During manual merge use file comparison There are visual comparison / merge tools:  TortoiseMerge  WinDiff  AraxisMerge  BeyondCompare  CompareIt …
  27. 27. File Comparison – Example
  28. 28. The"Lock-Modify-Unlock" Model
  29. 29. The Lock-Modify-Unlock model (1)Andy and Bobby check-out file A. RepositoryThe check-out is donewithout locking. They Ajust get a local copy. Update Update A A Bobby Andy
  30. 30. The Lock-Modify-Unlock model (2)Andy locks file A andbegins modifying it. Repository A Lock A Аndy (Local Edit) Bobby Andy
  31. 31. The Lock-Modify-Unlock model (3)Bobby tries to lock the filetoo, but she can’t. RepositoryBobby waits for Andy tofinish and unlock the file. A Wait A Andy Bobby Andy
  32. 32. The Lock-Modify-Unlock model (4)Andy commits thechanges and unlocks thefile. Repository Andy Commit Andy Andy Bobby Andy
  33. 33. The Lock-Modify-Unlock model (5)Now Bobby can take themodified file and lock it. RepositoryBobby edits her local copy Andyof the file. Lock Andy Andy (Local Edit) Bobby Andy
  34. 34. The Lock-Modify-Unlock model (6)Bobby finishes,commits her changesand unlocks the file. Repository Andy Bobby Commit Andy Bobby Andy Bobby Andy
  35. 35. The Lock-Modify-Unlock model (7)Andy updates thechanges from therepository. Repository Andy Bobby Update Andy Bobby Andy Bobby Bobby Andy
  36. 36. The"Copy-Modify-Merge" Model
  37. 37. The Copy-Modify-Merge Model (1)Andy and Bobbycheck-out the file A. RepositoryThe check-out isdone without Alocking. Check-out Check-out A A Bobby Andy
  38. 38. The Copy-Modify-Merge Model (2)Both of them editthe local copies of Repositorythe file (in the sametime). A Bobby Andy (Local Edit) (Local Edit) Bobby Andy
  39. 39. The Copy-Modify-Merge Model (3)Bobby commitsher changes to Repositorythe repository. Bobby Commit Bobby Andy Bobby Andy
  40. 40. The Copy-Modify-Merge Model (4)Andy tries tocommit his Repositorychanges. BobbyA versionconflict occurs. Commit Bobby Andy (Local Bobby Conflict) Andy
  41. 41. The Copy-Modify-Merge Model (5)Andy updates his changeswith the ones from the Repositoryrepository.The changes merge into Bobbyhis local copy.A merge conflict can Bobbyoccur. Andy & Bobby (Local Bobby Merge) Andy
  42. 42. The Copy-Modify-Merge Model (6)Andy commitsthe changes tothe repository. RepositoryA common Andy &version with the Bobbychanges of Andy Commit Bobbyand Bobby isinserted. Andy & Bobby Bobby Andy
  43. 43. The Copy-Modify-Merge Model (7)Bobby updates thechanges from the Repositoryrepository. AndyShe gets the & Updatecommon version Bobbywith the changes of AndyAndy and Bobby. & Bobby Andy & Bobby Bobby Andy
  44. 44. Tags and Branching
  45. 45. Tags Tags enable the naming of a group of files in different versions Main.cs 1.1 1.2 1.3 1.4 Tag "Beta 2" Test.cs 1.1 1.2 Prog.cs 1.1 1.2 1.3
  46. 46. Branching Branchingenables a group of changes to be separated in a different development line Branching is suitable for:  Development of additions for a version of the product (for example version 2.0)  The additions are independent from the main development line  Saves the possibility of making changes to the old version (for example version 1.0.1)
  47. 47. Branching – Example Branch -> Branch 1.2.2. -> 1.1 1.2 1.3 1.4 Main Trunk Branch 1.2.4. ->
  48. 48. SubversionUsing Subversion and TortoiseSVN
  49. 49. Subversion Subversion (SVN)  Open source SCM repository  http://subversion.tigris.org/  Runs on UNIX, Linux, Windows Console client  svn GUI client  TortoiseSVN – http://tortoisesvn.tigris.org/ Visual Studio plug-in client (AnkhSVN)
  50. 50. Subversion – Features Versioning of the directory structure Complete change log  Deletion of files and directories  Renaming of files and directories  Saving of files or directories Can work on it’s own or integrated with Apache as a module Works effectively with tags and branching
  51. 51. TortoiseSVN TortoiseSVN  Open source GUI client for Subversion  Integrated in Windows Explorer  http://tortoisesvn. tigris.org/
  52. 52. AnkhSVN Visual Studio plug-in for accessing SVN repositories – http://ankhsvn.open.collab.net
  53. 53. Subversion &TortoiseSVN Live Demo
  54. 54. Software Configuration Management курсове и уроци по програмиране, уеб дизайн – безплатно BG Coder - онлайн състезателна система - online judge курсове и уроци по програмиране – Телерик академия форум програмиране, форум уеб дизайн уроци по програмиране и уеб дизайн за ученици ASP.NET курс - уеб програмиране, бази данни, C#, .NET, ASP.NET http://academy.telerik.com програмиране за деца – безплатни курсове и уроци ASP.NET MVC курс – HTML, SQL, C#, .NET, ASP.NET MVC безплатен SEO курс - оптимизация за търсачки алго академия – състезателно програмиране, състезаниякурсове и уроци по програмиране, книги – безплатно от Наков курс мобилни приложения с iPhone, Android, WP7, PhoneGap уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop Дончо Минков - сайт за програмиране free C# book, безплатна книга C#, книга Java, книга C# Николай Костов - блог за програмиране безплатен курс "Качествен програмен код" безплатен курс "Разработка на софтуер в cloud среда" C# курс, програмиране, безплатно
  55. 55. Free Trainings @ Telerik Academy “Software Engineering" course @ Telerik Academy  academy.telerik.com/.../software-engineering Telerik Software Academy  academy.telerik.com Telerik Academy @ Facebook  facebook.com/TelerikAcademy Telerik Software Academy Forums  forums.academy.telerik.com