FORMAL METHODS: BENEFITS, CHALLENGES and FUTURE DIRECTION Mona Batra1, Amit Malik2, Dr
Total Page:16
File Type:pdf, Size:1020Kb
Volume 4, No. 5, May 2013 Journal of Global Research in Computer Science REVIEW ARTICLE Available Online at www.jgrcs.info FORMAL METHODS: BENEFITS, CHALLENGES AND FUTURE DIRECTION Mona Batra1, Amit Malik2, Dr. Meenu Dave3 1 M. Tech. Scholar Department of Computer Science, Jagan Nath University, Jaipur, India [email protected] 2Sr. Analyst, HCL Technologies Ltd. , Noida-201304, India [email protected] 3Assistant Professor Department of Computer Science, Jagan Nath University, Jaipur, India [email protected] Abstract: There is an increasing demand of current information systems to incorporate the use of a higher degree of formalism in the development process. Formal Methods consist of a set of tools and techniques based on mathematical model and formal logic that are used to specify and verify requirements and designs for hardware and software systems. This paper presents a detailed analysis of formal methods along with their goals and benefits followed by limitations. This research work is aimed to help the software engineers to identify the use of formal methods at different stages of software development, with special reference to the requirements phase. Keywords- Formal Methods, Requirements Engineering, Formal Specification, Feasibility Analysis etc. of mathematics in design and construction to ensure product INTRODUCTION quality is common practice in established engineering disciplines, such as bridge or aircraft building, and even In today’s commercial environment, the primary measure of computer (hardware) construction, where one applies success of software projects is the extent to which a mathematically expressed physical and other natural laws to software system fulfills the purpose, which it is intended for. model a problem that deals with the behavior of concrete However, an increasingly competitive market usually systems in the physical world. demands higher quality, shorter turnaround cycles, and cheaper software. Many IT companies face the difficulty of This paper describes various aspects of formal methods in releasing products of quality on time and within the limits of requirements engineering. Formal specification language, approved budget. The number of errors found during different formal specification styles and types of formal development strongly affects the software metrics methods are described in Section 2. In Section 3, goals of mentioned above. If the problem is identified earlier during formal methods are explained whereas in Section 4 benefits program development, then it helps in reducing the project of formal methods are discussed in detail. In Section 5, budget [1]. limitations are presented, and the issues in Section 6. ‘Conclusion and Future Work’ is reported in Section 7. When an error that was introduced in the requirements phase is found during testing, software engineers must fix the TYPES OF FORMAL METHODS incorrect requirements, check all of the ramifications through design and implementation and finally retest the Formal methods are mathematics based languages, product. In order to build a secure software product and techniques and tools that can be applied to any part of the overcome the problem of overrun of budget (which occurs program life-cycle. By providing the feature of abstraction due to errors in requirement specifications), cost-effective and unambiguous description mechanisms, formal methods methods are required that address the major risks and that facilitate the development of the critical systems. The provide tangible evidence of trustworthiness. representation used in formal methods is called a formal specification language. The formal specification languages Formal methods are the solution to the above stated are based on set theory and first order predicate calculus. problems. Formal methods are a particular kind of The language has a formal semantics that can be used to mathematical techniques meant for the specification, express specifications in a clear and unequivocal manner. development and verification of software and hardware Formal methods can be classified using two ways. Firstly, systems. The representation used in formal methods is called according to formal specification styles, and secondly, a formal specification language. [2]. according to software development life-cycle perspective [4]. Formal methods consist of writing formal descriptions, analyzing those descriptions and in some cases producing TYPES OF FORMAL SPECIFICATION STYLES new descriptions. They can be applied in different phases of development process. They are even becoming integral The Formal Specification Styles are specified as follows: components of standards. According to Rushby [3], the use © JGRCS 2010, All Rights Reserved 21 Mona Batra et al, Journal of Global Research in Computer Science, 4 (5), May 2013, 21-25 Model Based Languages: b. Theorem proving is another approach for verification of Model based languages are a way to write a specification. a specification or checking the correctness of a To specify the behavior of the system, model based program. A model of the system is described in a languages construct a mathematical model of the system. mathematical language and desired properties of the The model consists of an underlying state (data) and a model can be proven by a theorem prover. It is collection of operations on that state [5]. The state model is mechanization of a logical proof. The specification to constructed with the help of mathematical entities such as be checked by a theorem prover is written in a relations, sets, sequences and functions. Operations of a mathematical notation. Z (pronounced ‘Zed’) is its well- system are specified by defining how they affect the state of known example. the system model. Operations are also described by the predicates given in terms of pre and post conditions. The GOALS OF FORMAL METHODS most widely used notations for developing model based Formal methods can be applied at different stages of languages are Vienna Development Method (VDM), Zed software development life cycle. On the basis of the details (Z) and B. of the formal methods, some goals may be listed as follows: Algebraic Specification a. Formal methods support in the creation of specifications Algebraic specification is a technique, used to specify the that describe the true requirements of the user, which are system behavior by using methods derived from abstract not usually identical to the stated requirements. This can algebra. Algebraic approach was originally designed for the be achieved using formal methods because of the definition of abstract data types and interface. The most unambiguity of the formal specifications and the widely used notations for developing algebraic specification possibility to prove certain properties about it. languages are LARCH, ASL and OBJ. b. Formal methods ensure that the implementation of a particular software as well as hardware product should Process Oriented: satisfy the requirements specification. Process oriented formal specification language is basically c. Formal methods are basically concerned for development used to describe concurrent system by building a specific and maintenance of security critical reliable systems on implicit model. In these languages processes are denoted by time and within budget. It increases trustworthiness of expressions and are built up with the help of elementary the system in the sense that the system developed is not expressions. Elementary expressions describe simple just correct but known to be correct. Formal methods act processes along with the operations, which combine as evidence which ensures that the system indeed processes to yield more complex processes. The most satisfies the demand of security, reliability and widely used process oriented language is Communicating correctness. Sequential Processes (CSP). BENEFITS OF FORMAL METHODS FORMAL LANGUAGES IN SDLC The early activities in the software development lifecycle In SDLC, formal languages are used in two phases: i.e. requirements analysis and specification, is the most requirements and testing. important. According to one of the Standish Chaos report [9], half of all project failures occur due to poor Specification (Requirements Analysis Phase): requirements specification. The most effective use of formal Specification is the process of describing a system behavior methods is at these early stages. It is effectual to write a and its desired properties. Formal specification languages specification formally rather than writing an informal describe system properties that might include functional specification and then translating it. To detect inconsistency behavior, timing behavior, performance characteristics and and incompleteness, it is efficient to analyze the formal internal structure, etc. [6]. specification as early as possible [10]. Along with the benefits discussed above, there are various other benefits Z, VDM and Larch are used for specifying the behavior of which are discussed as below: sequential systems while other formal methods such as CSP, a. Measure of correctness: The use of formal methods CCS, State charts, Temporal Logic, Lamport and I/O provides a measure of the correctness of a system, as automata, focus on specifying the behavior of concurrent opposed to the current process quality measures. systems [7]. RAISE is used for handling rich state spaces b. Early defect detection: Formal Methods can be applied and LOTOS is one of the languages for handling complexity to the earliest