Test fixture

Last updated

A test fixture is a device used to consistently test some item, device, or piece of software. Test fixtures are used in the testing of electronics, software and physical devices.

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. [1] Examples are a bed of nails tester or smart fixture.

Software

In the context of software a test fixture (also called "test context") is used to set up system state and input data needed for test execution. [2] [3] For example, the Ruby on Rails web framework uses YAML to initialize a database with known parameters before running a test. [4] This allows for tests to be repeatable, which is one of the key features of an effective test framework. [2]

Setup

Test fixtures can be set up three different ways: in-line, delegate, and implicit.

  1. In-line setup creates the test fixture in the same method as the rest of the test. While in-line setup is the simplest test fixture to create, it leads to duplication when multiple tests require the same initial data.
  2. Delegate setup places the test fixture in a separate standalone helper method that is accessed by multiple test methods.
  3. Implicit setup places the test fixture in a setup method which is used to set up multiple test methods. This differs from delegate setup in that the overall setup of multiple tests is in a single setup method where the test fixture gets created rather than each test method having its own setup procedures and linking to an external test fixture. [5]

Advantages and disadvantages

The main advantage of a test fixture is that it allows for tests to be repeatable since each test is always starting with the same setup. Test fixtures also ease test code design by allowing the developer to separate methods into different functions and reuse each function for other tests. Further, test fixtures preconfigure tests into a known initial state instead of working with whatever was left from a previous test run.

A disadvantage is that it could lead to duplication of test fixtures if using in-line setup. [2] [5]

Practices to avoid

It is considered bad practice when implicit test fixtures are too general, or when a test method sets up a test fixture and does not use it during the test. A more subtle issue is if the test methods ignore certain fields within the test fixture. Another bad practice is a test setup that contains more steps than needed for the test; this is a problem seen in in-line setup. [5]

A test case is considered "unsafe" when it modifies its fixture(s). An unsafe test case can render subsequent tests useless by leaving the fixture in an unexpected state. It also causes the order of tests to be important: a modified fixture must be reset if more tests are to be run after an unsafe test. [2]

Examples

Examples of fixtures include 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, or the preparation of input data as well as set-up and creation of mock objects.

Software which is used to run reproducible tests systematically on a piece of software under test is known as a test harness; part of its job is to set up suitable test fixtures.

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. [6]

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
  2. Exercise, interacting with the system under test
  3. Verify, determining whether the expected outcome has been obtained
  4. Tear down, to return to the original state

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. [7]

Many test methods detail the requirements of test fixtures in the text of the document. [8] [9]

Some fixtures employ clamps, wedge grips and pincer grips.

Further types of construction include eccentric roller fixtures, thread grips and button head grips and rope grips.

Mechanical holding apparatuses provide the clamping force via arms, wedges or eccentric wheel to the jaws. Additionally there are pneumatic and hydraulic fixtures for tensile testing that allow very fast clamping procedures and very high clamping forces.

See also

Related Research Articles

<span class="mw-page-title-main">Grip (occupation)</span> Camera supporting equipment technician

In the United States, Canada and the United Kingdom, grips are camera support equipment technicians in the filmmaking and video production industries. They constitute their own department on a film set and are directed by a key grip. Grips have two main functions: The first is to work closely with the camera department to provide camera support, especially if the camera is mounted to a dolly, crane, or in an unusual position, such as the top of a ladder. Some grips may specialize in operating camera dollies or camera cranes. The second function is to work closely with the electrical department to create lighting set-ups necessary for a shot under the direction of the director of photography.

Grips' responsibility is to build and maintain all the equipment that supports cameras. This equipment, which includes tripods, dollies, tracks, jibs, cranes, and static rigs, is constructed of delicate yet heavy duty parts requiring a high level of experience to operate and move. Every scene in a feature film is shot using one or more cameras, each mounted on highly complex, extremely expensive, heavy duty equipment. Grips assemble this equipment according to meticulous specifications and push, pull, mount or hang it from a variety of settings. The equipment can be as basic as a tripod standing on a studio floor, to hazardous operations such as mounting a camera on a 100 ft crane, or hanging it from a helicopter swooping above a mountain range.

Good Grips perform a crucial role in ensuring that the artifice of film is maintained, and that camera moves are as seamless as possible. Grips are usually requested by the DoP or the camera operator. Although the work is physically demanding and the hours are long, the work can be very rewarding. Many Grips work on both commercials and features.

