211

Is there any guideline or standard best practice how to version a software you develop in your spare time for fun, but nevertheless will be used by some people? I think it's necessary to version such software so that you know about with version one is talking about (e.g. for bug fixing, support, and so on).

But where do I start the versioning? 0.0.0? or 0.0? And then how to I increment the numbers? major release.minor change? and shouldn't any commit to a version control system be another version? or is this only for versions which are used in a productive manner?

Luke
  • 7,719
  • 3
  • 43
  • 74
RoflcoptrException
  • 49,973
  • 34
  • 147
  • 199
  • 2
    What does your source code control tool do? You *must* use one. Which one are you using? – S.Lott May 19 '10 at 10:00
  • 3
    I'm a little late... but a dupe of http://stackoverflow.com/questions/615227/how-to-do-version-numbers – derivation May 24 '10 at 14:07
  • 12
    http://semver.org – Dave Gregory Jul 22 '14 at 19:50
  • 1
    @DaveGregory has a non-opinion-based answer to the question. That link [semver.org](http://semver.org) describes a versioning semantic in detail. The same scheme is commonly used by most Google projects including Android. Moreover, in Tom Preston-Werner we can find as credible voice as any on this subject. – Rahul Murmuria Apr 21 '16 at 17:41

12 Answers12

125

You should start with version 1, unless you know that the first version you "release" is incomplete in some way.

As to how you increment the versions, that's up to you, but use the major, minor, build numbering as a guide.

It's not necessary to have every version you commit to source control as another version - you'll soon have a very large version number indeed. You only need to increment the version number (in some way) when you release a new version to the outside world.

So If you make a major change move from version 1.0.0.0 to version 2.0.0.0 (you changed from WinForms to WPF for example). If you make a smaller change move from 1.0.0.0 to 1.1.0.0 (you added support for png files). If you make a minor change then go from 1.0.0.0 to 1.0.1.0 (you fixed some bugs).

If you really want to get detailed use the final number as the build number which would increment for every checkin/commit (but I think that's going too far).

ChrisF
  • 127,439
  • 29
  • 243
  • 315
  • I have a question about your answer: if I'm working with version 1.0.0.0 and I'm implementing a minor, smaller or large change and I also want to use build number. On which version number do I have to add build version? Imagine, I'm moving from 1.0.0.0 to 1.0.1.0. On which number do I have to put build number? And, on the final release, will it have also build number on its version number (1.0.1.234)? – VansFannel Jan 18 '16 at 08:34
  • @VansFannel, I would expect the build number to reset to 0 every time you bump any higher-up number. – Jeffrey Kemp Mar 07 '16 at 15:34
  • @JeffreyKemp Yes, I think so. But at work we use day of year number and I don't like it. – VansFannel Mar 07 '16 at 17:06
  • Yuck, I wouldn't like that either :( – Jeffrey Kemp Mar 08 '16 at 00:02
  • 2
    It should also be noted that changes in major versions typically are not backward compatible. Increments in the minor version are backward compatible within the major version. Changing from a hard coded MySQL implementation into a generic implementation could be a major version due to the size of the change, but could also be considered a feature change (minor) because it remains backward compatible. – DHW Nov 22 '16 at 06:44
63

I would use x.y.z kind of versioning

x - major release
y - minor release
z - build number

Mahesh Velaga
  • 20,207
  • 5
  • 33
  • 59
42

I basically follow this pattern:

  • start from 0.1.0

  • when it's ready I branch the code in the source repo, tag 0.1.0 and create the 0.1.0 branch, the head/trunk becomes 0.2.0-snapshot or something similar

  • I add new features only to the trunk, but backport fixes to the branch and in time I release from it 0.1.1, 0.1.2, ...

  • I declare version 1.0.0 when the product is considered feature complete and doesn't have major shortcomings

  • from then on - everyone can decide when to increment the major version...

Bozhidar Batsov
  • 52,348
  • 13
  • 95
  • 111
35

I use this rule for my applications:

x.y.z

Where:

  • x = main version number, 1-~.
  • y = feature number, 0-9. Increase this number if the change contains new features with or without bug fixes.
  • z = hotfix number, 0-~. Increase this number if the change only contains bug fixes.

Example:

  • For new application, the version number starts with 1.0.0.
  • If the new version contains only bug fixes, increase the hotfix number so the version number will be 1.0.1.
  • If the new version contains new features with or without bug fixes, increase the feature number and reset the hotfix number to zero so the version number will be 1.1.0. If the feature number reaches 9, increase the main version number and reset the feature and hotfix number to zero (2.0.0 etc)
Lorensius W. L. T
  • 1,656
  • 4
  • 19
  • 28
  • 36
    I would suggest using this scheme without rolling over 9 -> 0 in the "feature"/"hotfix" number, just go to 10! 10 minor updates are still minor updates if they were issued incrementally, there is nothing wrong with 1.10.0 or 1.1.10. – ttarik Oct 16 '12 at 04:01
  • 4
    ..and keep going up. What if you really have 23 features to implement before v.2? And then 30 bugfixes on that last feature? You would have version 1.23.30. Major version releases are big abstract concepts with certain milestones, no need to adhere arbitrarily to decimal counting rules. – brianclements Feb 23 '15 at 05:28
11

We use a.b.c.d where

  • a - major (incremented on delivery to client)
  • b - minor (incremented on delivery to client)
  • c - revision (incremented on internal releases)
  • d - build (incremented by cruise control)
Naeem Sarfraz
  • 6,900
  • 4
  • 33
  • 63
5

Yet another example for the A.B.C approach is the Eclipse Bundle Versioning. Eclipse bundles rather have a fourth segment:

In Eclipse, version numbers are composed of four (4) segments: 3 integers and a string respectively named major.minor.service.qualifier. Each segment captures a different intent:

  • the major segment indicates breakage in the API
  • the minor segment indicates "externally visible" changes
  • the service segment indicates bug fixes and the change of development stream
  • the qualifier segment indicates a particular build
Community
  • 1
  • 1
cuh
  • 3,544
  • 4
  • 27
  • 45
5

There is also the date versioning scheme, eg: YYYY.MM , YY.MM , YYYYMMDD

It is quite informative because a first look gives an impression about the release date. But i prefer the x.y.z scheme, because i always want to know a product's exact point in its life cycle (Major.minor.release)

athspk
  • 6,576
  • 7
  • 32
  • 51
2

The basic answer is "It depends".

What is your objective in versioning? Many people use version.revision.build and only advertise version.revision to the world as that's a release version rather than a dev version. If you use the check-in 'version' then you'll quickly find that your version numbers become large.

If you are planning your project then I'd increment revision for releases with minor changes and increment version for releases with major changes, bug fixes or functionality/features. If you are offering beta or nightly build type releases then extend the versioning to include the build and increment that with every release.

Still, at the end of the day, it's up to you and it has to make sense to you.

Lazarus
  • 38,221
  • 4
  • 39
  • 53
2

As Mahesh says: I would use x.y.z kind of versioning

x - major release y - minor release z - build number

you may want to add a datetime, maybe instead of z.

You increment the minor release when you have another release. The major release will probably stay 0 or 1, you change that when you really make major changes (often when your software is at a point where its not backwards compatible with previous releases, or you changed your entire framework)

SirLenz0rlot
  • 1,933
  • 3
  • 33
  • 48
2

You know you can always check to see what others are doing. Open source software tend to allow access to their repositories. For example you could point your SVN browser to http://svn.doctrine-project.org and take a look at the versioning system used by a real project.

Version numbers, tags, it's all there.

Manos Dilaverakis
  • 5,661
  • 4
  • 26
  • 56
2

We follow a.b.c approach like:

increament 'a' if there is some major changes happened in application. Like we upgrade .NET 1.1 application to .NET 3.5

increament 'b' if there is some minor changes like any new CR or Enhancement is implemented.

increament 'c' if there is some defects fixes in the code.

0

I start versioning at the lowest (non hotfix) segement. I do not limit this segment to 10. Unless you are tracking builds then you just need to decide when you want to apply an increment. If you have a QA phase then that might be where you apply an increment to the lowest segment and then the next segement up when it passes QA and is released. Leave the topmost segment for Major behavior/UI changes.

If you are like me you will make it a hybrid of the methods so as to match the pace of your software's progression.

I think the most accepted pattern a.b.c. or a.b.c.d especially if you have QA/Compliance in the mix. I have had so much flack around date being a regular part of versions that I gave it up for mainstream.

I do not track builds so I like to use the a.b.c pattern unless a hotfix is involved. When I have to apply a hotfix then I apply parameter d as a date with time. I adopted the time parameter as d because there is always the potential of several in a day when things really blow up in production. I only apply the d segment (YYYYMMDDHHNN) when I'm diverging for a production fix.

I personally wouldn't be opposed to a software scheme of va.b revc where c is YYYYMMDDHHMM or YYYYMMDD.

All that said. If you can just snag a tool to configure and run with it will keep you from the headache having to marshall the opinion facet of versioning and you can just say "use the tool"... because everyone in the development process is typically so compliant.

rwheadon
  • 241
  • 1
  • 12