Introduction
Design For Test (DFT)) is a method that is part of a larger methodology known as DFX - Design For Excellence. DFT focuses on issues related to testing products at various stages of the manufacturing process.
Implementing DFT recommendations supports product testing and diagnostics, reduces the cost of non-conformities in the production process, and ultimately saves time and resources.
This article delves into the principles of DFT, analyzes typical examples, and emphasizes its importance for project success.
DFT for hardware
In the design of various physical devices (hardware), DFT solutions can be applied in different ways. Here are three main aspects to consider:
Connection to the tester
A key aspect of DFT is the tester's ability to connect the unit under test (UUT) correctly. The preferred method is some kind of standard link, interface, test points, etc. Standardizing this solution allows typical diagnostic solutions to be more easily applied during production.
Selected examples in the electronics industry:
- Test Points. The test point's location, diameter, and clearance shall allow correct contact with test probes. The test points are used by test methods such as ICT (In-Circuit Test), Flying Probes Test (FPT), and Functional Test (FCT).
- Diagnostic Interface. The most common is some form of serial link (USB, UART, SPI, I2C, JTAG) or Ethernet. Other solutions are less common (e.g., parallel data bus).
Test mode
One interesting form of DFT is a solution in which the UUT is placed into a special test mode. The test mode allows verification of individual product functions without simulating the entire environment and unusual forcing that is difficult to replicate.
Selected examples in the electronics industry:
- BIST (Built-In Self Test). This technique is mainly used in the semiconductor manufacturing process; however, this concept can also be implemented at the level of electronic modules or even for complete large systems.
- JTAG Boundary Scan. This test method involves accessing the internal registers (test cells) of ICs via a standard JTAG test port. Some digital ICs, mainly FPGAs, larger MCU/CPUs, some memories, and other dedicated chips support such a test. Standards in the IEEE 1149.x series specify detailed requirements for this type of test[1].
- Firmware test mode. A special test program is uploaded to the UUT's MCU / memory / FPGA to test product functions. After the test, this special code is replaced with firmware required for field use.
Dividing into modules
Testing complex large systems can be very challenging. Especially when an error in one subsystem causes subsequent errors in other subsystems, and a feedback loop sends the incorrect information back to the initial subsystem where the error occurred. This situation causes a "loop" effect, making it challenging to identify the actual fault location in the system. It complicates fault isolation and increases testing and analysis costs. One solution to this problem may be to divide the large system into smaller, separately tested subsystems. The final test of the entire integrated system is conducted only after testing each individual subsystem.
DFT for software
In software engineering, we may come across the Test Driven Development (TDD)[2]. TDD is a programming methodology in which tests for new functionality are written first, followed by code that passes those tests. This approach promotes the creation of more reliable and easier-to-test software.
In TDD, we divide the process of developing program code into three phases carried out cyclically:
- Test development and verification. Red phase.
- Develop a new test. A new test is developed with a view of what input data will be given to the code under test and what its correct response should be. I recommend creating multiple test variants and changing the values of the input data, i.e., correct data, correct data in the upper and lower limits of the range, wrong data just out of range, data significantly out of range, no data, completely wrong data (e.g., characters instead of numbers), etc.
- Test check. I recommend testing the test :). Run all the tests and ensure the new test will "fail" (a red status in the IDE).
- Code development and testing. Green phase.
- Develop the code. At this stage, the actual code of the application is developed. For example, develop a class or add another method, etc. Try writing the minimum amount of code necessary to pass the new test. Do not add functionality for which there is no test.
- Test the code. Run the "new" test and all previously written tests. Verification of the developed code follows. Correct the code until it passes all tests (green status in the IDE). The new test can detect an error in the newly added code, and the "old tests" should detect errors in other parts of the code if affected by the new code.
- Code refactoring.
- Refactor the code. Improve the code structure, removing possible duplicates, unnecessary dependencies, etc.
- Retest the code. After refactoring, I recommend that you recheck all tests :)
The three phases of Test Driven Development:
TDD encourages developers to consider a project's requirements before writing functional code, which leads to more reliable, clean, and maintainable software. You may also find that having clear interfaces and applying the SOLID principle are very helpful.
There are many other principles that are helpful in creating testable code, such as the SOLID principle, design patterns, MVC, and the use of layers, such as HAL, in relation to hardware.
In summary, high-quality code results from choosing the right software architecture, thinking about the structure of the code, and dividing it into logical layers and functional blocks. Methods such as TDD are very helpful in this aspect.
Summary
Design for Test (DFT) is an essential aspect of modern engineering, ensuring that products are designed with testability in mind. Engineers can improve their products' reliability, maintainability, and performance by applying DFT principles. Whether in software, semiconductors, automotive, consumer electronics, or aerospace, DFT methodologies enable early error detection, streamline testing processes and improve overall product quality. Mastering DFT is essential for design engineers to deliver robust and reliable products in today's competitive marketplace.
Footnotes
- https://standards.ieee.org/ieee/1149.1/4484/
- Kent Beck, Test Driven Development: By Example 1st Edition, 2002.