Ten Commandments Revisited a Ten-Year Perspective on the Industrial Application of Formal Methods
Total Page:16
File Type:pdf, Size:1020Kb
Ten Commandments Revisited A Ten-Year Perspective on the Industrial Application of Formal Methods Jonathan P. Bowen Michael G. Hinchey London South Bank University NASA Software Engineering Laboratory Institute for Computing Research, Faculty of BClM Goddard Space Flight Center Borough Road, London SEI OAA, UK Greenbelt, MD, USA www.jpbowen.com sel.gsfc.nasa.gov [email protected] [email protected] ABSTRACT We, as the formal methods community, are (presumably) Ten years ago, our 1995 paper Ten Commandments of Formal convinced of the validity of formal approaches to software Methods [5] suggested some guidelines to help ensure the success of specification, design, implementation, and subsequent maintenance. a formal methods project. It proposed ten important requirements In fact, it seems a logical argument to “Formal Methodists”, for (or “commandments”) for formal developers to consider and follow, whom formal methods are a “religion,” that the introduction of based on our knowledge of several industrial application success greater rigor into software development will result in improvements stories, most of which have been reported in more detail in two both in the software itself and in the development process. books [17],[18]. The paper was surprisingly popular, is still widely Unfortunately, the rest of the world (and the software referenced, and used as required reading in a number of formal engineering community, in particular) has not been convinced on a methods courses. However, not all have agreed with some of our wide scale, despite a significant number of success stories [17],[ IS]. commandments, feeling that they may not be valid in the long-term. At least their existence is now acknowledged by most [8], and their We re-examine the original commandments ten years on, and usehlness is accepted by some [41]. Certain aspects of formal consider their validity in the light of a fiuther decade of industrial methods, such as assertions in programs [20], are widely used, best practice and experiences. although not as much as originally anticipated. However, many myths regarding formal methods, first identified as far back as 15 Categories and Subject Descriptors years ago [6],[ 161 still abound. D.3.3 [Sofhvarek’rogram Verification]: Formal methods. Holloway [22] points out that the typical argument in favor of formal methods (that software is bad, unique, and discontinuous; General Terms that testing is inadequate; and that formal methods are essential to Design, Economics, Experimentation, Human Factors, avoid design flaws) is logically flawed, and unnecessarily complex Standardization, Languages, Theory, Verification. (in logical terms). He proposes a simpler argument, which is both simple and logically valid: software engineers want to be “real” engineers; such engineers apply mathematics; and since formal Keywords methods is the mathematics of software engineering, software Formal methods, correctness, industrial application, software engineers should use formal methods. engineering. Nevertheless, formal methods are still not widely used outside the specialized formal methods community. Our original Ten 1. INTRODUCTION Commandments of Formal Methods [5] were aimed at encouraging the practical use of formal methods among the software engineering It is clear to the best minds in the field that a more community as a whole, and, more importantly, to provide some ma~heniaticalapproach is needed for sofiare to advance practical guidance to formal methods practitioners based on insights much. received fiom a number of real-life projects, many of which were - Bertrand Meyer reported in [17],[18]. The hture of foimal methods was also considered by others at around the same time [lo]. Given the lack of acceptance of the use of formal methods outside our own specialized group of people, the former was at best a vely limited success (or perhaps even a failure!). But we were considerably more successful in achieving the latter goal. Copyright 2005 Association for Computing Machinery. ACM acknowledges that this contribution was authored or co-authored by a Over the intervening ten years, we have received many contractor or affiliate of the U.S. Government. As such, the Government comments and much feedback on our “commandments”. They have retains a nonexclusive, royalty-free right to publish or reproduce this been widely cited, and included in several textbooks (e.g., see [36]) article, or to allow others to do so, for Government purposes only. and are recommended (or even required) reading for a number of FMCS’O5,September 54,2005,Lisbon, Portugal. academic courses. Naturally, not everyone agrees with all of them. Copyright 2005 ACM 1 -59593-148-1/05/0009...$5.00. They did not do so when we first published them in 1995, pointing However, the original intent of our commandment (“thou shalt out that many of them would not necessarily hold in the long term, choose an appropriate notation”) concerned a notation that was not so it is not surprising that not everyone agrees with them now. “appropriate” in the sense that it was easily understood by non- this paper, we the T~~ Commandmentsof Formal specialists, but “appropriate” in that it was useful in describing the Methods in the light of a further ten years of industrial best practice. at hand in a manner *at fits with that system. While several of the more ..popular notations (ex...- B. Z. CCS. CSP) have emerged and have widespread applicability to a broad range of Any intelligeni fool can make ihings bigger and more classes of system, it has been found in many cases that a complex ... It takes a touch of genius and a lot of courage io combination of languages is needed to adequately address all move in the opposite direction. aspects of a larger system. It has been argued that no single notation - Albert Einstein (1879-1955) will ever be suitable to address all aspects of a complex system, with the implication that future systems will require combinations of model-based methods, process algebras, and temporal (and other) logics, in particular as we build more sophisticated, advanced, and 2. REVISITING THE COMMANDMENTS ambitious systems. Table 1 illustrates just some of the wide range of “hybrid” formal He proclaimed to you his covenant, which he commanded methods that have emerged over the last decade, indicating a need to you to keep: the Ten Commandments, which he wrote on augment existing notations with concepts that address specific two tablets of sione. aspects of a system. These vary in the means by which they are - Deut.4:13, 10:4, Ex.34:28 combined, which we categorize as:’ Viewpoints (loosely coupled): different notations are used to present different “views” of a system with each notation I. Thou shalt choose an appropriate making emphasis of, or understand of, a particular aspect of notation. the system (e.g., representing timing constraints) [9]. Method Integration (close coupling): several different Notations are a 3equent complaint ... but ihe real problem notations (both formal and informal or semi-formal) are is to understand the meaning andproperties of the symbols used with (manual or automatic) translation between and how they may and may not be manipulated, and to gain notations being used both to provide a semantics for the less fluency in using ihem io express new problems, solutions formal notations and to enable graphical (or other) and prooji. Final&* you will cultivate an appreciation of presentations that are well-understood, while simultaneously mathematical elegance and style. By that time, the symbols affording the benefits of formal verification [40]. will be invisible; you will see straight through them to what Integrated Methods (tight couplingJ: multiple notations are they mean. The great advantage of mathematics is that the used along with a single notation (e.g., propositional logic) rules are simpler than those of natural language, and the used to give a uniform semantics to each notation [46]. vocabulary is much smaller. Consequent&, when presented with someihing unfamiliar it is possible to work out a At the time we published [5], method integration was very solution for yourself; by logical deduction and invention popular and it seemed that there would be a greater move towards rather than by consulting boob or experts. Integrated Methods. While certainly there has been more progress in these fields, it seems that a Viewpoints approach has been winning - C.A.R. Hoare out, perhaps due to reluctance by industry to take up full formal proof (that the more coupled approaches would support) and The use of mathematical notation is often cited as a reason for reluctance to get involved in semantic details. The Integrated the slow uptake of formal methods and an inhibitor to their Formal Methoak conference [2] continues to provide a forum for successful use in industrial applications. However, as we pointed out this research topic. in [6], the mathematics of formal methods are actually relatively Choosing thc right notation can great aid in abstraction, in simple, and exploits notations and concepts that should be well- hiding unnecessar); detail and unnecrssar?; complexity, where is understood by computing professionals (set theory, propositional where (many argue) the leal benefit offonnal melhods ci most be and predicate logic, etc.). While we concede that non-professionals felt. may not be so au fait with such notations - which makes communication more difficult, in particular with system procurers, ul could say it in usords there would he no reason iopaort who in many cases are the people with whom the formal specifier -Edward Hopper (1882-1967) most needs to communicate - in general, the notations are not beyond the understanding of well-educated software engineers. The formal methods community must also take some of the blame for this: all too often we find authors of technical papers introducing new symbols, Greek hieroglyphics, which are just alternative ways of representing existing operators and concepts.