<span class="mw-page-title-main">Plastic welding</span> Welding of semi-finished plastic materials

Plastic welding is welding for semi-finished plastic materials, and is described in ISO 472 as a process of uniting softened surfaces of materials, generally with the aid of heat. Welding of thermoplastics is accomplished in three sequential stages, namely surface preparation, application of heat and pressure, and cooling. Numerous welding methods have been developed for the joining of semi-finished plastic materials. Based on the mechanism of heat generation at the welding interface, welding methods for thermoplastics can be classified as external and internal heating methods, as shown in Fig 1.

<span class="mw-page-title-main">Chuck (engineering)</span> Clamp used to hold an object with radial symmetry, especially a cylinder

A chuck is a specialized type of clamp used to hold an object with radial symmetry, especially a cylinder. In a drill, a mill and a transmission, a chuck holds the rotating tool; in a lathe, it holds the rotating workpiece.

<span class="mw-page-title-main">Videography</span> Process of capturing moving images on electronic media

Videography is the process of capturing moving images on electronic media and even streaming media. The term includes methods of video production and post-production. It used to be considered the video equivalent of cinematography, but the advent of digital video recording in the late 20th century blurred the distinction between the two, as in both methods the intermediary mechanism became the same. Nowadays, any video work could be called videography, whereas commercial motion picture production would be called cinematography.

Robot software is the set of coded commands or instructions that tell a mechanical device and electronic system, known together as a robot, what tasks to perform. Robot software is used to perform autonomous tasks. Many software systems and frameworks have been proposed to make programming robots easier.

<span class="mw-page-title-main">Three-point flexural test</span> Standard procedure for measuring modulus of elasticity in bending

The three-point bending flexural test provides values for the modulus of elasticity in bending , flexural stress , flexural strain and the flexural stress–strain response of the material. This test is performed on a universal testing machine with a three-point or four-point bend fixture. The main advantage of a three-point flexural test is the ease of the specimen preparation and testing. However, this method has also some disadvantages: the results of the testing method are sensitive to specimen and loading geometry and strain rate.

<span class="mw-page-title-main">Universal testing machine</span> Type of equipment for determining tensile or compressive strength of a material

A universal testing machine (UTM), also known as a universal tester, materials testing machine or materials test frame, is used to test the tensile strength and compressive strength of materials. An earlier name for a tensile testing machine is a tensometer. The "universal" part of the name reflects that it can perform many standard tensile and compression tests on materials, components, and structures.

<span class="mw-page-title-main">Curve tracer</span>

A curve tracer is a specialised piece of electronic test equipment used to analyze the characteristics of discrete electronic components, such as diodes, transistors, thyristors, and vacuum tubes. The device contains voltage and current sources that can be used to stimulate the device under test (DUT).

<span class="mw-page-title-main">Brake-by-wire</span> Automotive technology

Brake-by-wire technology in the automotive industry is the ability to control brakes through electronic means, without a mechanical connection that transfers force to the physical braking system from a driver input apparatus such as a pedal or lever.

<span class="mw-page-title-main">Landfill liner</span>

A landfill liner, or composite liner, is intended to be a low permeable barrier, which is laid down under engineered landfill sites. Until it deteriorates, the liner retards migration of leachate, and its toxic constituents, into underlying aquifers or nearby rivers, causing potentially irreversible contamination of the local waterway and its sediments.

<span class="mw-page-title-main">Split-Hopkinson pressure bar</span>

The split-Hopkinson pressure bar, named after Bertram Hopkinson, sometimes also called a Kolsky bar, is an apparatus for testing the dynamic stress–strain response of materials.

<span class="mw-page-title-main">Paint adhesion testing</span>

In the paint and coating industries, paint adhesion testing is often used to determine if the paint or coating will adhere properly to the substrates to which they are applied. Several tests measure the resistance of paints and coatings from substrates: cross-cut test, scrape adhesion, pull-off test, and others.

The Statnamic load test is a type of test for assessing the load-carrying capacity of deep foundations which is faster and less expensive than the static load test. The Statnamic test was conceived in 1985, with the first prototype tests carried out in 1988 through collaboration between Berminghammer Foundation Equipment of Canada and TNO Building Research of the Netherlands. Guidance on rapid load pile testing can be found in: Methods for Axial Compressive Force Pulse (Rapid) Testing of Deep Foundations. Sanken D7383 - 08 Standard Test.

