Reliable Objects: Lightweight Testing for OO Languages

Slides:



Advertisements
Similar presentations
Building Bug-Free O-O Software: An Introduction to Design By Contract A presentation about Design By Contract and the Eiffel software development tool.
Advertisements

Carlos D. Rivera February 28, 2007 Design-by-Contract.
TOPIC : SYNTHESIS DESIGN FLOW Module 4.3 Verilog Synthesis.
Object-Oriented Programming Basics Prof. Ankur Teredesai, Computer Science Department, RIT.
When is Orientated Programming NOT? Mike Fitzpatrick.
Chapter 12 Separate Compilation and Namespaces. Abstract Data Type (ADT) ADT: A data type consisting of data and their behavior. The abstraction is that.
Addressing the Challenges of Current Software. Questions to Address Why? What? Where? How?
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Basic OO Technology Technology determines the effectiveness of the approach.
Functions ROBERT REAVES. Functions  Interface – the formal description of what a subprogram does and how we communicate with it  Encapsulation – Hiding.
November 2005J. B. Wordsworth: J5DAMQVT1 Design and Method Quality, Verification, and Testing.
CHAPTER 3 COLLECTIONS Abstract Data Types. 2 A data type consists of a set of values or elements, called its domain, and a set of operators acting on.
Software Testing and Quality Assurance
Static and Dynamic Contract Verifiers For Java Hongming Liu.
CS 501: Software Engineering
Fall 2005CSE 115/503 Introduction to Computer Science I1 Lecture #4 Agenda Announcements Review Questions? Classes and objects UML class diagrams Creating.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Major Exam II Reschedule 5:30 – 7:30 pm in Tue Dec 5 th.
CS 2511 Fall  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance  Polymorphism.
Adding Contracts to Ada Ehud Lamm Adding Design By Contract to Ada.
UML class diagrams (1) UML = Unified Modeling Language We use only class diagrams, not other UML diagrams Purpose: –keep OO concepts separate from implementation.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Ranga Rodrigo. Class is central to object oriented programming.
Copyright © 2002, Systems and Computer Engineering, Carleton University Intro.ppt * Object-Oriented Software Development Unit 1 Course.
Classes and Class Members Chapter 3. 3 Public Interface Contract between class and its clients to fulfill certain responsibilities The client is an object.
Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing.
Computer Science School of Computing Clemson University Introduction to Formal Specification Murali Sitaraman Clemson University.
1 10/14/2015ã 2007, Spencer Rugaber The Waterfall Process Software plans and requirements Validation System feasibility Validation Product design Verification.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
Design by Contract in Java Concept and Comparison.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
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.
1 15 quality goals for requirements  Justified  Correct  Complete  Consistent  Unambiguous  Feasible  Abstract  Traceable  Delimited  Interfaced.
Elements of OO Abstraction Encapsulation Modularity Hierarchy: Inheritance & Aggregation 4 major/essential elements3 minor/helpful elements Typing Concurrency.
1 CS 501 Spring 2004 CS 501: Software Engineering Lecture 2 Software Processes.
Software Requirements: A More Rigorous Look 1. Features and Use Cases at a High Level of Abstraction  Helps to better understand the main characteristics.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2009 Pearson Education, Inc., Upper.
© Copyright Alvarion Ltd. SVA Dafna Senderovich Jan 2006.
Object-Oriented Design Concepts University of Sunderland.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
Defining Classes I Part B. Information hiding & encapsulation separate how to use the class from the implementation details separate how to use the class.
1 Lecture 8 b Data Structures b Abstraction b The “Structures” package b Preconditions and postconditions b Interfaces b Polymorphism b Vector class b.
DBC NOTES. Design By Contract l A contract carries mutual obligations and benefits. l The client should only call a routine when the routine’s pre-condition.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
CSC 243 – Java Programming, Spring, 2014 Week 4, Interfaces, Derived Classes, and Abstract Classes.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
Interfaces CMSC 202. Public Interfaces Objects define their interaction with the outside world through the their public interface. A class' public interface.
 System Requirement Specification and System Planning.
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
Introduction to Java Chapter 1 - Introduction to Java1 Chapter 1 Introduction to Java.
Principles of Programming & Software Engineering
Defining Classes and Methods
Chapter 5: Enhancing Classes
ASIC Design Methodology
Object-Oriented Programming Basics
Introduction to Advanced Java Programming
Types of Programming Languages
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Defining Classes and Methods
Overview of Programming Paradigms
Defining Classes and Methods
Defining Classes and Methods
Computer Science 340 Software Design & Testing
Abstract Data Types Abstraction is to distill a system to its most fundamental parts. Applying the abstraction paradigm to the design of data structures.
Inheritance Lakshmish Ramaswamy.
From Use Cases to Implementation
Presentation transcript:

Reliable Objects: Lightweight Testing for OO Languages David Mattingly

Problems addressed Based on waterfall model – not on iterative models. No longer feasible to separate testing from specification, design, coding. Not based upon inherent power of OO.

Specifying behavior Must know what each component should do in every situation No formal specification language

Design by Contract Lightweight descriptions Captures mutual obligations and benefits Must specify every consistency condition Boolean assertions

Implementation Implementations exist in Eiffel, Java, C++, Perl. Eiffel only language to directly support design by contract. All other languages rely on outside utilities.

Java Implementation Example from Pylon library (www.nenie.org/eiffel/pylon) Source code with self-testable classes at www.iu-vannes.fr/docinfo/stclass

Java Design by Contract Contract Watchdogs trace and assert

Implementation 1 Call inherited functions directly in code. Another level of inheritance. Calls inside methods can be forgotten about.

Implementation 2 Contract definition in comments Preprocessor iContract (www.reliable-systems.com/tools)

Making self-testable classes Define pre and post-conditions in comments. Interface inheritance and Delegation. Testing methods: testing unit & goal

Validation & Verification Compile with iContract & Java compiler. Output details results of tests.

Abstract Classes Cannot be self-testable Can define contracts Implementing classes inherit contracts

Mutation Testing Determine how adequate our tests our. Adequate Test set distinguishes the original program from mutants.