Sitemap
Katerina

Katerina

My journey of career changing into programming!

Semantic Versioning

2 min readMay 4, 2018

Software versioning is the process of assigning either unique version names or unique version numbers to unique states of computer software. — Wikipedia

Semantic Versioning uses a sequence of three digits each correlating to Major. Minor. Patch to detail what kind of change has been made to the software. Each change is graded depending on risk and functionality.

Changes to software versions a signified with an numeric increase of one to the Major, Minor or Patch number. Semantic Versioning starts at 0.1.0 not 0.0.1. This is because you do not start a new project with a patch, it starts with building a set of features.

Major — Changes graded as a major risk encompass anything that can break the software. If there has been a major change then it’s important to update to that new version of the software as soon as possible.

Conventionally, Major changes to a software version will reset the following two Minor and Patch numbers to zero.

Before: v1.2.3
After: v2.0.0

Minor — New features that improve the quality of the software but do not break anything are graded as a medium risk.

In this case the Minor number is increased and the Patch is reset to zero.

Before: v1.1.1
After: v1.2.0

Patch — Changes such as small bug fixes which do not break the software are graded as a low risk.

Get Katerina’s stories in your inbox

Join Medium for free to get updates from this writer.

In this instance, only the patch number in incremented by one.

Before: v1.1.0
After: v1.1.1

I enjoyed this very thorough description of the semantic versioning format from Tom Preston-Werner which reiterates what I have spoken about above:

A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes. X is the major version, Y is the minor version, and Z is the patch version. Each element MUST increase numerically.

For instance: 1.9.0 -> 1.10.0 -> 1.11.0.

Sometimes a different style of formatting in used for releases that are not stable enough to use in practical development:

  • 0 is used for alpha.
  • 1 is used for beta.
  • 2 is used for release.
  • 3 is used for final release.

For example, 1.1.0 could be 1.1.0-alpha.1. If another build is needed, it would become 1.1.0-alpha.2.

I have also seen it detailed as 1.0.0.alpha1

There seems to be some differences in how people choose to do formatting for their semantic versioning. I believe what I have used above to be the most standard type but am open to alternative ways and opinions!

--

--

Katerina
Katerina

Written by Katerina

My journey of career changing into programming!