MockingLegacyCode
Last edit May 21, 2003
MockingLegacyCode
is not about making fun of other people's code, it's about
MockObject
s.
LegacyCode
, especially when it is
SpaghettiCode
, can be quite hard to test. One powerful technique for
UnitTestingLegacyCode
is using
MockObject
s. I've found that there is a moderately steep cost to set up the initial
MockObject
s, but the payoff is big because
MockObject
s have a high reuse factor.
AlittleMockGoesAlongWay
. See
MockingInManyLanguages
for examples.
CategoryMockObjects
|
CategoryTesting