0

Say I have written a piece of software (in R, for didactic purposes) which is following the Semantic Versioning Specification. This is the content of version 1.0.0 of the software:

funk <- function(x) {
    jitter(x)
}

Which works so that

set.seed(1)
print(funk(0))

yields

[1] -0.009379653

Now suppose I change my function to this:

funk <- function(x) {
    unrelated_random_stuff <- sample(1:10)
    jitter(x)
}

And now, set.seed(1); print(funk(0)) yields

[1] -0.01176102

According to SemVer, does this constitute a major change? I.e., if I publish the software with these changes, should it be 2.0.0? I'm inclined to think so, since this technically changes results from scripts based on version 1.0.0, but I am not sure this qualifies as "breaking backwards compatibility" since we're talking about randomly-generated numbers.

Waldir Leoncio
  • 10,853
  • 19
  • 77
  • 107

1 Answers1

1

If your customers are inclined to take a dependency on the output value, then yes, you probably want to bump the major version number. Even if this is library code, it's possible someone is using it for fuzz testing and it's critically important to yield reproducible result, in order to find track down and fix bugs, as well as ensure the fix does not regress in the future.

jwdonahue
  • 6,199
  • 2
  • 21
  • 43