Week 3 – CST438 Software Engineering

Describe what are the good points about using Git for source code management.  What are possible problems that Git merge does not solve when merging code from different developers?

Git is a VCS or version control system that developers can use to keep track of changes to software source code files. The reason version control is important in software engineering is that a project will require you to manage different versions during development. Different versions of the project might have different bug fixes or features, and Git offers a way to merge the different changes together. Git allows you to create commits, which are snap shots of a project at a specific time, of your files in a git repository. You can also return to any past commit in your project using git revert or git reset commands. You can keep track of these commits using the git log command.

Another good point about using Git for source code management is that you can create branches. Branches allow you to maintain multiple independent versions of a project. You can maintain a stable branch as the main branch and create a separate branch to work on other changes like new features or bug fixes. Also, each developer can create their own branch to work on. Once the changes are ready, you can merge them back to your main branch. This helps maintain your main branch error/bug free since you will only merge code from other branches after it has been checked for bugs and tested.

A possible problem that Git merge does not solve when merging code from different developers is that it will check for merge conflicts but not for code correctness. Git merge only points out merge conflicts when developers edit the same lines. Unfortunately, this does not account for syntax or logical errors. An example can be when a developer edits a method where they rename a variable and another developer edits the same method by adding extra lines of code with the original variable name but does not change the lines that the first developer changed. When merging, this will not generate a merge conflict but there will be a logical error since the variable name was changed, and the extra lines that were added use the original variable name.

Comments

Popular posts from this blog