machine

Medical software development – Finite state machines

Food and Drug Administration (FDA) regulates significant portion of medically relevant devices and drugs but it is probably not as well known that they also regulate the software that is used to power many of the studies. There are significant guidelines from FDA that are used for manufacturers of software that regulate medical devices. The link at the bottom leads to the FDA site and if you search for “General Principles of Software Validation: Final Guidance for Industry and FDA staff” you will find a good sized document that tells you everything about but here is a small excerpt on what FDA would like to see in a typical software development lifecycle.

  • Quality Planning
  • System Requirements Definition
  • Detailed Software Requirements Specification
  • Software Design Specification
  • Construction or Coding
  • Testing
  • Installation
  • Operation and Support
  • Maintenance
  • Retirement

Software as it is developed for devices and also operating systems are complex pieces of logic. There have been significant developments to make the process easier with the use of libraries and other software that helps you write code and test software. But even though there is significant testing that is done to make sure that the software performs as tested the risk for an error is sometimes annoying or can be catastrophic for disease diagnosis.

One terminology for developing logic based software is the use of “Finite state machines”. These are interesting concepts. The simplest way to understand is that an object exists in one a few states. It takes some input to convert it to the other state. This agrees very well with the concept of a switch in electronics as well as a light switch at home. For the light switch, without your input it exists in a locked state, either ON or OFF. Only when you provide the input can you change the state. Now imagine a complicated house where throwing one switch affects another. For example, when you come home at night on a summer evening, you have first turn on the light switch and then find your way to the air-conditioner switch. Thus the state of air conditioner is dependent on the state of the light switch. Extend that logic further into multiple switches and you have a complex computer program. In biology, these “machines” could model how neurons behave or more complex behavior of an animal.

Thus to understand the complexity of the program, it is important to draw or visualize these different states that are possible. This helps explain the logic of a complex software program and also understand if there are any logical errors or how to plan for error conditions. They used to be called a flow chart too but using a Finite state machine, can make a big difference for software development cycles and should be used more frequently by device manufacturers.

https://www.fda.gov/medical-devices/device-advice-comprehensive-regulatory-assistance/guidance-documents-medical-devices-and-radiation-emitting-products