C++ target testing for peripherals design
Keywords:testing software? c++? embedded applications? hardware? c embedded?
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. |
Related Articles | Editor's Choice |
Visit Asia Webinars to learn about the latest in technology and get practical design tips.