Sterling Medical Devices & RBC Medical Innovations have combined to form Vantage MedTech! Learn More

Source Code Management: Best Practices for Version Control

Author: Ben Holt | April 4, 2022

Employees working on code

As technology expands, so does software complexity and, oftentimes, the number of people working on a software project. Source code management (SCM) is a process software teams can use to easily manage work progress and track modifications to source code.

Advantages of Source Code Management

Source code management has great benefits for software engineering teams. First, it helps to easily manage their work progress. Source control strategies allow software teams to track their work, ensuring they can roll back changes and navigate between code versions quickly and seamlessly.

If you are working on an embedded software or other software project with a team, no matter how big or small, you will likely need to put your work together at some point. Source code management supports communication and collaboration across the team and enables team members to merge their work with minimal effort and conflicts.

Source Code Management Best Practices

To make your source code management process the best it can be and meet the needs of your project, there are some source control best practices to follow.

Create a branching policy. To ensure source code management success, the software engineering team should create and follow a well-defined branching policy. In source code management, the whole team is working on the main line code, often referred to as the trunk. A member of the team could create a branch for any number of reasons – to work on a feature, fix a bug, or try out some experimental code. Some teams will branch for the purpose of testing an upcoming release, allowing for managed change if issues are identified. Some other things to consider in your source code management branching policy include:

  • When defining your branching policy, keep it simple to maximize team adoption and daily use.
  • Be sure to map out what you want to test. Each time you finish an increment be sure to implement unit and integration level tests and complete code reviews before the increment is merged back into the mainline code.
  • Also be sure to define your build schedule – whether you are building nightly, weekly, or in conjunction with releases. This gives the team fresh information before making any updates.
  • Remove branches as early as you can to keep your repository concise and maintainable.
  • Protect the trunk so it is always available, up to date, and the team can count on it working as intended. Teams often adopt a policy to “merge down and copy up,” meaning that whenever you create a branch, you merge all changes down to it and confirm they work before copying it back to the trunk. This helps correct issues before they impact the trunk or the work of your peers.

Ensure traceability. When committing an item to the repository, make sure it is traceable. The easiest way to do this is to use a version control tool and an application lifecycle management tool. This traces each patch or code change to a specific request in the application lifecycle management tool, then to requirements, and ultimately a change request, giving you full traceability.

Manage commits properly. It is critical to keep commits small, make sure they happen one at a time, and focus on a single change or responsibility. If you do, and one of the commits doesn’t work or breaks the build’s functionality, you can selectively pull the offending change. This will maximize your effort and improve your efficiency.

Write thorough commit messages. Make sure you are explaining your intentions when committing to the repository. The most useful commit message refers to an item in the application lifecycle management tool, giving you the entire history and full traceability.Source code management can help your software teams work better and more efficiently, culminating in a better product. As you design, develop, code, and test your software systems, Sterling PLM can help you see the full picture and overcome your engineering management challenges. If we can support your embedded system development, please contact us.

Share

Contact Us

  • This field is for validation purposes and should be left unchanged.

Resources

March 29, 2021

What Is Polarion?

Learn more about our tool that streamlines product development in a compliance-based...
Watch Now >
View More Videos
Professional on computer reviewing ISO documents.

October 18, 2023

What’s New in ISO 10993-17:2023?

In early September, the International Organization for Standardization (ISO) released new ISO standards for medical devices: the ISO 10993-17:2023 (en) Biological Evaluation of Medical...
Read More >
View More Articles

April 19, 2023

Requirements Management and Cybersecurity Webinar

Do you struggle with managing requirements for your products? Are you concerned about cybersecurity and the potential impact of software...
Read More >
View More Download Tools

Sign up for regular updates and resources

This field is for validation purposes and should be left unchanged.

Dan Sterling Photo of Dan Sterling President
250 Moonachie Rd., Suite 400 Moonachie, NJ 07074
201-227-7569 dan@sterlingmedicaldevices.com
John Campbell Photo of John Campbell VP of Operations
250 Moonachie Rd., Suite 400 Moonachie, NJ 07074
201-227-7569 jc@sterlingplm.com
John Fargo Photo of DanJohn Fargo PLM Manager
250 Moonachie Rd., Suite 400 Moonachie, NJ 07074
201-227-7569 jf@sterlingplm.com