XUnit
From Wikipedia, the free encyclopedia
- The correct title of this article is xUnit. The initial letter is shown capitalized due to technical restrictions.
Various code-driven testing frameworks have come to be known collectively as xUnit. Such frameworks are based on a design by Kent Beck, originally implemented for Smalltalk as SUnit, but are now available for many programming languages and development platforms.
Contents |
[edit] xUnit Design
The overall design of xUnit frameworks depends on several components.
[edit] Test Fixtures
A test fixture is the set of preconditions or state needed for a test to run. Also known as a test context.
[edit] Test Execution
The execution of an individual unit test proceeds as follows:
setup(); ... /* Body of test */ ... teardown();
The setup() and teardown() methods serve to initialize and clean up test fixtures.