h(p://home.hit.no/~hansha/?page=sonware_development O. Widder. (2013). geek&poke. Available: h(p://geek- and- poke.com Source Code Control & Bugtracking Hans- Pe(er Halvorsen, M.Sc. 1
O. Widder. (2013). geek&poke. Available: h(p://geek- and- poke.com 2
Contents Source Code Control (SCC) Revision Control Version Control Source Code Management (SCM) Bug ReporSng Bug Tracking Tools 3
Source Code Control (SCC) Version/Revision Control Source Code Management (SCM) Hans- Pe(er Halvorsen, M.Sc. 4
5
SCC Systems SVN Concurrent Versioning System 6
Android Studio SCC Support in IDEs Visual Studio LabVIEW 7
Source Code Control/Version Control What is it? A version control system keeps track of all work and all changes in a set of files (typically your code files, but also other files) Allows several developers (potensally widely separated in space and Sme) to collaborate All SoNware Developers need it!! 8
Typical SCC Features Checkout, Checkin/Commit Branching, Merging File Locking (avoid concurrent access) Label/Tag Change/Change List Conflict Revision, IteraSon 9
SCC Features 1.0 Label/Tag it Checkout, Checkin/Commit Branching, Merging File Locking (avoid concurrent access) Label/Tag Change/Change List/History Conflict Braching 1.1 2.0 Work with Bug Fix Bug Fix Released Work with new Release Merging 2.0 Released etc. Branching in TFS: h(p://msdn.microson.com/en- us/library/ee782536.aspx 10
Change/Change List/History Get back old files Get overview of when the files has been changed, by who, etc, It is important that you use the Comment field every Sme you check in your files!! 11
Conflicts and File Merging In SCC System several people may work concurrently on the same code file. One drawback is that somesmes you must resolve conflicts before you can get, check in, or merge files. 12
13
Exercise SCC Each of you use 1-2 sentences to explain the terms (one each) Repository Working Copy Checkout Checkin/Commit Branch/Branching Fork/Forking Merge/Merging File Locking Label/Tag Change/Change List Conflict Revision, IteraSon
SCC Glossary O. Widder. (2013). geek&poke. Available: h(p://geek- and- poke.com Repository Checkin/Commit, Checkout File Locking Version Conflict Branching, Merging Label Fork Fork in the meaning of to divide in branches, go separate ways. In sonware engineering, a project fork happens when developers take a copy of source code from one sonware package and start independent development on it, creasng a dissnct piece of sonware. The term onen implies not merely a development branch, but a split in the developer community Example: OpenOffice.org forked to LibreOffice Break the build Wikipedia. (2013). Revision Control. Available: h(p://en.wikipedia.org/wiki/source_code_management Wikipedia. (2013). Fork (So,ware Development). Available: h(p://en.wikipedia.org/wiki/fork_(sonware_development) 15
Centralized/Client Server architecture A server stores the current version(s) of a project and its history, and clients connect to the server in order to "check out" a complete copy of the project, work on this copy and then later "check in" their changes DVCS DisSbuted Version Control System With a distributed version control system, there isn t one centralized code base to pull the code from. Different branches hold different parts of the code. Git is a DVCS. Other version control systems, such as SVN and CVS, use centralized version control, meaning that only one master copy of the sonware is used. Peer- to- peer approach 16
Exercise SCC Systems Distributed (DVCS) or Centralized/Client Server? TFS CVS SVN (Subversion) Git Mercurial Bazaar LibreSource Monotone BitKeeper Client Server Distributed
Centralized/ Client Cerver architecture TFS CVS SVN (Subversion) LibreSource DVCS Git Mercurial Bazaar Monotone BitKeeper 18
Centralized/Client Server architecture Client Client Client Network Client Server Repository Repository: Source Code Database
DisSbuted Version Control System Repository peer- to- peer peer- to- peer Repository Repository Repository Repository: Source Code Database
Team FoundaSon Server SDLC Management (SDLC SoNware Development Life Cycle) SoNware Team CollaboraSon Source Code Management Supports Agile, Scrum, CMMI Integrated Test Tools Bug Tracking System Automated Builds Built in Team FoundaSon Version Control (TSVC) + Support for Git repositories Built- in support for TFS in Visual Studio (Team Explorer) Plug- in for Eclipse (Team Explorer Everywhere) MSSCCI Provider for other IDEs like LabVIEW, etc. 21
CVS CVS - Concurrent Versions System Established 1986-1990 Free of charge CVS uses a client server architecture: a server stores the current version(s) of a project and its history, and clients connect to the server in order to "check out" a complete copy of the project, work on this copy and then later "check in" their changes Widely supported in different IDEs (Eclipse, Xcode, ) 22
SVN (Subversion) Open Source License Established in 2000 Subversion is probably the version control system with the widest adopson Many different Subversion clients are available (Tortoise SVN, Mac: Versions, Xcode (built- in support for SVN)) h(p://subversion.apache.org 23
Git Has become very popular today Distributed Version Control System IniSally designed and developed by Linus Torvalds (Linux Guru) (2005) Git is Free of use CVS and SVN is easier to use than Git for beginners 24
ExplanaSon: If you track down a bug in your code and want to know when it was introduced and why, file annotason is onen your best tool. It shows you what commit was the last to modify each line of any file. So, if you see that a method in your code is buggy, you can annotate the file with git blame to see when each line of the method was last edited and by whom. 25
TFVC vs. Git Team FoundaSon Version Control (TFVC) uses a single, centralized server repository to track and version files. Local changes are always checked in to the central server where other developers can get the latest changes. Git is a Distributed Version Control System (DVCS) that uses a local repository to track and version files. Changes are shared with other developers by pushing and pulling changes through a remote, shared repository. 26
Web- based SCC HosSng Services Visual Studio Online (formerly Team FoundaSon Services) (www.visualstudio.com) TFVC or Git GitHub (www.github.com) Bitbucket (www.bitbucket.org) Mercurial or Git 27
Source Code Control SCC Repositories Web- based SCC HosJng Services (Montly payment/5 users free of charge/free for open source projects) Git TFVC or Git Git or Mercurial 28
O. Widder. (2013). geek&poke. Available: h(p://geek- and- poke.com Bugtracking Systems Hans- Pe(er Halvorsen, M.Sc. 29
30
Bugs A sonware bug is an error, flaw, failure, or fault in a computer program or system that produces an incorrect or unexpected result, or causes it to behave in unintended ways They found a bug (actually a moth) inside a computer in 1947 that made the program not behaving as expected. This was the first real bug. 31
Why Find Bugs early? Cost per defects SoNware Development Life Cycle (SDLC) 32
Bugs vs. Features It's not a bug - it's an undocumented feature J For as long as I've been a sonware developer and used bug tracking systems, we have struggled with the same fundamental problem in every single project we've worked on: how do you tell bugs from feature requests? 33
SoNware Releases Before the sonware is released Alpha Release(s) Beta Release(s) RC - Release Candidate(s) RTM Release To Manufactoring Maintenance (aner the sonware is released) Patches (small fixes) SP - Service Packs (lots of small fixes and pathes bundle together) Start Planning next release 34
Example - Windows 8 Start planning and development of Windows 8, 2008/2009 (the planning started before Windows 7 was released) Internal Builds xxxx xxxx Internal Alpha versions, Alpha 1, 2, 3 Internal Builds xxxx xxxx Internal Milestone1 Release (build 7850), 2010.09.22 Internal Milestone2 (build 7955), Milestone3 (build 7989) Developer Preview (build 8102), 2011.09.13 Internal Builds xxxx xxxx Consumer Preview (build 8250), 2012.02.29 Internal Builds xxxx xxxx Release Preview (build 8400), 2012.05.28 Internal Builds xxxx xxxx RTM Release (build 9200), 2012.08.01 major.minor.maintenance.build It is normal to build the sonware automascally every night, ready for internal tester the day aner
Bug Tracking Systems Team FoundaJon Server Jira Bugzilla Clearquest 36
Team FoundaSon Server You Add Bugs as Work Items 37
Exercise Adding Bugs as Work Items in TFS Test your App for 15 minutes If you find Bugs, Add them as Work Items in TFS
Summary All SoNware Developers need to use a SCC system All SoNware Developers need to use a Bug Tracking system 39
References I. Sommerville, So,ware Engineering: Pearson, 2010. Wikipedia. (2013). Revision Control. Available: h(p://en.wikipedia.org/wiki/source_code_management Wikipedia. (2013). Fork (So,ware Development). Available: h(p://en.wikipedia.org/wiki/fork_(sonware_development) S. Adams. Dilbert. Available: h(p://dilbert.com O. Widder. (2013). geek&poke. Available: h(p://geek- and- poke.com B. Lund. (2013). Lunch. Available: h(p://www.lunchstriper.no, h(p://www.dagbladet.no/tegneserie/lunch/ Comparison of Revision Control So,ware. Available: h(p://en.wikipedia.org/wiki/comparison_of_revision_control_sonware Wikipedia. (2013). Distributed Revision Control. Available: h(p://en.wikipedia.org/wiki/distributed_version_control_system Wikipedia. (2013). So,ware Versioning. Available: h(p://en.wikipedia.org/wiki/sonware_versioning 7 Version Control Systems Reviewed: h(p://www.smashingmagazine.com/2008/09/18/the- top- 7- open- source- version- control- systems/ 40
Hans- PeZer Halvorsen, M.Sc. Telemark University College Faculty of Technology Department of Electrical Engineering, InformaJon Technology and CyberneJcs E- mail: hans.p.halvorsen@hit.no Blog: hzp://home.hit.no/~hansha/ 41