Test fixture
Encyclopedia
A test fixture is something used to consistently test some item, device, or piece of software.

Electronics

Circuit boards, electronic components, and chips are held in place and subjected to controlled electronic test signals. One example is a bed of nails tester.

Software

Test fixture refers to the fixed state used as a baseline for running tests in software testing
Software testing
Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test. Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software...

. The purpose of a test fixture is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable. Some people call this the test context.

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
    Mock object
    In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the...


Test fixture in xUnit

In generic xUnit
XUnit
Various code-driven testing frameworks have come to be known collectively as xUnit. These frameworks allow testing of different elements of software, such as functions and classes...

, 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:
  1. Set up -- Setting up the test fixture.
  2. Exercise -- Interact with the system under test.
  3. Verify -- Determine whether the expected outcome has been obtained.
  4. 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 test
Physical test
A physical test is a qualitative or quantitative procedure that consists of determination of one or more characteristics of a given product, process or service according to a specified procedure...

ing, a fixture is a device or apparatus to hold or support the test specimen
Specimen
A specimen is a portion/quantity of material for use in testing, examination, or study.BiologyA laboratory specimen is an individual animal, part of an animal, a plant, part of a plant, or a microorganism, used as a representative to study the properties of the whole population of that species or...

 during the test. The influence of test fixtures on test results is important and is an ongoing subject of research.

Many test method
Test method
A test method is a definitive procedure that produces a test result.A test can be considered as technical operation that consists of determination of one or more characteristics of a given product, process or service according to a specified procedure. Often a test is part of an experiment.The test...

s detail the requirements of test fixtures in the text of the document.
Some fixtures employ clamps, wedge grips and pincer grips.

Further types of construction are eccentric roller fixtures, thread grips and button head grips as well as rope grips.

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
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK