P.R. James © P.Chalin et al.1 An Integrated Verification Environment for JML: Architecture and Early Results Patrice Chalin, Perry R. James, and George.

Slides:



Advertisements
Similar presentations
Extending Eclipse CDT for Remote Target Debugging Thomas Fletcher Director, Automotive Engineering Services QNX Software Systems.
Advertisements

Feature requests for Case Manager By Spar Nord Bank A/S IBM Insight 2014 Spar Nord Bank A/S1.
Dept. of Computer Science A Runtime Assertion Checker for the Java Modeling Language (JML) Yoonsik Cheon and Gary T. Leavens SERP 2002, June 24-27, 2002.
Intro to OOP with Java, C. Thomas Wu Inheritance and Polymorphism
An overview of JML tools and applications Lilian Burdy Gemplus Yoonsik Cheon, Gary Leavens Iowa Univ. David Cok Kodak Michael Ernst MIT Rustan Leino Microsoft.
Maya: Multiple-Dispatch Syntax Extension in Java Jason Baker and Wilson C. Hsieh University of Utah.
Eclipse Architecture Dwight Deugo Nesa Matic
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Development Software Life Cycle UML Diagrams.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
JML TOOLS REVIEW & EVALUATION Chris Grosshans Mark Lewis-Prazen.
Transformation of Java Card into Diet Java Semester Project Presentation Erich Laube.
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
Stimulating reuse with an automated active code search tool Júlio Lins – André Santos (Advisor) –
1 CMPT 275 Software Engineering Revision Control.
Maintenance Refactoring and Code Smells. Where are we? Over the semester we have talked about Software Engineering. The overall goal of software engineering.
“is a”  Define a new class DerivedClass which extends BaseClass class BaseClass { // class contents } class DerivedClass : BaseClass { // class.
Lecture 8 Inheritance Richard Gesick. 2 OBJECTIVES How inheritance promotes software reusability. The concepts of base classes and derived classes. To.
C++ Code Analysis: an Open Architecture for the Verification of Coding Rules Paolo Tonella ITC-irst, Centro per la Ricerca Scientifica e Tecnologica
A Safety-Critical Java Technology Compatibility Kit Hans Søndergaard Stephan Korsholm VIA University College, Horsens, Denmark & Anders P. Ravn Aalborg.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
CSC 142 B 1 CSC 142 Java objects: a first view [Reading: chapters 1 & 2]
JavaDoc1 JavaDoc DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY July 24, 2006 by Emil Vassev & Joey Paquet revision 1.2 –
Building Tools by Model Transformations in Eclipse Oskars Vilitis, Audris Kalnins, Edgars Celms, Elina Kalnina, Agris Sostaks, Janis Barzdins Institute.
1 Total Correctness of Recursive Functions Using JML4 FSPV George Karabotsos, Patrice Chalin, Perry R. James, Leveda Giannas Dependable Software Research.
CSE 219 Computer Science III Program Design Principles.
The Daikon system for dynamic detection of likely invariants MIT Computer Science and Artificial Intelligence Lab. 16 January 2007 Presented by Chervet.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
C#.Net Development Version 1.0. Overview Nullable Datatype Description ? HasValue Lifted Conversions null coalescing operator ?? Partial Classes Copyright.
Product Update March Copyright © IET Ltd 2008 Agenda  Release 7.7  VerifIEr.
Refactoring1 Improving the structure of existing code.
Object Oriented Software Development
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Introducing Allors Applications, Tools & Platform.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
© 2006 Intland Software1 Aron Gombas Architect, Intland Software Extending & customizing CodeBeamer.
Modularly Typesafe Interface Dispatch in JPred Christopher Frost and Todd Millstein University of California, Los Angeles
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Early Detection of JML Specification Errors using ESC/Java2 Patrice Chalin Dependable Software Research Group (DSRG) Computer Science and Software Engineering.
Application development with Java Lecture 21. Inheritance Subclasses Overriding Object class.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
David LOU – Project Manager Markus SCHANTA – Language Guru Long CHEN – System Architect Xiaolong JIANG – System Integrator Jingbo YANG – Tester & Validator.
Java Annotations. Annotations  Annotations are metadata or data about data. An annotation indicates that the declared element should be processed in.
Interfaces F What is an Interface? F Creating an Interface F Implementing an Interface F What is Marker Interface?
Cross Language Clone Analysis Team 2 February 3, 2011.
Java Annotations for Types and Expressions Mathias Ricken October 24, 2008 COMP 617 Seminar.
Runtime Assertion Checking Support for JML on Eclipse Platform Amritam Sarcar Department of Computer Science University of Texas at El Paso, 500 W. University.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Object orientation and Packaging in Java Object Orientation and Packaging Introduction: After completing this chapter, you will be able to identify.
Exceptions Lecture 11 COMP 401, Fall /25/2014.
Project Proposal A JML compiler on Eclipse Platform Amritam Sarcar CS5381.
Crystal-izing Sophisticated Code Analyses Ciera Jaspan Kevin Bierhoff Jonathan Aldrich
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Jeremy Nimmer, page 1 Automatic Generation of Program Specifications Jeremy Nimmer MIT Lab for Computer Science Joint work with.
Extended Static Checking for Java
Module Road Map Refactoring Why Refactoring? Examples
Accessible Formal Methods A Study of the Java Modeling Language
Are Practitioners Writing Contracts?
Overview of Eclipse Lectures
Java Programming Language
Lecture 22 Inheritance Richard Gesick.
Interfaces.
CSE 303 Concepts and Tools for Software Development
Java Programming Course
Java Modeling Language (JML)
RAC Support for JML on Eclipse Platform
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

P.R. James © P.Chalin et al.1 An Integrated Verification Environment for JML: Architecture and Early Results Patrice Chalin, Perry R. James, and George Karabotsos Dependable Software Research Group Computer Science and Software Engineering Dept. Concordia University, Montreal, Canada {chalin, perry,

P.R. James, p. 2 Road map JML: language & tools Requirements for Next-generation JML4 features JML4 architecture Early benefits

P.R. James, p. 3 Java Modelling Language A language for describing behavior of code Tools to ensure they match

P.R. James, p. 4 Java Modelling Language A language for describing behavior of code –DbC with lightweight specs –Full BISL with heavyweight specs Tools to ensure they match

P.R. James, p. 5 Java Modelling Language A language for describing behavior of code Tools to ensure they match –RACJML compiler ( jmlc ) –ESCESC/Java2 –FSPVLOOP, JACK –testingJmlUnit –docJmlDoc –autogenJmlSpec, Daikon, Houdini

P.R. James, p. 6 Current State of affairs: Limitations of current tools Lots of good tools... but Not interoperable Own parsers, desugarers, etc. Out of date –Java 5 released in September 2004 –Still no support for generics Mostly command-line driven

P.R. James, p. 7 Current State of affairs: What worked well in JML 2 Common JML tool suite –Checker, RAC, JmlUnit Built on MultiJava compiler (MJ) –MJ mostly independent of JML –JML subclasses MJ classes & overrides methods –Extension points Calls to empty methods This idea used in JML 4

P.R. James, p. 8 Requirements for any Next-generation JML tools Remove duplication of effort –Tool developers –Analysis No maintenance of a Java compiler Integrated (development and) Verification Environment (IVE)‏ –Support RAC, ESC, and FSPV JML4 achieves these

P.R. James, p. 9 JML4 Built atop Eclipse, integrated with the JDT Currently supports –Processes annotations in.java and.jml files –Non-null type system Static enforcement RAC generation (desugared) –Initial Design by Contract Initial integration with ESC/Java 2 RAC generation

P.R. James, p. 10 High-level Package view JML 4 changes / introduces packages in bold Everything’s a plug-in ! (except this small bit) JML 4 replacement for JDT plug-in + additional UI plug-in

P.R. James, p. 11 Compilation Phases Inline & external specs processed Static verification before code generation so it can influence runtime checking

P.R. James, p. 12 Eclipse JDT: Lexical analysis Hand crafted Tedious to modify keywords JML in special comments –Easy to switch to augmented keywords

P.R. James, p. 13 Eclipse JDT: Parsing – 2 kinds Diet parsing –Method bodies skipped –Only signature information Full parsing –Method bodies processed –All info available For memory efficiency –All diet parsed –Full parsed individually, then discarded

P.R. James, p. 14 Eclipse JDT: Parsing +Parser generated using JikesPG +Grammar follows Java Language Specification +One semantic action per reduction -Little support for token stacks -Replaced calls to ASTNode constructors with JML-specific versions -Documentation only in German

P.R. James, p. 15 Eclipse JDT: Customizing the lexer and parser replaces manual process

P.R. James, p. 16 Eclipse JDT: Part of the AST hierarchy No copy & change of code Only overriding & hooks Jml types shadow originals

P.R. James, p. 17 Eclipse JDT: Type checking & Flow analysis Changed to support non-null type system Extended with hooks (calls to empty methods) added in original resolve and analyseCode methods

P.R. James, p. 18 Eclipse JDT: Static verification Originally delegated to ESC/Java2 Now working to use –Eclipse as a front end –ESC/Java2 back end Later steps are to –Optionally remove RAC for proved properties –Add interface for FSPV

P.R. James, p. 19 Eclipse JDT: RAC code generation (part of a hook) public static void generateNullityTest( CodeStream codeStream, String exceptionType, String msg) { BranchLabel nonnullLabel = new BranchLabel(codeStream); codeStream.dup(); codeStream.ifnonnull(nonnullLabel); codeStream.newClassFromName(exceptionType, codeStream.athrow(); nonnullLabel.place(); }

P.R. James, p. 20 JML 4 Validation Compiler is kept up to date with new features –JDT already supports Java 6 No copy & change of JDT code –use subclassing and method extension points –bracketing our changes with special comments CVS vendor branches Merging in weekly updates is painless –takes on average < 10 min.

P.R. James, p. 21 JML 4: Early benefits Ran JML 4 on ESC/Java2 New problems found in Main class

P.R. James, p. 22 JML 4: Early benefits VcGenerator vcg = null;... try {... // possible assignment to vcg } // multiple catch blocks catch (Exception e) {... }... fw.write(vcg.old2Dot()); // possible NPE

P.R. James, p. 23 JML 4: Early benefits

P.R. James, p. 24 JML 4: Early benefits In a superclass of Main static public Options options = null; In Main public static Options options() { return (Options)options; } 250+ occurrences of options().someField or options().someMethod() fe.Options esc.Options

P.R. James, p. 25 JML4: Next steps Continue adding support JML level 0 (and above) Enhance ESC support Include interface for FSPV …

P.R. James, p. 26 Related work JML 3 –A proper plug-in → doesn’t use non-API classes –Needs its own parser, type checker, etc. JML 5 –Specifications in annotations –Can’t put annotations everywhere we want –Needs its own parser, type checker, etc.

P.R. James, p. 27 Related work

P.R. James, p. 28 Conclusion Integrated (development and) Verification Environment (IVE)‏ Support RAC, ESC, and FSPV No need to maintain a Java compiler Unify support to remove duplication of effort

P.R. James, p. 29 An Integrated Verification Environment for JML Thank you !