SVN Tutorial: Source Code Management Using Subversion

Introduction to Source Code Management Using Subversion (SVN):

Welcome to the Subversion(SVN) series. This informative SVN Tutorial explains the basics of the software versioning concept and how SVN can be useful for the development team.

In this first tutorial of the series, we will learn about Subversion which is a Software Configuration Management (SCM) system. Read this tutorial thoroughly before you proceed to the next one.

Source Code Management Using Subversion

List Of Tutorials In This Subversion Series:

Tutorial #1: SVN Tutorial: Source Code Management Using Subversion
Tutorial #2: How To Setup SVN Repository And Install Tortoise SVN Client
Tutorial #3: Tortoise SVN Tutorial: Revisions In Code Repository
Tutorial #4: How To Delete Content From SVN Repository


Overview Of Tutorials In Subversion Series:

Tutorial NumberWhat You will learn
Tutorial_#1:SVN Tutorial: Source Code Management Using Subversion
This informative SVN Tutorial will explain the basics of software versioning concept and how SVN can be useful for the entire team.
Tutorial_#2:How To Setup SVN Repository And Install Tortoise SVN Client
You will learn how to set up a free server repository and a free Tortoise SVN client UI to import and export code to/from the repository from this tutorial.
Tutorial_#3:Tortoise SVN Tutorial: Revisions In Code Repository
This tutorial will brief you on how to use Tortoise SVN client to check-out and check-in the code from/to repository with simple practical examples for your easy understanding.
Tutorial_#4:How To Delete Content From SVN Repository
This SVN tutorial will teach you how to remove the code content from the repository. SVN helps you to version your project.

Why Do You Need SVN?

Suppose you are in the process of developing a selenium automation project. Let us say there are three team members working on this project: Tester A, Tester B, Tester C.

Now assume, there are 15 automation test scripts that need to be written. So these three teammates decide to divide five scripts each amongst themselves and start automating them. Now, in the end, they will all merge their code and the final code will be built. The Blue circular shape in the figures below represents the final merged code.

If ‘Tester A’ decides to make some correction in his piece of code, then he will have to get the whole merged code into his local workspace so that he can correct it as shown in the below figure. Workspace means a simple Selenium project.

Final merged code

Similarly ‘Tester B’ will also have to get the whole code into his workspace if he wants to make any changes to his/her test cases.

Final merged code of B

But the problem that will arise is that each and everyone will now have a different version of the workspace. The changes that ‘Tester A’ has done in his workspace, will not be present in the workspace that ‘Tester B’ has as shown below. There will be no synchronization of workspaces between the team members.

Tester B not in sync with changes made by Tester A

If a new team member joins and he wants to set up his local workspace, then there will be conflict about which Tester should give him his workspace? Thus, there will be confusion. Here, we are talking about three testers, what if you are working on a big automation project comprising of many testers?

Hence, to resolve these code synchronization issues and to ensure that everyone in the team is on the same page, we use Subversion SVN.

There are many other tools in the market that help in source code management. Few are free (open source) like CVS (Concurrent Versioning System), RCS (Revision Control System), Git. While a few are licensed like Rational ClearCase.

What Is The SVN Repository And What Does It Do?

The SVN repository provides a management system through which you can control the versions of your project and/or software.

So, you need to have a centralized server repository (server can be Windows, Unix, Linux based, etc). We will be putting our final merged code onto this server.

Now suppose the ’Tester A’ checks out the code from the centralized server which is known as the repository. After making the desired changes to his code, he checks-in back to the updated code into the repository. Now ‘Tester B’, when he checks out the code, gets the latest code from the repository.

Similarly, everybody does their respective changes and then update (check-in) the code in the repository.

Thus everyone is in sync and is on the same page.

Explaining Repository

Conclusion

In this tutorial, we have gone through the basics of the software versioning concept and have seen how SVN can be useful for the entire team. We have also seen what a repository is and what does it do.

In the upcoming tutorial, we will see how to set up a free repository of our own.

NEXT Tutorial