Thursday, 31 May 2012

Version Numbering


So many times I hear developers arguing about how to label versions so here is the "right" way to do it ... well a widely accepted way!

Software should be released with a version number based on the Apache Portable Runtime Project version guidelines. In summary, the version is denoted as three integers in the format of MAJOR.MINOR.PATCH.

Major versions are incompatible at the API level, as they can include any kind of change.
Minor versions are compatible with older versions at the API and binary level, and they can introduce new functions or deprecate old ones.
Patch versions are perfectly compatible, and they are released to fix defects.

Here are some examples to demonstrate the compatibility:
Original VersionNew VersionCompatible?
2.2.32.2.4Yes
Compatibility across patch versions is guaranteed.
2.2.32.2.1Yes
Compatibility across patch versions is guaranteed.
2.2.32.3.1Yes
Compatibility with later minor versions is guaranteed.
2.2.32.1.7No
Compatibility with prior minor versions is not guaranteed.
2.2.33.0.0No
Compatibility with different major versions is not guaranteed.
2.2.31.4.7No
Compatibility with different major versions is not guaranteed.
Note: while some of the cells say "no", it is possible that the versions may be compatible, depending very precisely upon the particular APIs used by the application.

Patch Versions

To retain perfect source and binary compatibility, a patch release can only change function implementations. Changes to the API, to the signatures of public functions, or to the interpretation of function parameters is not allowed. Effectively, these releases are pure bug fix releases.

Minor Versions

Minor releases can introduce new functions, new symbolic and enumerated constants, and deprecate existing functions. In practice, this will not be a problem since upgrading to newer versions is always safe.

Major Versions

Any kind of change can be made during a major version release. Particular types of changes that might occur:
  • remove or change constants
  • remove (deprecated) functions
So you might find that your code stops working completly.

Minor Versions

Minor Versions
Minor 

No comments:

Post a Comment