API Testing · Senior · Question 6 of 75
What is a sensible backward-compatibility policy for a public API?
- 1Any change is allowed as long as the docs are updated the same day
- 2Never change the API after the first release under any conditions
- 3Only additive changes in a version, breaking ones in a new version with a sunset
Show the answer
Correct answer: Only additive changes in a version, breaking ones in a new version with a sunset
Explanation
Clients need predictability. Tests guard the policy: contract checks fail on removed or retyped fields within a version.