Semantic Versioning

Have you gone to open an application on your computer and were given a prompt saying your software is out of date?  Some of these messages even tell you what version you are running compared to the latest available.

For example, I opened Notepad++ and received the message above.  You can see I currently have version 8.4.7.0 installed, and the available version 8.5.7.

This is an example of Semantic Versioning.  The article “A Guide to Semantic Versioning” by Suemayah Eldursi (https://www.baeldung.com/cs/semantic-versioning)  clearly breaks down each segment of a Semantic Version. Semantic Versioning is a scheme for labeling versions of software using meaningful numbers to represent what was changed.

The first digit refers to the major updates.

  • Updates that involve changes that break API functionality and are not backwards compatible.  

In my example, you can see the current major update matches the available.

The second digit indicates minor updates.  

  • Updates include new features that are backwards compatible and will not break anything in the API.  

In my example, you can see the current version is one minor update behind the available version.

The third digit describes the number of patches. 

  • Small bug fixes and changes that don’t add any new features, are backwards compatible, and don’t cause any breaks in the API.  

In my example, the current patch number is irrelevant because of the minor update, however, we can see that there have been 7 patches since the minor update.

Semantic Versions may also include a pre-release label and build number.  Pre-release labels, such as alpha and beta, and build numbers would look something like “1.0.0-alpha.4”  These are used to let the user know that it is a pre-release build and may have more use for developers to identify additional version information as needed.

Being able to read a version number is important for users so that they can know what changes have been made to the software or if it’s backwards compatible.  Therefore, updating the version number correctly is just as important.  The article “Introduction to Semantic Versioning“ by Parikshit Hooda (https://www.geeksforgeeks.org/introduction-semantic-versioning/) provides a great illustration that demonstrates what type of update you should choose and what the version number would look like after:

In this example, you can see how a bug fix would only change the last digit from an 8 to 9.  It’s important to note that a minor or major update resets all following numbers to 0.

Maintaining proper documentation of your updates through Semantic Versioning is vital for both the user and developer. As a developer, keeping an organized record of each update and communicating what changes were made to users.


Leave a comment

Design a site like this with WordPress.com
Get started