Improving Medical Device Software with Model-Based Design
Model-based design addresses the growing challenges in medical device development by managing complexity, reducing design time and improving reliability.
Software has been playing an ever-increasing role in automobiles, planes, industrial robots and consumer electronics devices that we all rely on and take for granted today. Medical devices are no exception. A small pacemaker that can easily fit in the palm of your hand contains upwards of 80,000 lines of code. An MRI device is driven by over seven million lines of code that’s used for everything from controlling motors that move the platforms, to processing images obtained through its wide array of sensors. But a study conducted by University of Patras, Greece found one in three of all medical devices sold in the US between 1999 and 2005 were recalled for software failure.
In various research conducted over the years analyzing the recalls, the reasons that were commonly attributed to these failures were alack of detailed formal requirements analysis, and not performing sufficiently rigorous testing and verification of designs. The underlying cause for this is that traditional software development processes haven’t been able to deal with the increased software complexity in medical devices. Other industries such as aerospace and automotive experienced a similar increase in complexity over a decade ago, and addressed it by adopting model-based design to improve their software development process while achieving the desired quality and time-to-market goals for a high integrity application.
In a traditional medical device software-development workflow, software requirement specifications (SRS) are first drawn up based on market requirements and research results, followed by coding the SRS. The software specifications aren’t verified as testable and consistent until much later in this workflow. Much of the unit testing and verification tasks are manual, and separated from the larger system integration and design that happens towards the end. Requirements traceability and risk analysis/mitigation are also manual and independent tasks. Creation of evidentiary documents for regulatory compliance is usually the design engineer’s responsibility, which adds additional burden and distraction.
When adopting model-based design for medical device development, the design development begins at a higher level of abstraction than code by using multi-domain graphical and textual models that not only describe the algorithmic components, but also the environment in which they’ll operate. This provides a simulation test bed that enables most design inconsistencies and errors to be identified and eliminated well before its implementation, independent of the software development lifecycle used (spiral, waterfall, V, etc.). Many traditional verification techniques –such as functional verification,parameter sweep testing and D/C/MCDC coverage analysis –are performed at the model level to ensure that the design is comprehensively tested before implementation. Possible with the tools today are formal analysis techniques that can detect design errors without executing the model, and automatically generate test cases to achieve 100 percent model coverage.
With the designs verified and tested thoroughly at the model level, C/C++ or HDL code can be automatically generated from the models to implement them on any processor or FGPA. Automatic code generation is a repeatable and deterministic process that eliminates any manual coding errors while providing engineers the ability to control the look and feel of the resulting code. All the test harnesses used to verify the models can now be reused to test the object code after compiling the generated code on the target platform. One of the significant but understated value-add of model-based design for the medical devices industry is the ability to automatically generate reports and documentation periodically throughout the design process that can be used as evidence for regulatory compliance (such as that required by the FDA). By automating this process of report creation, engineers can focus more of their efforts on the actual design and implementation of their systems.
Figure 1: Overview of model-based design workflow along with the different reports automatically generated.
Model-based design can play a productive role in addressing the growing challenges in medical device development by managing complexity, reducing design time and improving overall design robustness and reliability.
Arvind Ananthan is the medical devices industry manager, prior to which he has held various technical selling and marketing positions, including his previous role as the product marketing manager for MATLAB Coder and Fixed-Point Toolbox at MathWorks. He has a B.E. in electronics and communications from University of Madras and an M.S. in electrical engineering from University of Maryland. Arvind can be reached at Arvind.Ananthan@MathWorks.com.