A Novel Approach for Software Property Validation

Similar documents
System Correctness. EEC 421/521: Software Engineering. System Correctness. The Problem at Hand. A system is correct when it meets its requirements

Java-MOP: A Monitoring Oriented Programming Environment for Java

Tutorial on Model Checking Modelling and Verification in Computer Science

Specification Centered Testing

Automated Analysis of Natural Language Properties for UML Models

Formal Methods in Software Engineering. Lecture 07

Monitoring Interfaces for Faults

Introduction to Linear-Time Temporal Logic. CSE 814 Introduction to LTL

Model-checking with the TimeLine formalism

Linear-Time Model Checking: Automata Theory in Practice

Proving the Correctness of Distributed Algorithms using TLA

Temporal Logic Motion Planning for Mobile Robots

WHEN concurrent processes share a resource such as a file

Scenario Graphs Applied to Security (Summary Paper)

COMP 763. Eugene Syriani. Ph.D. Student in the Modelling, Simulation and Design Lab School of Computer Science. McGill University

Generating MC/DC Adequate Test Sequences Through Model Checking

Model-Based Testing and Monitoring for Hybrid Embedded Systems

Simulink Design Verifier vs. SPIN a Comparative Case Study

Runtime Assurance Based On Formal Specifications

Formal Tropos: language and semantics

Formal Analysis and Verification of a Communication Protocol

Modeling and Verification of Marine Equipment Systems Using a Model Checker

MaC Monitoring and Checking at Runtime. Presented By Usa Sammapun CIS 700 Oct 10, 2005

Research Collection. Formal background and algorithms. Other Conference Item. ETH Library. Author(s): Biere, Armin. Publication Date: 2001

Finite State Verification. CSCE Lecture 14-02/25/2016

Distributed Systems Programming (F21DS1) Formal Verification

A Frame Study for Post-Processing Analysis on System Behavior: A Case Study of Deadline Miss Detection

A Case Study for CTL Model Update

Model Checking: Back and Forth Between Hardware and Software

Automatic verification of deontic interpreted systems by model checking via OBDD s

A Verification Method for Software Safety Requirement by Combining Model Checking and FTA Congcong Chen1,a, Fuping Zeng1,b, Minyan Lu1,c

The Maude LTL Model Checker and Its Implementation

Finite State Verification. CSCE Lecture 21-03/28/2017

Model checking Timber program. Paweł Pietrzak

RECENT advances in the development of portable devices

Theory and Algorithms for the Generation and Validation of Speculative Loop Optimizations

Software Model Checking: Theory and Practice

Verification of Concurrent Programs, Part I: The Temporal Framework

Modeling Interactions of Web Software

Specifying circuit properties in PSL. (Some of this material is due to Cindy Eisner and Dana Fisman, with thanks) See also the Jasper PSL Quick Ref.

A Tutorial on Runtime Verification and Assurance. Ankush Desai EECS 219C

Course 8 3 December Adrian Iftene

Lecture 2: Symbolic Model Checking With SAT

AS concurrent users access and update databases in terms

Course 8 27 November Adrian Iftene

Hardware Design Verification: Simulation and Formal Method-Based Approaches William K Lam Prentice Hall Modern Semiconductor Design Series

Model Checking. Dragana Cvijanovic

Formal Verification of Control Software: A Case Study

Formal Verification of Safety I&C System Designs: Two Nuclear Power Plant Related Applications. Abstract

Specifying circuit properties in PSL

Using formal methods for quality assurance of interlocking systems L.-H. Eriksson* & K. Johansson^

Runtime Validation Using Interval Temporal Logic

Leveraging DTrace for runtime verification

Promela and SPIN. Mads Dam Dept. Microelectronics and Information Technology Royal Institute of Technology, KTH. Promela and SPIN

Using Model-Checkers for Mutation-Based Test-Case Generation, Coverage Analysis and Specification Analysis

Lecture1: Symbolic Model Checking with BDDs. Edmund M. Clarke, Jr. Computer Science Department Carnegie Mellon University Pittsburgh, PA 15213

