Test fixture
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
A test fixture is something used to consistently test some item, device, or piece of software.
Contents
Electronics
In testing electronic equipment such as circuit boards, electronic components, and chips, a test fixture is a device or setup designed to hold the device under test in place and allow it to be tested by being subjected to controlled electronic test signals.
Examples are a bed of nails tester or SmartFixture.
Software
In software testing, a test fixture is a fixed state of the software under test used as a baseline for running tests; also known as the test context. It may also refer to the actions performed in order to bring the system into such a state.
Examples of fixtures:
- Loading a database with a specific, known set of data
- Erasing a hard disk and installing a known clean operating system installation
- Copying a specific known set of files
- Preparation of input data and set-up/creation of fake or mock objects
Software used to systematically run reproducible tests on a piece of software under test is known as a test harness; part of its job is to set up suitable test fixtures.
Test fixture in xUnit
In generic xUnit, a test fixture is all the things that must be in place in order to run a test and expect a particular outcome.
Frequently fixtures are created by handling setUp() and tearDown() events of the unit testing framework. In setUp() one would create the expected state for the test, and in tearDown() it would clean up what had been set up.
Four phases of a test:
- Set up -- Setting up the test fixture.
- Exercise -- Interact with the system under test.
- Verify -- Determine whether the expected outcome has been obtained.
- Tear down -- Tear down the test fixture to return to the original state.
Use of fixtures
Some advantages of fixtures include separation of the test initialization (and destruction) from the testing, reusing a known state for more than one test, and special assumption by the testing framework that the fixture set up works.
Physical testing
In physical testing, a fixture is a device or apparatus to hold or support the test specimen during the test. The influence of test fixtures on test results is important and is an ongoing subject of research.[1]
Many test methods detail the requirements of test fixtures in the text of the document.[2][3]
-
Test fixture on universal testing machine for three point flex test
Some fixtures employ clamps, wedge grips and pincer grips.
-
THS527-50.jpg
offset compensated wedge grip max.50 kN
-
TH-screw-grips.jpg
different vice and screw grips of a German manufacturer
Further types of construction are eccentric roller fixtures, thread grips and button head grips as well as rope grips.
-
THS766-5.jpg
symmetric roller grip, self-closing and self-adjusting
-
THS314-2.jpg
multiple button head grip for speedy tests on series
-
THS13k-02-200N.jpg
small rope grip 200N to test fine wires
-
Temperaturkammer-spannzeug THS321-250-5.jpg
very compact wedge grip for temperature chambers providing extreme temperatures
Mechanical holding apparatus provide the clamping force via arms, wedges or eccentric wheel to the jaws. Additional there are pneumatic and hydraulic fixtures for tensile testing that do allow very fast clamping procedures and very high clamping forces
-
TH149.jpg
pneumatic grip, symmetrical, clamping force 2.4 kN
-
THS137-4-fr.jpg
heavy duty hydraulic clamps, clamping force 700 kN
-
Biegevorrichtung TH165.jpg
Bending device for tensile testing machines
-
Abzugsvorrichtung TH50+SW.jpg
Equipment to test peeling forces up to 10 kN
See also
References
<templatestyles src="Reflist/styles.css" />
Cite error: Invalid <references>
tag; parameter "group" is allowed only.
<references />
, or <references group="..." />
- Unit Testing with JUnit, by Yoonsik Cheon.
- The Low-Down on fixtures, from A Guide to Testing Rails Applications.