Verificare şi Validarea Sistemelor Soft Tem ă Laborator 1 Tools for JML jmlc & jmlrac Dat ă primire laborator: Lab 1 Dat ă predare laborator: Lab 2.

Slides:



Advertisements
Similar presentations
Exceptions CSE301 University of Sunderland Harry Erwin, PhD.
Advertisements

Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 8.
Yoshi
The Java Modeling Language JML Erik Poll Digital Security Radboud University Nijmegen.
Exceptions Ensuring program reliability. Program correctness The term program correctness refers to a program’s working as advertised; that is, it produces.
An Introduction to Java Programming and Object- Oriented Application Development Chapter 8 Exceptions and Assertions.
Exception Handling Yaodong Bi Exception Handling Java exception handling Try blocks Throwing and re-throwing an exception Catching an.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Exception Handling. Introduction An exception is an abnormal condition that arises in a code sequence at run time. In computer languages that do not support.
1 Lecture 11 Interfaces and Exception Handling from Chapters 9 and 10.
Generic programming in Java
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.
ITEC200 Week02 Program Correctness and Efficiency.
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.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Chapter 8 Exceptions. Topics Errors and Exceptions try-catch throwing Exceptions Exception propagation Assertions.
JML and Class Specifications Class invariant JML definitions Queue example Running JML in Eclipse.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Spring 2005 Chapter 8  Errors and Exceptions Throwable class.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 4: Enhancing Your Program.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Software Quality: Testing and Verification II. 2 1.A failure is an unacceptable behaviour exhibited by a system — The frequency of failures measures software.
Java Review 2 – Errors, Exceptions, Debugging Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Cormac Flanagan University of California, Santa Cruz Hybrid Type Checking.
The switch statement: an N-way selection statement.
Verificarea şi Validarea Sistemelor Soft Tem ă Laborator 2 Testare Black Box Dat ă primire laborator: Lab 2 Dat ă predare laborator: Lab 2,3.
Preventing and Correcting Errors
Assertions Program correctness. Assertions Java statement – enables you to assert an assumption about your program. – An assertion contains a Boolean.
Object Oriented Programming
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. Goal to learn about computers and programming to compile and run your first Java program to recognize compile-time and run-time.
Chapter 21 Generics 1. Generics - Overview Generic Methods specify a set of related methods Generic classes specify a set of related types Software reuse.
Extended Static Checking for Java  ESC/Java finds common errors in Java programs: null dereferences, array index bounds errors, type cast errors, race.
Exception Handling in JAVA. Introduction Exception is an abnormal condition that arises when executing a program. In the languages that do not support.
Introduction to Exception Handling and Defensive Programming.
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.
Today’s Agenda  Quick Review  Continue on JML Formal Methods in Software Engineering1.
A Survey on Java Modeling Languages Gergely Kovásznai,Eszterházy Károly College Wolfgang Schreiner,Johannes Kepler University Gábor Kusper,Eszterházy Károly.
Exceptions in Java. Exceptions An exception is an object describing an unusual or erroneous situation Exceptions are thrown by a program, and may be caught.
BIO Java 1 Exception Handling Aborting program not always a good idea – can’t lose messages – E-commerce: must ensure correct handling of private.
© Mohamed Nuzrath Java Programming :: Chapter 6 :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme coordinator IT Lecturer.
”Java and JMLfor Dummies” The Java source code is written in a text file using your favourite editor (Notepad) and is saved with extension.java. Be careful.
 Asserting Expectations. Introduction -Observation alone is not enough for debugging as it can be a burden for a programmer. -One must compare observed.
Extended Static Checking for Java Cormac Flanagan Joint work with: Rustan Leino, Mark Lillibridge, Greg Nelson, Jim Saxe, and Raymie Stata.
How to Program? -- Part 1 Part 1: Problem Solving –Analyze a problem –Decide what steps need to be taken to solve it. –Take into consideration any special.
Verificare şi Validarea Sistemelor Soft Tem ă Laborator 1 ESC/Java2 Extended Static Checker for Java Dat ă primire laborator: Lab 1 Dat ă predare laborator:
Exceptions and Assertions Chapter 15 – CSCI 1302.
Java FilesOops - Mistake Java lingoSyntax
Runtime Assertion Checking Support for JML on Eclipse Platform Amritam Sarcar Department of Computer Science University of Texas at El Paso, 500 W. University.
Combining Static and Dynamic Reasoning for Bug Detection Yannis Smaragdakis and Christoph Csallner Elnatan Reisner – April 17, 2008.
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 10: Programming Exceptionally.
Exception. Agenda Exception. Handling Exceptions. The finally Clause.
ECE122 L23: Exceptions December 6, 2007 ECE 122 Engineering Problem Solving with Java Lecture 24 Exceptions.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 17 – Specifications, error checking & assert.
Logger, Assert and Invariants
CSE 374 Programming Concepts & Tools
Accessible Formal Methods A Study of the Java Modeling Language
PL/SQL Scripting in Oracle:
Advanced Programming Behnam Hatami Fall 2017.
Java Programming Language
Blame Analysis for Components
Exception Handling Chapter 9 Edited by JJ.
Lecture 9: Exceptions in Java CS201j: Engineering Software
Hoare-style program verification
Unit 3 Test: Friday.
Java Modeling Language (JML)
Subtype Substitution Principle
RAC Support for JML on Eclipse Platform
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

Verificare şi Validarea Sistemelor Soft Tem ă Laborator 1 Tools for JML jmlc & jmlrac Dat ă primire laborator: Lab 1 Dat ă predare laborator: Lab 2

Verificare şi Validarea Sistemelor Soft Extended static checking with ESC/Java Automatically tries to prove simple JML assertions at compile time. checks specs at compile-time proves correctness of specs. Warn about likely runtime exceptions and violations. Runtime assertion checking with jmlc/jmlrac Special compiler inserts runtime tests for all JML assertions. Any assertion violation results in a special exception. checks specs at run-time. only tests correctness of specs. Find violations at runtime. Tools for JML

Verificare şi Validarea Sistemelor Soft Runtime assertion checking Normally Compile using javac to get A.class Execute A.class using javac To do JML runtime assertion checking – Compile using jmlc to get A.class (compiles an instrumented version of the code where JML-assertions are explicitly checked) – Execute A.class using jmlrac (translates JML assertions into runtime checks:during execution, all assertions are tested and any violation of an assertion produces an Error) Actually, jmlc is a preprocessor for javac, and jmlrac a wrapper for java. Typically, you use jmlc/jmlrac when testing code. Benefit (we hope) : More errors detected, with less effort.

Verificare şi Validarea Sistemelor Soft normal_behavior keyword notes that method should finish normally. behavior keyword notes that there can be an exception thrown. exceptional_behavior states that the method must always terminate with an exception. signals clause can be used to describe under what condition an exception can be thrown. Method specification Specifying Exceptions

jmlc and jmlrac - Demo 01: Factorial Exception – Demo02: Integer sqrt jmlc and jmlrac – by example

Verificare şi Validarea Sistemelor Soft Temă Laborator 1 Tools for JML jmlc & jmlrac Dată primire laborator: Lab 1 Dată predare laborator: Lab 2 A se vedea fişierul TemaLab01_JML.pdf