User loginNavigation |
Rules for Developing Safety-Critical CodeIn the June 2006 Issue of IEEE Computer (Volume 39, Number 6) Gerald J. Holzmann of the NASA/JPL Laboratory for Reliable Software authored "The Power of 10: Rules for Developing Safety-Critical Code" on pages 95-97. I don't have an online link to the article text, but it can be summarized as: Rule 1: Simplify Control Flow Banishing Recursion. Rule 2: Set a fixed upper bound on all loops, excluding non-terminating event loops. Rule 3: Banish Dynamic Memory Allocation and Garbage Collection. Rule 4: Restrict each function's size to around 60 lines of source code. Rule 5: Make liberal use of assertions to test any condition that can't be statically guaranteed. Rule 6: Use static scoping to hide "data objects" to the greatest extent possible. Rule 7: Check all return values and caller supplied parameters. Rule 8: Banish any significant macro use (like "token pasting", "variable argument lists", and "recursive macro calls") beyond header file inclusions and simple defintiions. Rule 9: Banish handles, macro-driven pointer manipulation, and function pointers while restricting pointer use to one level of dereferencing. Rule 10: Continuously recompile all code with all compiler warnings turned on and ship no code until all warnings are eliminated and it passes strongly typed static analysis. One gets the sense that these strictures are informed by life in the C/C++ discourse community, but they do raise deeper questions of whether the dynamic world and functional programming in general can support Safety-Critical Code. Could literate programming techniques be leveraged to further improve the reliability of such code? Could we in effect replace these 10 rules with: Rule 1: Code in Scheme, Haskell, or F#. Rule 2: Embrace Literate Programming. By Peter J. Wasilko at 2006-06-21 13:16 | LtU Forum | previous forum topic | next forum topic | other blogs | 16575 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 2 days ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago