JaroslavTulach at 10:59, 22 August 2011 - 2011-08-22 10:59:48

←Older revision Revision as of 10:59, 22 August 2011
Line 7: Line 7:
<source lang="java" snippet="total.rewrite.oldimpl"/>
<source lang="java" snippet="total.rewrite.oldimpl"/>
-
and here is a (randomized) test to check the compatibility of new and old implementation:
+
and here is a [[RandomizedTest]] to check the compatibility of new and old implementation:
<source lang="java" snippet="total.rewrite.compare"/>
<source lang="java" snippet="total.rewrite.compare"/>

JaroslavTulach at 06:46, 5 August 2010 - 2010-08-05 06:46:41

←Older revision Revision as of 06:46, 5 August 2010
Line 10: Line 10:
<source lang="java" snippet="total.rewrite.compare"/>
<source lang="java" snippet="total.rewrite.compare"/>
 +
 +
 +
[[Category:APIDesignPatterns]] [[Category:APIDesignPatterns:Evolution]] [[Category:APIDesignPatterns:Test]]

JaroslavTulach: 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... - 2009-06-26 09:27:17

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...

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 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:

<source lang="java" snippet="total.rewrite.oldimpl"/>

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

<source lang="java" snippet="total.rewrite.compare"/>