CRUnit - Capture / Replay Based Unit Testing
范振維 · 2012
Adopting xUnit testing framework in software development often requires a lot of refactoring to the system under test (SUT). Contrast to system testing which can be performed by tools, xUnit testing is coding activity which produces test code as the delivery. However, test code often suffers from maintenance problems like system code. In this paper, a prototype tool called CRUnit is proposed to reduce the test overhead from adopting xUnit testing framework. CRUnit is an extension to the JUnit module in Eclipse IDE, which can replace the hand-crafted assertions by a Capture / Replay process with the help from debuggers. Contrast to xUnit testing framework that treats a SUT as a black-box, CRUnit probes the internal states of a SUT so that complicated hand-crafted assertions can be excluded from test methods and class encapsulation principles are no longer compromised. This semi-automated process is achieved by introducing the verification power of human brain and human eyes and the help from the “visualizers”.