Distributed Systems Programming (F21DS1) SPIN: Formal Analysis II

Test-Case Generation and Coverage Analysis for Nondeterministic Systems Using Model-Checkers

Proof Pearl: The Termination Analysis of Terminator

Regression Verification - a practical way to verify programs

Specification and Analysis of Real-Time Systems Using Real-Time Maude

Cover Page. The handle holds various files of this Leiden University dissertation

A Monitoring and Checking Framework for Run-time Correctness Assurance

containing such cycles will not satisfy the eventuality property, thus, we will be unable to derive its correctness for the concrete model. A common w

Model-Checking Concurrent Systems. The Model Checker Spin. The Model Checker Spin. Wolfgang Schreiner

The Fox Project: Advanced Development of Systems Software

From UML Activity Diagrams to Specification Requirements 1

Model Checking with Automata An Overview

Cyber Physical System Verification with SAL

Model Checking DSL-Generated C Source Code

Lecture 11 Lecture 11 Nov 5, 2014

Thesis Defense: Developing Real-Time Collaborative Editing Using Formal Methods

An Instrumentation Technique for Online Analysis of Multithreaded Programs

Tracechecks: Defining semantic interfaces with temporal logic

Model checking pushdown systems

Auto-Generating Test Sequences for Web Applications *

ALASKA Antichains for Logic, Automata and Symbolic Kripke structures Analysis

On the Verification of Coordination

SMEDL: Combining Synchronous and Asynchronous Monitoring

Formal Modeling for Persistence Checking of Signal Transition Graph Specification with Promela

Model Checking VHDL with CV

Model-Checking Concurrent Systems

Formal Verification of a FIFO Component in Design of Network Monitoring Hardware

Validating UML Statechart-Based Assertions Libraries for Improved Reliability and Assurance 1

Lecture 1: Model Checking. Edmund Clarke School of Computer Science Carnegie Mellon University

Annales UMCS Informatica AI 2 (2004) UMCS. An algorithm and case study for the object oriented abstraction.

NuSMV 2: An OpenSource Tool for Symbolic Model Checking

Using Process Algebra to Validate Behavioral Aspects of Object-Oriented Models

junit RV Adding Runtime Verification to junit

38050 Povo (Trento), Italy Tel.: Fax: e mail: url:

A New Model Checking Tool

To be or not programmable Dimitri Papadimitriou, Bernard Sales Alcatel-Lucent April 2013 COPYRIGHT 2011 ALCATEL-LUCENT. ALL RIGHTS RESERVED.

Overview. Discrete Event Systems - Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

Instrumentation of Java Bytecode for Runtime Analysis

Static Analysis! Prof. Leon J. Osterweil! CS 520/620! Fall 2012! Characteristics of! System to be! built must! match required! characteristics!

Modeling the Real World for Data Mining: Granular Computing Approach

On Traceability of Informal Specifications for Model-Based Verification

Proc. XVIII Conf. Latinoamericana de Informatica, PANEL'92, pages , August Timed automata have been proposed in [1, 8] to model nite-s

Model Checking CSMA/CD Protocol using an Actor-Based Language

Double Header. Two Lectures. Flying Boxes. Some Key Players: Model Checking Software Model Checking SLAM and BLAST

Transcription:

