Before we start.
Software in a medical device does what it was written, or trained, to do, on whatever input arrives. A trial like the one above shows how one program behaved for 819 analyzable people. A maker, a regulator and a hospital need something more: a reason to believe the next person will get the right answer too, including people the trial never saw, and that the reason will survive the next release. That is the question this guide answers: software can never be tested on every path, and an AI model learns only from the data its makers chose; what evidence shows either will give the right answer for the next patient, and what keeps that true after an update?
Four terms carry the argument. A device software function is software that meets the legal definition of a medical device, whether it runs inside a pump or on a server by itself. An algorithm is the procedure the software follows. In this guide, an AI model is an algorithm whose decision rules were fitted to example data rather than written line by line. And evidence means records that someone outside the team could check: requirements, test results, study data, monitoring reports.
The answer comes in four parts. Testing samples what software does and can never cover all of it, because even a modest program has more paths, and may meet more inputs, than any test campaign can try. Confidence therefore comes from how the software was built: requirements derived from the harm a fault could do and traced to tests, an architecture that keeps the dangerous part small enough to test thoroughly, a full account of the code someone else wrote, and proof that each change broke nothing already verified. Agile teams and automated pipelines can produce that evidence, provided each increment leaves its records.
An AI model adds a second limit. Its accuracy is a measurement on a test set. That measurement holds only for patients like those in the set, scored against the reference someone chose, and only for the exact model that was locked and fed the inputs it was specified for. The evidence that the model will be right for the next patient is a test kept apart from training and drawn from the setting of use, results reported for each group of patients with their uncertainty, a check at each hospital that the specified conditions hold, and monitoring once the model is in use.
Someone can also make a device fail on purpose. New ways of attacking it appear while its code stays the same, so a device must be built to be patched and watched for years, starting from a list of the components inside it. What keeps all of this true after an update is change control: every change is judged against the claims it could move, and, for AI, a plan agreed with the regulator in advance says what may change and how the new model must be tested.
One fact shapes every chapter. Software does not wear out. A pump's motor and a camera's sensor age and fail at rates that can be measured; software does not age at all. Every way it can fail was built in on the day it shipped or arrived with an update, and it waits there for the input that triggers it. For an AI model, the training data is part of what was built.
How to read this guide
The guide runs through 29 chapters in eight parts. Parts I and II explain why software fails differently from hardware and what a software lifecycle does about it, including when much of the code comes from elsewhere and when the team ships every two weeks. Parts III and IV turn to models learned from data: how they are built and scored, and why they do worse on patients unlike those they were tested on. Part V follows a model into a hospital and through its later versions, and its last chapter, Chapter 21, closes with the answer to the central question. Part VI covers attack and defense, Part VII surveys the products and makers of October 2026, and Part VIII sets out what the FDA, the EU and India require, as of that month. IDx-DR is the guide's running case and returns throughout, and the recalled insulin pumps return in the security chapters. A reader who builds devices can start with Chapters 4 to 9, 21, 23, 27 and 28; a reader who buys or deploys them, with Chapters 17 to 20, 24 and 29. Every chapter works through one example with real numbers. Plates are numbered in their own sequence, so that each can be cited by its number alone. These boxes recur:
Blue edge. Carries the structural point of a section, or a calculation worked once with real values and stated assumptions.
Orange edge. Names a common misreading, a trap, or the limit of a claim.
Green edge. Maps the idea onto the reader's own work: specifying, building or testing device software, evaluating an AI product, deploying it in a hospital, or planning the evidence for a submission.
- Each chapter closes with what it established, in four lines.
No formula needs more than arithmetic. Proportions such as sensitivity are given as percentages, and uncertainty as a range. Three calculations size a test, each worked once with numbers: a run of failure-free trials puts an upper bound on a failure rate (Chapter 3), the precision wanted from an estimate sets how many patients a study needs (Chapter 11), and the power wanted from a test against a floor sets how many a local check needs (Chapter 19). Counting paths uses doubling, and large numbers are written in words or in full, such as a billion or 1,000,000,000. The guide uses US spelling.
Colors in the plates follow a fixed key. Requirements, claims and acceptance criteria are gold; software the maker wrote, and a model running as software, is teal, with third-party code hatched in the same teal; data of every kind, from training sets to the images a device receives, is violet; an attacker, an attack path or a vulnerability is red; and a defect, a wrong output or a drift in performance is magenta. The output reported to a clinician or patient is always blue, and one orange mark in each plate points at the detail that matters most. A key strip under every plate lists only the colors that plate uses.
This is a reference for understanding, not a development procedure, a regulatory opinion or clinical advice. Products, authorizations, guidances, standards and laws are stated as of October 2026 and will date; several of those named here were drafts or under revision in that month, and the text says which. Where a figure comes from a company about its own product, or from a paper whose authors work for that company, the text says so. Named companies and products are examples of a principle, not recommendations. Cost, review times, fees and make-or-buy decisions are outside the guide, although the chapters on documentation, classification, test design, change plans and third-party code describe what drives them.
Let's Talk