Skip to Content

Microsoft AZ-400: Which SemVer version number should assign to app release after change code to fix bug

Question

You use GitHub to host container packages that use Semantic Versioning (SemVer). You have an app named App1. The current version of App1 is 11.2.0. You change the code of App1 to fix a bug that was introduced in version 10.5.1. Which version number should you assign to the release?

A. 10.5.1-PATCH
B. 11.2.1
C. 10.5.2
D. 10.6.0

Answer

B. 11.2.1

Explanation

The correct option is: B. 11.2.1.

Semantic Versioning (SemVer) is a versioning scheme that follows a specific format: `MAJOR.MINOR.PATCH`. Each component has a specific meaning:

  • MAJOR: Incremented for backward-incompatible changes.
  • MINOR: Incremented for backward-compatible new features.
  • PATCH: Incremented for backward-compatible bug fixes.

Given the scenario, here’s the reasoning for the correct answer:

  • The current version is 11.2.0.
  • You fixed a bug that was introduced in version 10.5.1.

The goal is to maintain a consistent versioning scheme and reflect the changes accurately. Since the bug was introduced in version 10.5.1, you would want to update the MINOR version because it’s a backward-compatible bug fix. However, the version 10.5.1 itself is a prior version, so you should also ensure that the new version is greater than that.

Considering this, the best approach is to increment the MINOR version by one and set the PATCH version to 1, resulting in the version 11.2.1. This follows the SemVer rules and indicates that the release contains a bug fix that is backward-compatible.

Options A, C, and D are not the best choices based on the scenario:

  • Option A (10.5.1-PATCH) introduces a non-standard version format by appending “-PATCH” to the PATCH version. SemVer doesn’t use this format.
  • Option C (10.5.2) would indicate a PATCH release for version 10.5.1, but it doesn’t account for the fact that you’re actually moving forward to version 11.x.
  • Option D (10.6.0) would indicate a new MINOR version for a release that contains a bug fix. It’s better to reserve the MINOR version increment for backward-compatible new features.

In summary, the correct version number to assign to the release after fixing the bug introduced in version 10.5.1 is 11.2.1, which reflects the change and follows the principles of Semantic Versioning.

Reference

Designing and Implementing Microsoft DevOps Solutions AZ-400 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Designing and Implementing Microsoft DevOps Solutions AZ-400 exam and earn Designing and Implementing Microsoft DevOps Solutions AZ-400 certification.