A Novel Approach for Software Property Validation Salamah Salamah Department of Computer and Software Engineering, Embry-Riddle Aeronautical University, salamahs@erau.edu. Irbis Gallegos, Omar Ochoa Computer Science Department, University of Texas at El Paso, irbis, omar@miners.utep.edu. Abstract Formal approaches to software assurance such as runtime monitoring, model checking, and theorem proving have been shown to improve system dependability. All of these approaches require formal specifications of behavioral properties to verify a software system. Writing, reading, and validating formal specifications is difficult, and previously, there has been inadequate tool support for this task. The Property Specification tool, is a tool that was developed to assist users in the creation of formal specifications. Currently, Prospec assists in the generation of formal specifications in multiple languages. This paper describes a new approach/idea that will be integrated into Prospec to enhance that the ability of users to validate the generated formal specifications, against the original intent. 1. Introduction Formal methods to support software assurance require the identification of behavioral properties of the software system, generation of formal specifications for the properties, validation of the specifications, and verification of the correctness of the system. The effectiveness of the assurance approach depends on the quality of the formal specifications, and a significant hurdle to the use of formal approaches is the development of correct formal specifications [6, 7]. Typically, the person creating the formal specification is required to have a strong mathematical background and be aware of the subtleties of the specification language. For example, model checkers [2], such as SPIN [8] and NuSMV [1] use formal specifications written in Linear Temporal Logic (LTL) [11], which can be difficult to read, write, and validate. This problem is compounded if requirements must be specified in more than one formal language, which frequently is the case if more than one verification tool is used. The specifier must be aware of the differences in expressiveness of each of the target languages. The Property Specification (Prospec) tool [14] was developed to address some of these challenges. Prospec uses the Specification Pattern System (SPS) [3] and Composite Propositions (CP) [12, 13] to assist developers in the elicitation and specification of system properties.usability studies of Prospec have shown that it facilitates the elicitation, understanding, and specification of formal properties [12]. 1.1 Motivation Although, the soon to be released, Prospec 2.0 supports the generation of formal specifications in multiple languages such as LTL, Computational Tree Logic (CTL) [10], and Meta Event Definition Language (MEDL) [9], it currently does not provide sufficient support for validation of the generated properties. While Prospec and similar tools and approaches [3, 18] provide significant support for property specification, there is a real need to ensure that the generated formal specifications do, indeed, match the original intent of the specifier. Additionally, it has been shown that the specifications generated by these tools, do not always match the natural language description provided by these tools [16]. Providing the means to validate the generated specifications is extremely significant, as effective use of these formal specifications (whether in formal verification, design and code automation, or test cases development) is not possible if the generated specifications are faulty (i.e., do not match the developer s original intent). Indeed, incorrect specifications could lead to the very mishaps their use is designed to prevent. By their nature, formal specifications are hard to read and validate, and as such, support for validation and understanding of these specifications is required. For example, consider an ATM system with the following property: The response to user approval of a withdrawal trans-

