Sunday, January 31, 2010

Design for Test and Reliability

Design for Test is part of standard practice in the microcontroller industry. It is discussed in the context of software engineering as well - but it is absolutely essential to the makers of large-scale microprocessors. The key concept is that the programming interface to a CPU does not allow access to many of the internals of the chip and additional logic is therefore added to the hardware to allow test and diagnosis of the device outside the scope of normal use. DFT is necessary to handle the fact that minor flaws can prevent execution of all diagnostic self-test operations.

Some years ago I had the opportunity to apply this principle to software architecture.
The application was a data abstraction layer in a multi-tier Windows application. The app used a relational database for persistence and presented the user with a set of objects. The layers in the design were as follows:
  • GUI
  • Business logic
  • Object model
  • Abstraction
  • ODBC
  • Database
The use of ODBC allowed a choice of databases with minimal configuration in the front end.
The part that I designed and built was the Abstraction layer and my goal was to make it as generic as possible. To accomplish this I put metadata in the database that defined the object model. The code in the Abstraction layer knew almost nothing about the business objects and their relationships to each other. It knew that there was such a thing as an object, that an object had properties, that objects could have relationships and dependencies, and what the property types could be. At first, all the other details were in data in the database that matched the expectations of the business logic. This allowed us to change the front end and the object model with little or no impact on the design or implementation of the Abstraction layer.

One way to apply the DFT principle to software is to add code that does some sort of internal self-test or consistency check. In this case, we didn't add any code that wasn't used in normal operation. In fact, we went in the other direction and stripped out any code we didn't absolutely need to get the Abstraction function to run. This led to an implementation that was very generic and concise. Even the definition of the generic data object was in the database.
Obviously some bootstrap code was needed to make this work. And in the revised and rewritten code in the second release we took out the initial bootstrap to improve performance.
The effect on test was simply that no unit test was needed for this part of the implementation. It either worked or it didn't. Like the FORTH language, which has a tiny interpreter, we started with a very compact core and built out from there.

2 comments:

  1. The software conversation you are sharing here is showing why what people can do with it is still very valuable in this economy. I talk to friends that develop gov., security and engineering softwares that are having record years.... but unlike other business there is a barrier to entry of being brilliant.

    The only way that I am able to figure things out like this is to know people that know it and trust them as friends to give me the straight answers on how things really work in the world of software. You are building an incredbile base of information that really shows you know what you are talking about.

    "The effect on test was simply that no unit test was needed for this part of the implementation. It either worked or it didn't."

    This reminds me of biotech molecular studies they either work or they do not and the situation for moving forward becomes... what is the word? Binary?

    The work that you are sharing seems to be workable for a variety of different businesses because what it really comes down to in my opinion is trusting your systems.

    I think you will do great by blogging about this because it really then falls into the grouping of

    "do things that others are unwilling to do"

    You have some of the best stuff I have seen on software.

    Thank you for sharing these concepts.

    ReplyDelete
  2. Tom, software is probably the most popular form of engineering these days but it's really not so different from any other kind of science. There are ways to work systematically from ideas to results and these methods apply in many fields.

    I am glad to know that you find this useful - and I will continue to share what I know.

    ReplyDelete