Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
EE Times-Asia > Embedded

C++ target testing for peripherals design

Posted: 06 Feb 2004 ?? ?Print Version ?Bookmark and Share

Keywords:testing software? c++? embedded applications? hardware? c embedded?

Langmead: As computer systems evolve, the need for rigorous software testing must also change.

Testing software has always been a difficult activity. As systems grow more complex, the need for rigorous software testing has increased. The fact that software written for peripherals is, by their nature embedded, add further complexity to the issue of testing. One question is the testing of software, which has been developed on a host, but which will eventually be deployed on a peripheral device. Oftentimes, during the development of the software, the target hardware is simply not available for use by the software tester. Moreover, sometimes there is only one target, and a team of software developers needs access to the one piece of hardware.

Included in the paper are the historical host-based approaches for testing peripheral devices, identifying their strengths and weaknesses, and proposing solutions to some of the traditional problems of a host-based only testing strategy. The use of host-based simulators is discussed as a solution to target hardware availability problems. An example where code could execute differently on a host and target is presented, and the testability of such code is discussed. A brief review of C embedded development, and the emergence of C++ for embedded applications is also undertaken.

The report then considers the challenge of developing testable software for embedded applications, regarding on how the developer can test difficult situations, such as lack of memory, or code to deal with a failed connection. Another is on how a C++ developer can test the implementation of a class, such as if the implementation is private, or when the testing is finished and the software now works. Other problems considered in the paper include the issue of stubbing (simulating) C++ classes, differing ISO C++ implementations between host and target compilers, and the insufficiency of traditional coverage metrics in object oriented software development.

There are many solutions to the problems outlined above. An IPL-developed approach called "wrapping" gives the embedded developer full control of the interfaces between the software under test and the linked-in software, firmware or hardware. Using wrapping enables the simulation of difficult-to-test conditions, such as a lack of memory resources on the target, and finer control between software interfaces at the integration testing level. The language subsets embedded C++ (EC++) and embedded C++ with templates (ETC++) are considered as solutions to the problems of code bloat and limited memory.

The paper also discusses white box testing as a solution to the C++ private data problem, and the use of code coverage as the traditional means of concluding that enough testing has been undertaken. Object oriented coverage is defined, and presented as a solution to remedy problems with traditional coverage methods in object oriented development. Rigorous use of language subsets acceptable to both the host and target compilers, as well as the ability of testing solutions to handle language extensions, is required to deal effectively with the differing C++ implementations among compiler vendors. Finally, a tabular summary of problems and solutions relating to the testing of embedded applications in the peripherals market is presented.

- Neil Langmead

Software Consultant

IPL Information Processing Ltd

* IPL Information Processing will participate in this year's IIC-China, ESC-China and EDA&T-China events.

Article Comments - C++ target testing for peripherals d...
*? You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.

Back to Top