Rising Step Load Testing is a testing system that can apply loads in tension or bending to evaluate hydrogen-induced cracking. It was specifically designed to conduct the accelerated ASTM F1624 step-modified, slow strain rate tests on a variety of test coupons or structural components. It can also function to conduct conventional ASTM E8 tensile tests; ASTM F519 200-hr Sustained Load Tests with subsequent programmable step loads to rupture for increased reliability; and ASTM G129 Slow Strain Rate Tensile tests.

<span class="mw-page-title-main">Tensile testing</span> Test procedure to determine mechanical properties of a specimen.

Tensile testing, also known as tension testing, is a fundamental materials science and engineering test in which a sample is subjected to a controlled tension until failure. Properties that are directly measured via a tensile test are ultimate tensile strength, breaking strength, maximum elongation and reduction in area. From these measurements the following properties can also be determined: Young's modulus, Poisson's ratio, yield strength, and strain-hardening characteristics. Uniaxial tensile testing is the most commonly used for obtaining the mechanical characteristics of isotropic materials. Some materials use biaxial tensile testing. The main difference between these testing machines being how load is applied on the materials.

A pipe support or pipe hanger is a designed element that transfer the load from a pipe to the supporting structures. The load includes the weight of the pipe proper, the content that the pipe carries, all the pipe fittings attached to pipe, and the pipe covering such as insulation. The four main functions of a pipe support are to anchor, guide, absorb shock, and support a specified load. Pipe supports used in high or low temperature applications may contain insulation materials. The overall design configuration of a pipe support assembly is dependent on the loading and operating conditions.

This page is a glossary of Prestressed concrete terms.

Green strength, or handling strength, can be defined as the strength of a material as it is processed to form its final ultimate tensile strength. This strength is usually considerably lower than the final ultimate strength of a material. The term green strength is usually referenced when discussing non-metallic materials such as adhesives and elastomers. Recently, it has also been referenced in metallurgy applications such as powdered metallurgy.

<span class="mw-page-title-main">Biaxial tensile testing</span> Testing a materials tensile strength along two perpendicular axes

In materials science and solid mechanics, biaxial tensile testing is a versatile technique to address the mechanical characterization of planar materials. It is a generalized form of tensile testing in which the material sample is simultaneously stressed along two perpendicular axes. Typical materials tested in biaxial configuration include metal sheets, silicone elastomers, composites, thin films, textiles and biological soft tissues.

References

  1. Tadic, Srdjan; Vukajlovic, Milan (2018). "Automated test Fixture For In-Production Functional Testing of Electronic Devices" (PDF). Retrieved September 10, 2023.
  2. 1 2 3 4 Pereira da Silva, Lucas (June 10, 2016). "Execution and code reuse between test classes". 2016 IEEE 14th International Conference on Software Engineering Research, Management and Applications (SERA). pp. 99–106. doi:10.1109/SERA.2016.7516134. ISBN   978-1-5090-0809-4. S2CID   17820790.
  3. "Test Fixture - xUnit". xUnit Patterns. Retrieved September 10, 2023.
  4. "A Guide to Testing Rails Applications".
  5. 1 2 3 Greiler, Michaela; Zaidman, Andy; van Deursen, Arie; Storey, Margaret-Anne (2013). Strategies for Avoiding Text Fixture Smells during Software Evolution (PDF). 10th IEEE Working Conference on Mining Software Repositories (MSR). doi:10.1109/MSR.2013.6624053 . Retrieved 24 January 2014.
  6. Meszaros, Gerard (2007). xUnit Test Patterns: Refactoring Test Code (PDF). Addison-Wesley Professional. ISBN   978-0-13-149505-0. Archived from the original (PDF) on 23 September 2016.
  7. Abadalah, MG; Gascoigne, HE (1989). The Influence of Test Fixture Design on the Shear Test for Fiber Composite Materials. ASTM STP.
  8. ASTM B829 Test for Determining the Formability of copper Strip
  9. ASTM D6641 Compressive Properties of Polymer Matrix Using a Combined Loading Compression Test Fixture