action includes: the user s account is updated, money is dispensed, the receipt is printed, and the user s ATM card is returned. This property can be specified LTL as follows: G(user approval F (account updated X (F money dispensed X (F receipt printed X (F card returned))))) 1. It is obvious that such a description is hard to validate by those stakeholders who are not immersed in LTL. This work describes a basic idea that can be used for simple validation of formal specifications in LTL, CTL and MEDL. We intend in incorporating this idea in future versions of Prospec. The paper is organized as follows; Section 2 provides a brief description of the three formal languages LTL, CTL, and MEDL, and their semantics. Section 3 describes the validation approach introduced by the paper. The section includes descriptions of the models and codes for the verification tools used in the validation. The section also provides a scenario of using the proposed approach. The paper concludes with summery and future work, followed by the References. 2 Background 2.1 Linear Temporal Logic and Computational Tree Logic Linear Temporal Logic (LTL) is a prominent formal specification language that is highly expressive and widely used in formal verification tools such as the model checkers spin [8] and NuSMV [1]. LTL is also used in the runtime verification of Java programs [17]. Formulas in LTL are constructed from elementary propositions and the usual Boolean operators for not, and, or, imply (neg,,,, respectively). In addition, LTL allows for the use of the temporal operators next (X), eventually (F ), always (G), until, (U), weak until (W ), and release (R). Formulas in LTL assume discrete time, i.e., states s = 0, 1, 2,... The meaning of the temporal operators is straightforward. The formula XP holds at state s if P holds at the next state s + 1. P U Q is true at state s, if there is a state s s at which Q is true and, if s is such a state, then P is true at all states s i for which s s i < s. The formula F P is true at state s if P is true at some state s s. Finally, the formula GP holds at state s if P is true at all moments of time s s. Detailed description of LTL is provided by Manna et al. [11]. While specifications in LTL are asserted over all paths of execution, Computational Tree Logic (CTL) allows for assertions over individual paths. CTL uses the same temporal 1 The G symbol indicates Always or Globally, and F indicates sometime in the future. operators as LTL and they have the same semantics. However, since CTL is a branching type of logic then each CTL operator is a pair of symbols. The first one is either A ( for All paths ), or E ( there Exists a path ). The second one is of the temporal operators defined above for LTL. 2.2 Meta Event Definition Language The Meta Event Definition Language (MEDL) is the language used by Java-MaC monitor [9]. MEDL uses events and conditions to express safety properties. Conditions are predicates and events are an instantaneous state change. In MEDL, Conditions are associated with propositions that are evaluated at each computation state. Events denote a change of state in a condition from true/false to false/true. Conditions and events are defined recursively as follows [12]: Every proposition is a primitive condition. If C1 and C2 are conditions, then C1, C1 C2, and C1 C2 are also conditions. If E1 and E2 are events, then [E1, E2) is a condition. If C is a condition, then start(c) and end(c) are events. If E1 and E2 are events, then E1 E2 and E1 E2 are events. If E is an event and C is a condition, then E when C is an event. Alarms are used in MEDL to express events that should never occur during program execution. Once an alarm occurs during execution, a user notification is issued. Similar to LTL, MEDL formulas are evaluated over an execution trace. Each state in an execution trace assigns values to each primitive condition. The complete description of MEDL and its semantics can be found in [9]. 3 Validating Formal Specifications Formal verification techniques such as Model Checking [2], Runtime Monitoring [5], and theorem proving [15] have been shown to improve system reliability. These techniques are based on verifying the consistency of the system or its model with system properties presented as formal specifications. In model checking for example, the system model is presented in the modeling language for the model checker, and system properties are presented as temporal logic formulas [4]. Figure 1 shows the process of model checking. In this work, we use formal verification tools to validate formal specifications. We use the verification tools (a model checker and a runtime monitor) to validate the understanding of formal specifications written in the formal language 2

Figure 2. Model for LTL Validation Figure 1. The Process of Model Checking accepted by the verification tool. We provide a way for validating specifications written in LTL, CTL, and MEDL. We use the NuSMV model checker [1] for LTL and CTL validation, and the Java-MaC runtime monitor [9] to validate MEDL specifications. In this approach, we use the very same verification techniques (and their respective tools) that these formal specifications are used for. 3.1 General Approach The general idea in our approach is based on the work of Salamah et.al., [16], and it consists of the following steps: 1. Create a simple model in the language of the verification tool (NuSMV uses SMV language, and Java-MaC use the Java language), 2. map propositions in the formal specification to the variable(s) in the simple model, and 3. run the verification tool with the model, formal specification, and proposition values as input, and 4. check for consistency. The model created for each type of formal language remains the same in validating all specifications in that language. The model is simple enough that it is easy to compare the expected result of running the model against the formal specification and the actual result as returned by the tool. In validating a specification we need only to change the mapping of the propositions in that specification to the variables in the model. More details on the approach are included in the upcoming paragraphs. Figure 3. SMV Code for LTL Validation 3.1.1 LTL and CTL Validation Using NuSMV For validating LTL formulas, we used the NuSMV model checker. Although multiple number of model checkers, including the famous model checker spin [8] could have been used instead of NuSMV, the choice of NuSMV was basically because it can be used for both LTL and CTL validation. The model created for LTL validation, consists a loop that starts with the value of the variable state equals 1 and continues to increment the value of states until it reaches 20, at which point it remains at 20. Figure 2 provides a graphical representation of the model, while Figure 3 provides the actual SMV code for the model. While the details of the SMV code are irrelevant here, it is important to note that in each state of model the value of the variable Q.State changes to the value of the state. For example, in the first state, the value of Q.State is 1, it is 5 in the fifth state, and it is 20 in the last state. The importance of the value of the variable Q.State is that it is the value that propositions in the LTL formula are mapped to. For example, if one wants to validate the LTL formula F P (as in the fourth line in the SMV code), then the value of P has to be specified in terms of the variable Q.State. For example P can be specified as the truth value of the statement Q.State = 5 (as in the third line in the SMV code), which is only true in the fifth state in the model. CTL validation using NuSMV can be done in a similar 3

