-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
350 lines (307 loc) · 9.41 KB
/
index.php
File metadata and controls
350 lines (307 loc) · 9.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Software Engineering Disaster Hall of Fame</title>
<meta name="author" content="Ryan Flynn" />
<meta name="description" content="" />
<meta name="keywords" content="bug, software, programming, disaster, famous, fame, hall, shame" />
<link rel="stylesheet" href="/css/style.css" type="text/css" media="screen, projection" />
<link rel="shortcut icon" href="bug.ico">
<style>
body {
font: Arial, Helvetica, sans-serif;
}
th { background-color: #eee }
th, td {
border: 1px solid #ccc;
padding: 0.25em;
}
th { border-color: #fff }
td ul {
list-style: none;
margin-top: 0;
margin-bottom: 0;
font-size: smaller;
padding-left: 1em;
text-indent: -1em;
}
td ul li:before {
content: "\00BB \0020";
}
</style>
</head>
<body>
<<<<<<< HEAD
=======
<h1>
<img border="0" width="32" height="32" style="vertical-align:text-bottom" alt="" title="" src="data:image/gif;base64,R0lGODlhEAAQAMIEAAACADk6V0WWj7PT8P///////////////yH5BAEKAAQALAAAAAAQABAAAANESEqx/gu4BuOEAejcZFXAMAAc401DIIiCFzQZuIqDQDkASdNtFfCs2AQwS9UkL4uKFrotOirBivS4cUiqD+GkfXYv2gQAOw==">
Software Engineering Disaster Hall of Fame</h1>
<h3>Compiled by Ryan Flynn</h3>
>>>>>>> ca5a7adc745a3664c4f88417b973b115ecf36d2c
<?php
error_reporting(-1);
@include_once('../util.inc');
?>
<h1>Software Engineering Disaster Hall of Fame</h1>
<h3>Compiled by Ryan Flynn</h3>
<?php
$cases =
array_filter(
scandir('./case/'),
function ($f)
{
return preg_match('/\.json$/', $f);
});
$Bugs = array();
foreach ($cases as $case)
{
$path = "case/$case";
$json = file_get_contents($path);
$data = json_decode($json, true);
if (!$data)
echo json_last_error();
$Bugs[basename($case, '.json')] = $data;
}
function eschtml($str)
{
return htmlspecialchars($str);
}
function tohtml($v)
{
if (is_array($v))
{
if (count($v) == 1)
{
$k = array_keys($v);
return $k[0];
}
$s = '<ul>';
foreach (array_keys($v) as $k)
$s .= '<li>' . eschtml($k);
$s .= '</ul>';
return $s;
} else {
return $v;
}
}
function cost($c)
{
$cost = array();
if ($c['deaths'])
{
$cost[] = sprintf('%u death%s',
$c['deaths'],
$c['deaths'] == 1 ? '' : 's');
}
if (@$c['injuries'])
{
$cost[] = sprintf('%u injured', $c['injuries']);
}
if (@$c['lives-at-risk'])
{
$cost[] = sprintf('%s lives at risk', number_format($c['lives-at-risk']));
}
# because of the number of years and different currencies, convert all
# non-dollar amounts to dollars inside the case studies based on
# exchange rate atht the time of the incident
if (@$c['dollars'])
{
$d = dollars($c);
$cost[] = sprintf('$%s', number_format($d));
} else if (@$c['£']) {
$cost[] = sprintf('£%s', number_format($c['£']));
} else if (@$c['€']) {
$cost[] = sprintf('€%s', number_format($c['€']));
} else if (@$c['AUD']) {
$cost[] = sprintf('AUD%s', number_format($c['AUD']));
}
if (@$c['jobs'])
{
$cost[] = sprintf('%s jobs', number_format($c['jobs']));
}
if (@$c['recalls'])
{
$cost[] = sprintf('%s recalls', number_format($c['recalls']));
}
if (@$c['remote-vulnerabilities'])
{
$cost[] = sprintf('%s vulnerabilities', number_format($c['remote-vulnerabilities']));
}
if (@$c['delay-years'])
{
$cost[] = sprintf('%u year delay', $c['delay-years']);
}
if (@$c['dollars-at-risk'])
{
$cost[] = sprintf('$%s at risk', number_format($c['dollars-at-risk']));
}
if (@$c['delay-days'])
{
$cost[] = sprintf("%u day delay", $c['delay-days']);
}
if (!$cost)
{
$cost[] = 'unspecified';
}
return $cost;
}
/*
* return inflation-adjusted dollar amount based on original cost and age
* $when can be in the forms: "Jan 1, 2000", "Jan, 2000", "2000", "2000-2001", "2000-present"
*/
function inflation($dollars, $when)
{
$Now = intval(date('Y'));
$yr = intval(date('Y'), strtotime(intval($when) ? intval($when) : $when));
if ($yr == 0)
$yr = $Now;
$ageyears = $Now - $yr;
$factor = pow(1.02, $ageyears);
return $dollars * $factor;
}
function dollars($a)
{
$dollars = @$a['dollars'];
if (is_array($dollars))
$dollars = array_sum(array_values($dollars));
return $dollars;
}
uasort($Bugs,
function ($a, $b)
{
$ac = $a['cost'];
$bc = $b['cost'];
$cmp = @$ac['fiction'] - @$bc['fiction'];
if ($cmp)
return $cmp;
$cmp = @$bc['near-thermonuclear-war'] - @$ac['near-thermonuclear-war'];
if ($cmp)
return $cmp;
$cmp = @$bc['deaths'] - @$ac['deaths'];
if ($cmp)
return $cmp;
$cmp = @$bc['injuries'] - @$ac['injuries'];
if ($cmp)
return $cmp;
$cmp = @$bc['lives-at-risk'] - @$ac['lives-at-risk'];
if ($cmp)
return $cmp;
$acost = inflation(dollars($ac), $a['when']);
$bcost = inflation(dollars($bc), $b['when']);
if ($acost != $bcost)
return $acost > $bcost ? -1 : 1;
$cmp = @$bc['jobs'] - @$ac['jobs'];
if ($cmp)
return $cmp;
$cmp = @$bc['recalls'] - @$ac['recalls'];
if ($cmp)
return $cmp;
$cmp = @$bc['delay-years'] - @$ac['delay-years'];
if ($cmp)
return $cmp;
$cmp = @$bc['dollars-at-risk'] - @$ac['dollars-at-risk'];
if ($cmp)
return $cmp;
$cmp = @$bc['delay-days'] - @$ac['delay-days'];
if ($cmp)
return $cmp;
$cmp = @$bc['remote-vulnerabilities'] - @$ac['remote-vulnerabilities'];
if ($cmp)
return $cmp;
$cmp = count($b['result']) - count($a['result']);
if ($cmp)
return $cmp;
$cmp = strtotime($b['when']) - strtotime($a['when']);
return $cmp;
});
?>
<table style="border-collapse:collapse; border:1px solid #ccc">
<?php
$Year = intval(date('Y'));
$bugcnt = count($Bugs);
$i = 0;
foreach (array_keys($Bugs) as $key)
{
$bug = $Bugs[$key];
if (@$bug['omit'] === true)
{
continue;
}
$cost = $bug['cost'];
$ageyears = $Year - intval($bug['when']);
$inflation = pow(1.02, $ageyears);
if ($i % 10 == 0 && $i < $bugcnt) {
?>
<tr>
<th>#
<th>Name
<th>When
<th>Cost
<th>Impact
<th>Cause(s)
<th>Industry
<th>Mitigating Factors
<?php } ?>
<tr>
<td width="1" align="right"><?= ++$i ?>
<td><a href="<?= eschtml($bug['refs'][0]['url']) ?>"><?= eschtml($bug['title']) ?></a>
<td><?= eschtml($bug['when']) ?>
<td align="right"><?= join("<br>\n", cost($cost)) ?>
<td><?= tohtml($bug['result']) ?>
<td><?= tohtml($bug['causes']) ?>
<td><?= eschtml($bug['industry']) ?>
<td><?= tohtml(@$bug['mitigating']) ?>
<?php
}
?>
</table>
<h2>Notable Omissions</h2>
<h4>Oft-cited incidents that didn't make the cut</h4>
<dl>
<dt><a href="http://en.wikipedia.org/wiki/Siberian_pipeline_sabotage">Soviet Trans-Siberian Gas Pipeline Sabotage by CIA Via Software</a></dt>
<dd>
Though software was involved and the results are disastrous the software worked as intended (by the CIA).
There are few lessons to be learned here other than "test your software" and "don't fuck with the CIA".
</dd>
<dt><a href="http://en.wikipedia.org/wiki/Black_Monday_(1987)">'Black Monday' 1987 Wall Street Crash</a></dt>
<dd>
Though <a href="http://en.wikipedia.org/wiki/Black_Monday_(1987)#Causes">trading software has been a scapegoat for the 1987 Wall Street Crash in the U.S.</a>,
the international chain of events suggests there was more going on.
</dd>
<dt><a href="http://en.wikipedia.org/wiki/Stuxnet">Sabotage of Iranian Nuclear Program by Stuxnet Worm</a></dt>
<dd>
This is industrial sabotage and computer warfare, note-worthy in itself, but not an egregious engineering failure by itself — the attack was highly
targeted and sophisticated.
</dd>
<dt><a href="http://www.eng.uab.edu/cee/faculty/ndelatte/case_studies_project/Hartford%20Civic%20Center/hartford.htm">Hartford Civic Center Arena Roof Collapse</a></dt>
<dd>
Though a CAD program gave improper results and thus lent a false sense of security to a flawed design,
this is foremost an engineering and construction failure.
</dd>
<dt><a href=""></a></dt>
<dd>
</dd>
<dt><a href=""></a></dt>
<dd>
</dd>
</dl>
<h2>References</h2>
<ol>
<li><a href="http://catless.ncl.ac.uk/Risks/">THE RISKS DIGEST</a> Peter G. Neumann
<li><a href="http://www5.in.tum.de/~huckle/bugse.html">Collection of Software Bugs</a> Prof. Thomas Huckle
<li><a href="http://en.wikipedia.org/wiki/List_of_software_bugs">List of software bugs</a> Wikipedia
<li><a href="http://www.cs.tau.ac.il/~nachumd/verify/horror.html">Software Horror Stories</a> Nachum Dershowitz
<li><a href="http://sunnyday.mit.edu/accidents/space2001.pdf">Systemic Factors in Software-Related Accidents</a> Nancy G. Leveson
<li><a href="http://www.rvs.uni-bielefeld.de/publications/compendium/index.html">Computer-Related Incidents with Commercial Aircraft</a> Peter B. Ladkin, Hiroshi Sogame, Jan Hennig
<li><a href="http://www.wired.com/software/coolapps/news/2005/11/69355?currentPage=all">History's Worst Software Bugs</a> Simson Garfinkel, 2005
<li><a href="http://www.faqs.org/faqs/space/probe/">Space FAQ - Planetary Probe History</a> Jon Leech
<li><a href="http://en.wikipedia.org/wiki/Software_bug">Software Bug</a> Wikipedia
<li><a href="http://nvd.nist.gov/home.cfm">National Vulnerability Database</a>
</ol>
<div style="padding:1em; padding-top:2em; text-align:center">
<hr>
Copyright 2011 Ryan Flynn <parseerror@gmail.com>
</div>
</body>
</html>