Professional Documents
Culture Documents
(Download PDF) Embedded Software Development For Safety Critical Systems Second Edition Chris Hobbs Author Online Ebook All Chapter PDF
(Download PDF) Embedded Software Development For Safety Critical Systems Second Edition Chris Hobbs Author Online Ebook All Chapter PDF
https://textbookfull.com/product/embedded-software-development-
for-safety-critical-systems-2nd-edition-chris-hobbs/
https://textbookfull.com/product/software-engineering-for-
embedded-systems-robert-oshana/
https://textbookfull.com/product/making-embedded-systems-design-
patterns-for-great-software-2nd-edition-elecia-white/
Making Embedded Systems: Design Patterns for Great
Software 2nd Edition Elecia White
https://textbookfull.com/product/making-embedded-systems-design-
patterns-for-great-software-2nd-edition-elecia-white-2/
https://textbookfull.com/product/embedded-systems-architecture-
second-edition-daniele-lacamera/
https://textbookfull.com/product/embedded-systems-architecture-
for-agile-development-a-layers-based-model-mirtalebi/
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-
loucas/
https://textbookfull.com/product/computer-systems-for-
occupational-safety-and-health-management-second-edition-ross/
Embedded Software
Development for
Safety-Critical
Systems
Second Edition
Embedded Software
Development for
Safety-Critical
Systems
Second Edition
Chris Hobbs
Cover photo by: Chuck Clark
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
This book contains information obtained from authentic and highly regarded sources. Rea-
sonable efforts have been made to publish reliable data and information, but the author
and publisher cannot assume responsibility for the validity of all materials or the conse-
quences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if
permission to publish in this form has not been obtained. If any copyright material has not
been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted,
reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other
means, now known or hereafter invented, including photocopying, microfilming, and record-
ing, or in any information storage or retrieval system, without written permission from the
publishers.
For permission to photocopy or use material electronically from this work, please access
www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Cen-
ter, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-
for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system
of payment has been arranged.
For
Alexander, Thomas,
and Edward
' ' , '
v
Contents
SECTION 1: BACKGROUND
1 Introduction ........................................................... 3
Safety Culture 4
Our Path 6
Selecting the Techniques to Describe 7
Development Approach 8
Today’s Challenges 10
References 12
SECTION 5: CODING
SECTION 6: VERIFICATION
19 Integration Testing .............................................. 289
Fault Injection Testing 290
Back-to-Back Comparison Test Between Model and Code 295
Combinatorial Testing 298
Requirements-Based Testing 302
Anomaly Detection During Integration Testing 306
References 307
SECTION 7: APPENDICES
A Goal Structuring Notation .................................... 327
Background 327
Example 328
Eliminative Argumentation 330
xii Contents
xiii
xiv Preface
References
All of the techniques described in this book may be further explored
through hundreds of academic articles. In order to provide you with
a way in, I have provided references at the end of each chapter. With
a few whimsical exceptions (e.g., Lardner’s 1834 paper on diverse pro-
gramming and Babbage’s 1837 paper on the calculating engine), I have
included only references that I have personally found useful as a work-
ing software developer.
Some of the papers and books I reference changed my ideas about
a topic and, in many cases, caused me to start programming to check
whether the concepts were actually useful.
I have to admit that I object to paying money to journals to access
published papers, and I believe that all the articles to which I refer in
the bibliographies at the end of each chapter can be freely (and legally)
downloaded from the Internet. In some cases, e.g., Kálmán’s original
1960 paper to which Chapter 8 refers, one has the option of paying the
original journal $25 to retrieve the article, or going to the website of
the associated educational establishment (in this case, the University
of North Carolina, USA) and downloading the paper for free. I leave
the choice to the reader.
I refer frequently to various international standards. These stan-
dards are continuously being revised and, when I refer to a standard in
this book, I mean the following editions:
Tools
I have used the C programming language in examples because this is
the language most strongly associated with embedded programming.
Some knowledge of C would therefore be useful for the reader, but
the examples are short and should be readable by software engineers
familiar with other languages.
From time to time I mention a particular tool. In general, I refer to
open-source tools, not because these are always superior to commercial
equivalents, but because it would be invidious to mention one com-
mercial vendor rather than another unless I had carried out a careful
comparison of the available products.
Tools are also very personal. We all know that “wars” can arise
from discussions of whether vi or emacs is the better editor. I refuse
to take the bait in these discussions, comfortable in my knowledge that
vi is far better than emacs.
So, my choice of tool may not be your choice of tool. I hope that
whenever I mention a tool, I provide enough information for you to
seek out commercial vendors.
Second Edition
The first edition of this book appeared in 2015 and the world of safety-
critical embedded software has changed substantially in the years since
then:
Acknowledgments
This book has evolved from material used by QNX Software Systems
(QSS) for a training module covering tools and techniques for building
embedded software systems in safety-critical devices deployed in cars,
medical devices, railway systems, industrial automation systems, etc.
The material in this book has emerged from my professional work
and, of course, I have not worked alone. I am grateful to QSS man-
agement, and in particular my direct managers, Jeff Baker and Adam
Mallory, for allowing me the space to develop many of my ideas, and
for allowing me to use the training material as a foundation for this
book.
There are many people whom I need to thank for providing me with
ideas and challenges. These particularly include (alphabetically) Dave
Banham, John Bell, John Hudepohl, Patrick Lee, Martin Lloyd, Ernst
Munter, Rob Paterson, Will Snipes and Yi Zheng — a stimulating
group of people with whom I have worked over the years.
Even with the ideas, creating a book is not a trivial task, and I
would like to thank my wife, Alison, who has read every word with a
pencil in her hand. I cannot count how many pencils she has worn out
getting this book into a shape that she finds acceptable. I thank her.
I also thank Chuck Clark, Adam Mallory and the anonymous readers
provided by the publisher for their extremely thorough and detailed
proofreading.
The cover picture was provided by Chuck Clark. Many thanks for
the permission to use this photograph.
10 Embedded Software Development for Safety-Critical Systems
Today’s Challenges
Although the last two decades have seen a tremendous growth in tools
and techniques that we can apply to the development of safe, embedded
systems, challenges still remain and new ones are emerging.
Security
In the past, many embedded systems were physically secure, being
locked in the driver’s cab of a train or behind a locked fence on a
shop floor. Today almost every electronic device supports external
communications through Wi-Fi, Bluetooth, USB drives, or from GPS
satellites, and these channels are all security vulnerabilities.
Safety is interlinked with security — the behavior of an insecure
device is effectively unpredictable once a hacker has found a vulnera-
bility. Safety and security are normally antagonistic (increase one at
the cost of the other) and this security/safety balance is described on
page 101. There are moves to combine safety and security cases; see
page 72. However, no general methodology exists yet for combining
security and safety issues.
We started very early the next morning, but our guide got
confused, and did not know the way to Gungi. Some men in a canoe,
however, directed us, and we had to go up-stream again beyond
Agata, and get into another arm which we had passed on the left.
We then, though not without some difficulty, succeeded in reaching
the village, passing several artificial dykes, beyond which stretched
rice-fields now inundated. Gunga, a wretched little place, is peopled
by slaves taken in war by the sheriffs of Agata. Mohamed’s rice was
handed over to us, but it was all still in the husk, and it would take us
the whole of the next day to get it shelled.
During the night a Kel es Suk arrived, who, in a very important
manner, informed me that he had very serious news to
communicate. The whole of the tribes of the Sahara, he said, had
combined against the French, and were advancing upon Timbuktu.
Awellimiden, Hoggars and all the rest of them were up, and Madidu
himself was at Bamba at the head of his column. This was really too
big an invention, and the narrator overreached himself by going so
far. Without losing my sang-froid for a moment, I thanked my
informant, Father Hacquart acting as interpreter, for my visitor spoke
Arabic well, and begged him to take my best compliments to Madidu.
The old rogue then turned to the subject he really had most at heart,
and tried to make me give him a garment of some kind as a present,
but I was too deep for that, and sent him off empty-handed.
OUR PEOPLE SHELLING OUR RICE AT GUNGI.
I observed that I had already given him stuff enough to clothe his
whole family.
“But my bubu and breeches are dirty now!” he replied. “Well, go
and wash them, you wretch!” was the angry rejoinder. “What!” he
cried, “would you like a soldier under such a chief as you to demean
himself by such work as that?”
Sheriff Hameit, to whom I had sent Abiddin’s letter the evening
before, answered us very impolitely, declaring that his religion
forbade him to have anything to do with infidels.
I consoled myself for this fresh failure by having a chat with the
little Kunta Tahar, Mohamed’s companion, who had come on to
Gungi to see that the rice was duly handed over to us.
He told me of the death in 1890 near Saredina of Abiddin, the son
of Hamet Beckay, of whom he had been a faithful retainer when at
Gardio near Lake Debo.
This Abiddin and his followers had come to make a pilgrimage to
the tomb of the great marabout, and also to try to win recruits against
the Toucouleurs of Massina, with whom Abiddin carried on the
struggle begun by his father. Two columns had marched forth
against them, one from Mopti, the other from Jenné, and surrounded
them. Abiddin was wounded and taken prisoner, but his faithful
Bambaras of Jenné, who had always followed his fortunes, rescued
him from the hands of the enemy. But, alas! no less than three
bullets hit the doomed man after this first escape, killing him on the
spot, and a great storm then arose which put an end to the battle,
only a few of those engaged in it escaping to tell the tale.
The wind, which was very violent and dry, whirled up such
quantities of sand that the corpse of Abiddin was buried beneath it,
and no one was ever able to discover the place where he lay, as if
Nature herself wished to protect his body from desecration and
insult.
WEAVERS AT GUNGI.
Tornadoes play a great part in the histories of Kunta wars. Hamet
Beckay is supposed to have had the power of calling them up when
he liked, and to have by their means several times overwhelmed
armies sent to attack him, but that of Saredina came too late to save
his son.
Can it have been the story told to me by my friend the Kunta
which caused a tremendous tornado to sweep down upon us that
very evening, with thunder and lightning and torrents of rain all
complete, soaking everything and everybody on board?
Our rice shelled, put into bags, and stowed away in the hold, we
went on and anchored the next morning opposite Baruba to
breakfast there. The ancient town, the Kaaba of the Tuaregs, which
was still standing in the time of Barth, has since been destroyed, but
its site is marked by piles of rubbish such as are still characteristic of
the environs of Timbuktu, and from their vast extent prove that it was
a city of considerable importance.
The country round about is extremely picturesque. The
descendants of those who dwelt in the old city have moved a little
further down stream to a dune which is so completely surrounded
with water during inundations as to form an island. They bury their
dead beneath the shade of the thorny bush beyond their settlement.
At Baruba we saw some date trees which had reverted to the wild
state, and were very majestic looking. We visited the site of the old
town, and then anchored opposite its successor. Now that the waters
of the Niger were beginning to subside, and the island was becoming
a peninsula only, the inhabitants were losing their sense of security,
and talking of migrating to an islet in the river itself opposite their
present home. A few huts had already been put up on it, making
white spots amongst the dense green verdure.
There we received envoys from the chief named Abder Rhaman,
who brought us a letter in which we were informed that the reason
the writer did not come to see us was, that he was afraid we should
not understand each other, and bad results might ensue.
Then came a band of Kel-Owi, serfs of the Igwadaren, bringing
ten, twenty, or thirty sheep, which they informed us they meant to
give us. The number of animals seemed increasing at every
moment, and I at once feared there was some sinister intention
behind this unusual generosity. But no, I was wrong. They were
really good fellows these Kel-Owi, though the merit of their
munificence rather melts away when you examine closely into
motives. It was present for present, as of course they knew I should
not take their beasts without giving them something in exchange. I
had the greatest difficulty in making our visitors understand that our
boats were not sheep-pens, and that all I could do was to choose out
the five finest animals.