Figure 4. Model for CTL Validation fashion to LTL. However, we use a different model for validating CTL than the one used with LTL. The new model used for CTL validation is designed to allow for exploring and testing the branching capabilities of CTL. Figures 4 and 5 provide the model and SMV code, respectively, used for CTL validation. Figure 5. SMV Code for LTL Validation 3.1.2 MEDL Validation Using Java-MaC Java-Monitoring and Checking (Java-MaC) [9] is a runtime verification tool developed at the University of Pennsylvania targeted towards Java Programs. In Java-MaC, the user formally specifies the requirements in terms of high-level events and conditions. An event is something that occurs instantaneously during the program execution. A condition represents information that holds for a duration of time. A monitoring script is used to relate the events and conditions with the runtime low-level data of the system. Based on the monitoring script, the system is instrumented to send the monitored data to an event recognizer. The event recognizer transforms the low-level data into abstract events and sends them to a run-time checker generated from the requirement specifications. The runtime checker verifies the sequence of abstract events with respect to the requirement specifications and detects violations of requirements. Java-MaC uses two languages to formally specify properties, the Meta Event Definition Language (MEDL) and the Primitive Event Definition Language (PEDL). MEDL is used to express requirements, is based on an extension of LTL, expresses a large subset of safety properties of system such as real-time properties, and is independent of the mon- Figure 6. Java Code for MEDL Validation itored system. PEDL describes primitive high-level events and conditions in terms of system objects, and is tied to the implementation language of the monitored system. For MEDL validation, we use the same model used for LTL validation with NuSMV, with the exception that the model is written in Java instead of SMV. The Java code representing the model is shown in Figure 6. To validate a property in MEDL, we have to specify MEDL and PEDL files as shown in Figures 7 and 8 respectively. In the PEDL file, we specify the conditions or events that we build the MEDL specification on. This is similar to mapping the propositions in an LTL or CTL formula to the value of the variable Q.State in the SMV model. The MEDL file, contains the specification to be monitored by Java-Mac at runtime. The PEDL and MEDL files in Figures 7 and 8 are those defined for monitoring the specification that i will 4

