ImplementationCompatibilityTest

From APIDesign

(Difference between revisions)
Jump to: navigation, search

JaroslavTulach (Talk | contribs)
(New page: Very useful style of tests to ensure BackwardCompatibility when doing major rewrite of an implementation behind an API. Discussed in details in Chapter 15. The basic idea cons...)
Next diff →

Revision as of 09:27, 26 June 2009

Very useful style of tests to ensure BackwardCompatibility when doing major rewrite of an implementation behind an API. Discussed in details in Chapter 15.

The basic idea consist of copying the original implementation of an API into the test and then performing various calls into the API twice (in the new and old implementation) and then ensuring the result is the same.

For an example see this style applied to old good Arithmetica class introduced in AlternativeBehaviour. Here is the copy of old implementation:

does not exists: total.rewrite.oldimpl

and here is a (randomized) test to check the compatibility of new and old implementation:

does not exists: total.rewrite.compare
Personal tools
buy