always be less than a 100. Figure 7. MEDL File Figure 8. PEDL File Scenario: Sue is interested in generating a formal specification for the following property a request is always followed by an acknowledgment. Assume further that R signifies Request, and A signifies Acknowledgment. Using Prospec 2, Sue generates the following LTL specification G (R F A). Sue s original intent was that the acknowledgment must strictly follow the request, i.e., Acknowledgment has to hold in a state that comes after the state where Request holds. To validate whether such a behavior is allowed or not by the generated LTL specification, Sue runs the specification in NuSMV against the SMV model in Figure 3, setting both R and A to be true when Q.State equals 4 and observes NuSMV s output. The output in this case is valid, which means that such behavior is allowed by the generated LTL formula. As a result, Sue uses Prospec to refine her property and generates the LTL property G (R X F A), which does match her original intent. 4 Conclusions and Future Work Although the use of formal verification techniques improve the dependability of programs, they are not widely adapted in standard software development practices. One reason for the hesitance in using formal verification is the difficulty of reading, writing, and validating formal specifications required for the use of these techniques. While there exists multiple tools and approaches that assist in the generation of formal specifications, these tools do not provide adequate support to validate the generated specifications. 2 Refer to [14] more details on property generation in Prospec In this work, we described an idea for validating formal specifications using the same formal verification tools that these specifications are intended to be used with. We provided simple models written in the native languages of these verification techniques, which can be used in the validation process. The approach defined in this paper can be used to validate specifications in different formalisms as long as they are supported by a verification tool. Currently, as a project for sophomore level course in Software Engineering, a tool is being developed that allows for LTL and CTL validation using the model checker NuSMV based on the proposed approach. The tool will relief the users of the burden of changing the models specified in Section 2 to test different specifications and different scenarios. The tool will be used as an interface to the model checker. We plan on expanding that tool to include an interface for Java-MaC and allow for MEDL validation. Eventually, the developed will be incorporated into the Property Specification tool Prospec. References [1] Cimatti, A., Clarke, E., Giunchiglia, F., and Roveri, M., NuSMV: a new Symbolic Model Verifer International Conference on Computer Aided Verifcation CAV, July 1999. [2] Clarke, E., Grumberg, O., and D. Peled. Model Checking. MIT Publishers, 1999. [3] Dwyer, M. B., Avrunin, G. S., and Corbett, J. C., Patterns in Property Specification for Finite-State Verification, Proceedings of the 21st Intl. Conference on Software Engineering, Los Angeles, CA, USA, 1999, 411-420. [4] Emerson, E., A temporal and modal logic. In Handbook of theoretical Computer Science (Vol. B): Formal Models and Semantics, J. van Leeuwen, Ed. MIT Press, Cambridge, MA. 1990. 995-1072. [5] Gates, A., and Roach, S., DynaMICs: Comprehensive Support for Run-Time Monitoring, in Proceedings of the Runtime Verification Workshop 2001, Paris, France, Vol. 55, No. 2, July 2001, pp. 61-77. [6] Hall, A., Seven Myths of Formal Methods, IEEE Software, September 1990, pp. 11-19. [7] Holloway, M., and Butler, R., Impediments to Industrial Use of Formal Methods, IEEE Computer, April 1996, pp. 25-26. [8] Holzmann, G. J., The model checker SPIN IEEE Transactions on Software Engineering., 23(5):279-295, May 1997. [9] Kim, M., Kannan, S., Lee, I., and Sokolsky, O., Java-mac: a run-time assurance tool for java. In Proceedings of Runtime Verification (RV 01), volume 55 of Electronic Notes in Theoretical Computer Science. Elsevier Science, 2001. [10] Laroussinie, F. and Ph. Schnoebelen, Specification in CTL+Past for verification in CTL, Information and Computation, 2000, 236-263. [11] Manna, Z. and Pnueli, A., Completing the Temporal Picture, Theoretical Computer Science, 83(1), 1991, 97 130. 5

[12] Mondragon, O., Elucidation and Specification of Software Properties through Patterns and Composite Propositions to Support Formal Verification Techniques Dissertation, Computer Engineering Department, University of Texas at El Paso, 2004. [13] Mondragon, O. and Gates, A., Supporting Elicitation and Specification of Software Properties through Patterns and Composite Propositions, Intl. Journal Software Engineering and Knowledge Engineering, XS 14(1), Feb. 2004. [14] Mondragon, O., Gates, A., and Roach, S., Prospec: Support for Elicitation and Formal Specification of Software Properties, in Proceedings of Runtime Verification Workshop, ENTCS, 89(2), 2004. [15] Rushby, J., Theorem Proving for Verification, in F. Cassez, (Eds.): M odeling and Verification of Parallel Processes, Springer-Verlag, Nantes, France, 2000. [16] Salamah, S., Gates, A., Roach, S., and Mondragon, O., Verifying Pattern-Generated LTL Formulas: A Case Study. Proceedings of the 12th SPIN Workshop on Model Checking Software. San Francisco, California, August, 2005, 200-220 [17] Stolz, V. and Bodden, E., Temporal Assertions using AspectJ, Fifth Workshop on Runtime Verification, July 2005. [18] Smith, R.L., Avrunin, G.S., Clarke, L.A., and L.J. Osterweil, PROPEL: an approach supporting property elucidation. In Proceedings of the 24rd International Conference on Software Engineering. 2002, pp. 11-21 6