Design by Contract in Java a roadmap to excellence in trusted components

Size: px
Start display at page:

Download "Design by Contract in Java a roadmap to excellence in trusted components"

Transcription

1 Design by Contract in Java a roadmap to excellence in trusted components Abstract Reuse is one of the main targets in future software engineering. This article outlines a new concept in software development, that could enforce reuse with trusted components. The central idea is the involvement of the well known concept of design by contract into the Java programming language with recent approaches. In addition, processes and tools that support design by contract throughout the whole software engineering have to be set up. Authors Markus Wiedmann studies business engineering at the University Karlsruhe (TH) and writes presently his diploma thesis on quality management processes on the basis of design by contract and works as external collaborator for nova data AG on a project about software quality management. address: Im Wörth 7a, D Baden-Baden, Germany markus.wiedmann@novadata.de Hagen Buchwald studied business engineering at the University Karlsruhe (TH). In 1994 he wrote his diploma thesis on a genetic algorithm programming environment based on Eiffel. He works as IT consultant for nova data AG in the Innovation & Competence Center which is focused on e-business. address: Becker Göring Str. 26, D Karlsbad, Germany hagen.buchwald@novadata.de web: Detlef Seese leads as university professor the group complexity management of the Institut AIFB and is responsible in teaching and research for programming in Java, complexity and quality management, electronic commerce, intelligent software agents and the application of intelligent methods in the area of computational finance address: Institute AIFB, Universty Karslruhe (TH), D Karlsruhe, Germany seese@aifb.uni-karlsruhe.de web: 1

2 1 - Introduction Time is one of the key success factors in the IT market. Quality is taken for granted by customers and the price for software is related to customer benefits. Preferred IT partners are IT companies which excel in time. In order to increase your excellence in time, you have to make reuse of components to an integral part of your software development process. However, no reuse without excellence in trusted components. Trust in components means, that we can believe that a piece of software is correct. But what is correctness about and how to create trust in the correctness of software components? Formally, correctness could be defined as the ability of software products to fulfil their exact tasks as defined by their specification. The verification of correctness of any software application could be achieved by a mathematical correctness proof for instance or you could work the other way around and reveal bugs by dynamic testing. A different approach to demonstrate that a certain software meets its specification was introduced by Bertrand Meyer and first implemented in his Eiffel programming language more than one decade ago: the method of design by contract. This article will first describe the basics of design by contract and state some examples to explain its usage and benefits to our readers. In the second paragraph current tools for the application of this technique to the Java language are discussed. In the third section we describe an approach to implement design by contract in a modern software development process that supports this concept throughout the software lifecycle with specific tools in order to create trust in developed components. Finally, we describe the first experiment to introduce our approach in a development team of a software company. 2 - Basics of design by contract The basic ingredients of design by contract is the representation of an application s specification within the code by contracts between the routines of communicating objects. Contracts are defined by pre- and postconditions and class invariants. These constraints can be observed during runtime for their fulfilment if checks are enabled. Defining those constraints for a routine is a way to determine a contract that binds the routine and its callers (see [7], cf. table 1): Like a legal contract, they produce a mixture of benefits and obligations for both, the supplier and the client of a method. The client has to fulfil the requirements stated in preconditions in order to make the supplier execute its public methods. Has the client obeyed these obligations, the supplier guarantees, that the result of the called method will satisfy the postcondition. Communication among objects will be checked during runtime for their compliance with these constraints. obligation benefit for supplier Fulfil postcondition Client calls obey precondition for client Fulfil precondition Supplier guarantees a result that meets postcondition Table 1: Obligations and benefits of a contract Syntactically, these constraints are Boolean expressions with a few extensions, that involve software elements like attributes and methods. Within recent realisations of design by contract for Java (cf. next paragraph) the quantifiers for all and exists extend the syntax to predicate calculus. Pre- and postconditions might be added to every method in the scope of a class. Class invariants express general consistency constraints that apply to every instance as a whole. However, they only apply for stable states before and after the execution of an operation, that are observable from an external point of view. Stable states are those in which a client can apply a feature to an instance. At any other time, there is no need for the class invariant to hold. Invariants reduce redundancy by stating once what could be expressed by adding these constraints to every pre- and postcondition throughout the class. Technically, constraints of class invariants are simply conjuncted with pre- and postconditions of non-private methods during runtime. 2

3 Let us describe as an example the type Person: An object of this type contains the private property personsage that could be manipulated with the method setage(int). Typical constraints for this method could be 1 : public class Person { //invariant: personsage > 0 private int personsage; } //precondition: age > 0 //postcondition: personsage == age@pre public void setage (int age) { personsage = age; } The resulting benefits and obligations for method setage ( ) are shown in table 2 2 : Supplier Client Obligation original value of formal parameter is transferred to class variable personsage call setage( ) with positive int value as formal parameter Benefit setage ( ) is called with a positive int value value of formal parameter is transferred to personsage Table 2: Obligations and benefits for method setage ( ) If any constraint evaluates to false during runtime, it is obviously because of a discrepancy between the specification and the implementation of the software. If such a contract violation occurs, an exception will be thrown in order to reveal the bug that caused it. Meyer and Mandrioli (see [8]) formulated guidelines for the interpretation of an exception: A precondition violation shows a bug in the client: the calling routine did not obey its part of the deal. A postcondition violation shows a bug in the supplier: the called routine did not perform its task. If the class invariant is violated this indicates also a bug on the supplier side. A routine should either fulfil its contract, or it fails to fulfil it and an exception will be thrown. There should not be exception handling for those exceptions originated by contract violations, since causing bugs must be revealed. Critics might say, the constraints of the previous example could have been implemented directly in the software code. But Meyer s intention is to reduce software complexity by taking out the constraint checking of the method bodies. In addition design by contract leads to better documentation and readability of the code since the specification of each method is attached compactly to it. Those who are familiar with the C/C++ programming language might say design by contract would be similar to the assert ( ) function. This is enforced by Meyer s misleading introduction of the notion assertion that describes the constraints used in pre-/postconditions and class invariants. But unlike the assert( ) function, assertions address also the inheritance concept of the object-oriented paradigm. The associated type substitution principle demands free assignment of subtype objects to their supertypes. Design by contract offers principles that support correct inheritance of constraints between super- and subtypes according to this rule (see [7]): As benefit for developers, you must not repeat constraints of parent classes in your subclasses. 1 Note: variable@pre symbolises the value of a formal parameter before method execution. 2 Besides the listed benefits and obligations, the satisfaction of the class invariant will be checked. 3

4 To add another example we describe the classes Father, Mother and Child, which are extensions of Person. Both of them inherit methods and constraints of the class Person. Additional constraints are given by the rules that a child has unique biological parents, but parents can have more than one child. Picture 1 describes this bilateral relationship with several objects of these types. Object of type Father: Peter Object of type Mother: Mary has a... has a... Object of type Child: Luke Picture 1: Objects of type Father, Mother and Child and their associations A violation of this rule is expressed in Picture 2: Object of type Father: has a... Peter Object of type Child: Objects of type Mother: Mary Martha has a... has a... Luke Picture 2: Objects that violate the stated constraints In order to implement this system with its constraints we could use class invariants that prevent situations like the case of picture 2 by throwing exceptions. The class diagram in picture 3 sketches a possible implementation. Be aware of the constraint inheritance: The invariant of the class Person is conjuncted with subclass invariants, although it is not repeated. 4

5 Class Person inv.: personsage > 0 Class Father invariant: children!= null implies forall Child c in children.elements( ) c.getfather( ) = = this public Children children; Class Child invariant: getfather( )!= null implies exists Child c in getfather( ).children.elements( ) c = = this and getmother( )!= null implies exists Child c in getmother( ).children.elements( ) c = = this 1 Class Mother invariant: children!= null implies forall Child c in children.elements( ) c.getmother( ) = = this public Children children; 1 private Mother mother; private Father father; public Mother getmother ( ) { return mother; } public Father getfather ( ) { return father;} * 1 1 Class Children (extends Vector) public void addchild(child c) { addelement(c); } 2 Picture 3: Implementation of Father, Mother and Child So we have seen, that design by contract supports software development within three areas: With the formal representation of a system s specification as assertions in the code, the design and the documentation of any piece of software are improved. Through runtime monitoring of assertion violations the correctness of the implementation is observed and the source code can be improved in case bugs are revealed. Runtime monitoring after product release creates customer trust in supplied components since constraint violations are revealed immediately and can be located exactly. 3 - Applying design by contract to Java Recently a number of concepts were introduced to extend the Java language with features of design by contract beyond the original Java syntax: jcontractor (see [5]) and Handshake (described in [4]) were developed at the Department of Computer Science at the University of California, Santa Barbara. Jass (from [1]) is an approach made by the University of Oldenburg, Germany. icontract (cf. [6]) was constructed as semi-commercial tool from the Reliable Systems company. jcontractor is a library-based approach. Assertions are attached to the code by implementing specific methods for pre-/postconditions and invariants. They are checked during runtime either by using the jcontractor class loader, which instruments classes on the fly during loading, or by instantiating new objects with the New method of the jcontractor library. The Handshake system allows developers to set up external contract specification files for classes. It is designed as dynamically linked library that intercepts the JVM s file accesses and instruments the Java bytecodes on the fly. Jass and icontract are both design by contract pre-processors for Java. Assertions are attached to classes and methods within tagged Javadoc comment lines. Both pre-processors generate modified 5

6 source codes where assertion checking routines are attached to the original methods in additional private ones. An overview of the performance of all four approaches is shown in table 3. Realisation Assertion implementation Instrumentation for assertion checks Switch runtime checks on/off Object Constraint Language (OCL) Instrumented Classes run with JVM without extensions Support for Javadoc jcontractor Handshake Jass icontract Dynamically linked Pre-processor; Pre-processor; library; must be ported pure Java pure Java to other platforms Java library / class loader approach; pure Java Specific methods for constraint-checking are added in original Java code; with library approach: New( )- method instrumentation on the fly For all constraint checks together (disable jcontractor class loader) Constraints are added in external files; source code remains unchanged instrumentation on the fly For all constraint checks together Constraints are added within Javadoc comments (e.g.: /** require <expr>**/) During compilation comments are transformed into private routines Pre-processor enables free combination of constraint checks for every class not supported not supported quantifiers and implies can be used in assertions No: jcontractor class loader / library necessary assertion methods are listed No: dynamically linked library necessary for constraint checks No Table 3: Overview of current approaches to apply design by contract for Java For the project we present in the next paragraph we preferred the last two approaches. Yes Yes Constraints are added within Javadoc comments (e.g.: <expr> **/) During compilation comments are transformed into private routines Pre-processor enables free combination of constraint checks for every class quantifiers and implies can be used in assertions Yes No Tags are not accepted 4 - Adapting software engineering for design by contract with Java Now that necessary tools to support design by contract in the Java language are available, how could the software engineering be adapted to this concept? The central idea is the implementation of a software process for the development with Java that supports design by contract throughout the whole lifecycle and realises benefits from this concept concerning the three areas design, implementation and documentation. Adapting design phase: Analysing and designing a new system is connected to huge efforts in documentation and communication for the designing team. Therefore, we need an appropriate standard communication means that provides flexibility and extendibility to involve design by contract already in the communication of the design phase. The Unified Modelling Language (UML) predefines <<invariant>>, <<precondition>> and <<postcondition>> as three standard stereotypes of constraints for class diagrams. As soon as we have broken down the overall system specification to the class level, we express it as part of our class design. In addition, with the OCL as part of the UML we have a powerful means for expressing constraints. But in current development activities, there often follows a gap between designing and coding of a system: on one side diagrams are produced and on the other side the real system is coded in a development environment. The link is missing. Even with the usage of code producing front-end CASE-Tools, constraints and specifications kept in diagrams (and therefore design by contract) are normally lost when class files are generated. 6

7 At first, we filled this gap between the diagramming and the coding task: we manipulated a specific UML to Java code generator the way, that textual constraints attached to classes and methods in the diagrams were directly embedded as Javadoc comments into the empty code body with the requested tags for the pre-processor in use. Adaptation of the implementation phase: Sometimes, an implementation does not meet exactly the intention that was written down in its specification. Testing against stated constraints could reveal those discrepancies. But traditional tests are based on input/output comparison. We need a test strategy for the implementation phase that is focused on testing software to software communication and on revealing contract violations. Therefore, we lent the special habit of testing from the Extreme Programming (XP) method (see [2]). On the one hand, test writing prior to implementing the code into method bodies enforces thoughts about the detailed design of a system. Specification (i.e. assertions) and design of a system are reviewed again, when functional tests are written. Writing a test when a method interface is unclear or the implementation seems to be a bit complicated could help to find a proper solution. An additional link between design and implementation is created. On the other hand testing during coding, as suggested by XP, demonstrates that features work together, follow their specification and are finished. Testing with fully enabled constraints during the coding phase creates trust and confidence in a system or reveals bugs in implementation or specification. This strategy leads to continuous improvement of the business logic of a system since failures are revealed early in the implementation phase. In addition, design by contract achieves a reduction of complexity in the source code: constraints must not be checked within the method body and potential sources for new defects in the code are diminished. For the testing activity, we designed an interface ITestable which has to be implemented by every class. Having a unified test interface allows fully automated test runs. With every new version of the implementation, the embedded test method is then checked in into the version control system. So, a suitable test method is always attached to every version of a class. This supports consistency throughout the whole activity of implementing and testing. The ITestable interface implements two static method bodies that give a Vector object back to its caller: class ITestable { public static Vector BBTest( ) { } public static Vector WBTest( ) { } } The methods BBTest and WBTest suggest to implement separate black and white box tests since a good test strategy should be a mixture of both kinds of tests. The target for development is to implement tests that call every public method of a class and collect all upcoming exceptions in a vector to pass them back to the calling test software. After introducing this development concept, there was a need for an automated rebuild and class test application, that runs daily during night-time, when all systems are executable again after a working day. Running those public tests motivates the team and supports confidence in a system. This is realised by our automated Rebuild and Black/White Box Test Application (RebBoT). It is automatically started (e.g.) during night-time and searches for new or updated classes, which are then send to a design by contract pre-processor. The resulting files are instrumented with design by contract and have the ability for assertion checking during runtime. Correctly instrumented classes become instantiated. Their test routines are called and collected contract violations are fed into a product management server (PMS) database. The database stores error messages against the name of the owner or author of a class. This happens in order to assign responsibility and to gain commitment of all team members in the sense of total quality management. The next working day, every developer finds his contract violations listed in the PMS database. Development now has the possibility to evaluate priority, severity and the actual state of rework for each problem. So, a consistent view that describes the current state of quality is created. 7

8 For quality and product management this database view is to detailed. Therefore we set up a second application that generates reports of the stored data. Three tables are offered in the intranet of the company: One table shows the quantity of problems for every product aggregated by their state of rework and severity. A second one displays the quantity of announced problems for each component sorted by their state (See screenshot 1). And a last table gives detailed information about every single problem. Screenshot 1: this table gives an overview of failure quantities vertically sorted by component and horizontally sorted by current state from open to release 5 - Experiences with our model During the experiment with a development team of the nova data AG, we first tried to implement design by contract in classes of an existing system. A two days task force of three developers should manage to instrument 150 classes by applying our concept. At first, we took the class model of an existing system and added textual assertions to every property in order to generate new code with embedded assertions. The main weakness was the userunfriendliness of our CASE tool since the constraints were hidden in tiny text fields that did not appear in the actual diagram. As result of this phase, we discovered some badly designed classes that had to be redesigned because of assertions that were much to complex. Our development team started to be a bit more self-critical for the future. Since we added constraints to an existing system, we assumed that we could almost skip the implementation phase. But we had a lot of adjustments to maintain: the exception handling was so strict, that even contract violations would not have come through. Some correct Java constructions 8

9 (e.g. embedded classes) were not accepted by our pre-processor and we had to create workarounds. For future works we set up new programming guidelines which address all these problems. Our automated rebuild concept was criticised by the team, since they expected failures in the assertion syntax to be displayed as soon as possible. Waiting till the next working day was not acceptable for them. So, we had to construct an additional system that could be used directly during coding on a developer s workstation in order to verify the syntax of constraints. The documentation aspect of design by contract was not supported the way we assumed: tags for the used icontract pre-processor were refused by Javadoc. Despite all problems the basic idea of design by contract was accepted early by our development team. With this technique, origins of defects in the system were exactly located. Only the way to get design by contract into the source code must be improved. 6 - Conclusion and Perspective We described a new software development process for Java that is focused on the creation of correct software components. Therefore we combined the technique of design by contract with some testing aspects of Extreme Programming and implemented them in an existing process model including appropriate tool support. There is still a need to adjust the code generating CASE-Tool, since we have no way to read the generated assertions back into the model once we have changed them in the code. This produced a lack of acceptance in our development team. The pre-processors should be improved as well: interfaces to the environment on side of the preprocessor applications are not satisfactory. Providing detailed error codes which are passed back to RebBoT would lead to a clearer automated error classification on our side. Present pre-processors are still far away from the current OCL standard, so a powerful assertion syntax is not yet available. In addition, the used icontract pre-processor, did not accept all constructions that are allowed in Java syntax. The improvement of software documentation was not as good as expected, since assertions for the icontract pre-processor could not be displayed with Javadoc. For further works we suggest to take the tracked quantity of contract violations as a basis for new software quality metrics. The number of occurring errors per class should be set into relation to existing complexity metrics for object-oriented design like suggested by Chidamber and Kemerer [3] for instance. Without any relation to complexity, error quantities are meaningless for management, since they have a lack of insight into software codes. In another step should be explored whether a global minimum quantity of errors exists for every development team that is dependent on the complexity. Interpreting the relationship of occurring errors in inter-software communication to metrics that describe depth of inheritance, etc. could then serve as an individual team guideline for development. Using design by contract the way we suggested could help to manage the software process through all development steps. This will decrease costs and increase quality. As result trusted components for an acceptable price can be produced. Such trusted components are a basis for reuse: No reuse without trust and no excellence in development time without reuse. 7 - References [1] Bartetzko, Detlef; Fischer, Clemens: The Jass page ; Oldenburg.de/~jass [2] Beck, Kent: Extreme programming explained ; Addison Wesley Longman, Reading Massachusetts 1999 [3] Chidamber, Shyam; Kemerer, Chris: A Metrics Suite for Object Oriented Design ; IEEE Transaction on Software Engineering, Edition 20, No. 6; June 1994 [4] Duncan, Anrew, Hölzle, Urs: Adding Contracats to Java with Handshake ; Technical Report TRCS98-32, Departement of Computer Science University of California, Santa Barbara, TRs/TRCS98-32.html [5] Karaorman, Murat; Hölzle, Urs; Bruno, John: jcontractor: A Reflective Java Library to Support Design by Contract ; Technical Report TRCS98-31, Departement of Computer Science University of California, Santa Barbara, TRs/TRCS98-31.html 9

10 [6] Kramer, Reto: icontract The Java Design by Contract Tool, Proceedings 26 th TOOLS 1998, S , Santa Barbara California [7] Meyer, Bertrand: Object-Oriented Software Construction, 2 nd edition, Prentice Hall PTR, New Jersey, 1997 [8] Meyer, Bertrand; Mandrioli, Dino: Advances in object-oriented Software Engineering, Prentice Hall, New York,

UC Santa Barbara. CS189A - Capstone. Christopher Kruegel Department of Computer Science UC Santa Barbara

UC Santa Barbara. CS189A - Capstone. Christopher Kruegel Department of Computer Science UC Santa Barbara CS189A - Capstone Christopher Kruegel Department of Computer Science http://www.cs.ucsb.edu/~chris/ Design by Contract Design by Contract and the language that implements the Design by Contract principles

More information

Adding Contracts to C#

Adding Contracts to C# Adding Contracts to C# Peter Lagace ABSTRACT Design by contract is a software engineering technique used to promote software reliability. In order to use design by contract the selected programming language

More information

Assertions & Design-by-Contract using JML Erik Poll University of Nijmegen

Assertions & Design-by-Contract using JML Erik Poll University of Nijmegen Assertions & Design-by-Contract using JML Erik Poll University of Nijmegen Erik Poll - JML p.1/39 Overview Assertions Design-by-Contract for Java using JML Contracts and Inheritance Tools for JML Demo

More information

Assertions. Assertions - Example

Assertions. Assertions - Example References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 11/13/2003 1 Assertions Statements about input to a routine or state of a class Have two primary roles As documentation,

More information

The Contract Pattern. Design by contract

The Contract Pattern. Design by contract The Contract Pattern Copyright 1997, Michel de Champlain Permission granted to copy for PLoP 97 Conference. All other rights reserved. Michel de Champlain Department of Computer Science University of Canterbury,

More information

2: Simple example To use icontract, Java sourcecode is annotated with three novel comment paragraph to specify class- and interface-

2: Simple example To use icontract, Java sourcecode is annotated with three novel comment paragraph to specify class- and interface- icontract { The Java TM Design by Contract TM Tool Reto Kramer kramer@acm.org Cambridge Technology Partners Abstract Until today, the explicit specication of "software contracts" by means of class invariants

More information

Design by Contract: An Overview

Design by Contract: An Overview : An Overview CSCI 5828 Michael M. Vitousek University of Colorado at Boulder michael.vitousek@colorado.edu March 21, 2012 1 / 35 Outline 1 Introduction Motivation and Introduction Simple Example Contract

More information

Object Oriented Program Correctness with OOSimL

Object Oriented Program Correctness with OOSimL Kennesaw State University DigitalCommons@Kennesaw State University Faculty Publications 12-2009 Object Oriented Program Correctness with OOSimL José M. Garrido Kennesaw State University, jgarrido@kennesaw.edu

More information

References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 10/14/2004 1

References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 10/14/2004 1 References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 10/14/2004 1 Assertions Statements about input to a routine or state of a class Have two primary roles As documentation,

More information

Design by Contract in Eiffel

Design by Contract in Eiffel Design by Contract in Eiffel 2002/04/15 ctchen@canthink.com.com.tw.tw Reference & Resource Bertrand Meyer, Object-Oriented Oriented Software Construction 2nd,, 1997, PH. Bertrand Meyer, Eiffel: The Language,,

More information

Advances in Programming Languages

Advances in Programming Languages T O Y H Advances in Programming Languages APL4: JML The Java Modeling Language David Aspinall (slides originally by Ian Stark) School of Informatics The University of Edinburgh Thursday 21 January 2010

More information

Self-checking software insert specifications about the intent of a system

Self-checking software insert specifications about the intent of a system Assertions Reading assignment A. J. Offutt, A Practical System for Mutation Testing: Help for the Common Programmer, Proceedings of the 12th International Conference on Testing Computer Software, Washington,

More information

AUTOMATED DEBUGGING IN JAVA USING OCL AND JDI *

AUTOMATED DEBUGGING IN JAVA USING OCL AND JDI * AUTOMATED DEBUGGING IN JAVA USING OCL AND JDI * David J. Murray Dale E. Parson Lehigh University Bell Labs, Lucent Technologies Bethlehem, PA 18015 Allentown, PA 18013 dama@lehigh.edu dparson@lucent.com

More information

MSO Lecture Design by Contract"

MSO Lecture Design by Contract 1 MSO Lecture Design by Contract" Wouter Swierstra (adapted by HP, AL) October 8, 2018 2 MSO SO FAR Recap Abstract Classes UP & Requirements Analysis & UML OO & GRASP principles Design Patterns (Facade,

More information

ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1

ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1 ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1 Due to CMS by Tuesday, February 14. Social networking has caused a return of the dot-com madness. You want in on the easy money, so you have decided to make

More information

Why Design by Contract! CS 619 Introduction to OO Design and Development. Design by Contract. Fall 2012

Why Design by Contract! CS 619 Introduction to OO Design and Development. Design by Contract. Fall 2012 Why Design by Contract What s the difference with Testing? CS 619 Introduction to OO Design and Development Design by Contract Fall 2012 Testing tries to diagnose (and cure) defects after the facts. Design

More information

A Practical Approach to Programming With Assertions

A Practical Approach to Programming With Assertions A Practical Approach to Programming With Assertions Ken Bell Christian-Albrechts Universität Kiel Department of Computer Science and Applied Mathematics Real-Time Systems and Embedded Systems Group July

More information

Agenda. More on the Unified Modeling Language. UML diagram types. Packages

Agenda. More on the Unified Modeling Language. UML diagram types. Packages Agenda More on the Unified Modeling Language Perdita Stevens, University of Edinburgh July 2010 And the rest... deployment diagrams, component diagrams, object diagrams, timing diagrams, etc. OCL and alternatives

More information

1: Introduction to Object (1)

1: Introduction to Object (1) 1: Introduction to Object (1) 김동원 2003.01.20 Overview (1) The progress of abstraction Smalltalk Class & Object Interface The hidden implementation Reusing the implementation Inheritance: Reusing the interface

More information

Method Description for Semla A Software Design Method with a Focus on Semantics

Method Description for Semla A Software Design Method with a Focus on Semantics Computer Science Method Description for Semla A Software Design Method with a Focus on Semantics Semla for Java, English version May 2000 Method Description for Semla A Software Design Method with a Focus

More information

Program Correctness and Efficiency. Chapter 2

Program Correctness and Efficiency. Chapter 2 Program Correctness and Efficiency Chapter 2 Chapter Objectives To understand the differences between the three categories of program errors To understand the effect of an uncaught exception and why you

More information

CSC Advanced Object Oriented Programming, Spring Specification

CSC Advanced Object Oriented Programming, Spring Specification CSC 520 - Advanced Object Oriented Programming, Spring 2018 Specification Specification A specification is an unambiguous description of the way the components of the software system should be used and

More information

Combining Design by Contract and Inference Rules of Programming Logic towards Software Reliability

Combining Design by Contract and Inference Rules of Programming Logic towards Software Reliability Combining Design by Contract and Inference Rules of Programming Logic towards Software Reliability Nuha Aldausari*, Cui Zhang and Jun Dai Department of Computer Science, California State University, Sacramento,

More information

Building Trust in Third-party Components using Component Wrappers in the.net Frameworks

Building Trust in Third-party Components using Component Wrappers in the.net Frameworks Building Trust in Third-party Components using Component Wrappers in the.net Frameworks Christine A. Mingins, Chee Y. Chan School of Computer Science and Software Engineering Monash University PO Box 197,

More information

Object-Oriented Genetic Improvement for Improved Energy Consumption in Google Guava

Object-Oriented Genetic Improvement for Improved Energy Consumption in Google Guava Object-Oriented Genetic Improvement for Improved Energy Consumption in Google Guava Nathan Burles 1, Edward Bowles 1, Alexander E. I. Brownlee 2, Zoltan A. Kocsis 2, Jerry Swan 1, Nadarajen Veerapen 2

More information

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107 A abbreviations 17 abstract class 105 abstract data types 105 abstract method 105 abstract types 105 abstraction 92, 105 access level 37 package 114 private 115 protected 115 public 115 accessors 24, 105

More information

Formale Entwicklung objektorientierter Software

Formale Entwicklung objektorientierter Software Formale Entwicklung objektorientierter Software Praktikum im Wintersemester 2008/2009 Prof. P. H. Schmitt Christian Engel, Benjamin Weiß Institut für Theoretische Informatik Universität Karlsruhe 5. November

More information

Assertions, pre/postconditions

Assertions, pre/postconditions Programming as a contract Assertions, pre/postconditions Assertions: Section 4.2 in Savitch (p. 239) Specifying what each method does q Specify it in a comment before method's header Precondition q What

More information

OOP and S-BPM an analogy observation PowerSpeech

OOP and S-BPM an analogy observation PowerSpeech OOP and an analogy observation PowerSpeech Karlsruhe, October 14th 2010 Hagen Buchwald, KIT, Institute AIFB INSTITUTE AIFB COMPLEXITY MANAGEMENT KIT University of the State of Baden-Wuerttemberg and National

More information

Chapter 1: Programming Principles

Chapter 1: Programming Principles Chapter 1: Programming Principles Object Oriented Analysis and Design Abstraction and information hiding Object oriented programming principles Unified Modeling Language Software life-cycle models Key

More information

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM Objectives Defining a wellformed method to check class invariants Using assert statements to check preconditions,

More information

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

Cover Page. The handle   holds various files of this Leiden University dissertation Cover Page The handle http://hdl.handle.net/1887/22891 holds various files of this Leiden University dissertation Author: Gouw, Stijn de Title: Combining monitoring with run-time assertion checking Issue

More information

Chapter 3 (part 3) Describing Syntax and Semantics

Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings

More information

Software Engineering

Software Engineering Software Engineering Lecture 13: Testing and Debugging Testing Peter Thiemann University of Freiburg, Germany SS 2014 Recap Recap Testing detect the presence of bugs by observing failures Recap Testing

More information

Software Specifications. CMSC 433 Programming Language Technologies and Paradigms Spring Specifications Help You Write Code

Software Specifications. CMSC 433 Programming Language Technologies and Paradigms Spring Specifications Help You Write Code Software Specifications CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Documentation Feb. 20, 2007 A specification defines the behavior of an abstraction This is the contract between

More information

Static program checking and verification

Static program checking and verification Chair of Software Engineering Software Engineering Prof. Dr. Bertrand Meyer March 2007 June 2007 Slides: Based on KSE06 With kind permission of Peter Müller Static program checking and verification Correctness

More information

UML Specification and Correction of Object-Oriented Anti-patterns

UML Specification and Correction of Object-Oriented Anti-patterns UML Specification and Correction of Object-Oriented Anti-patterns Maria Teresa Llano and Rob Pooley School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh, United Kingdom {mtl4,rjpooley}@hwacuk

More information

Software Engineering Testing and Debugging Testing

Software Engineering Testing and Debugging Testing Software Engineering Testing and Debugging Testing Prof. Dr. Peter Thiemann Universitt Freiburg 08.06.2011 Recap Testing detect the presence of bugs by observing failures Debugging find the bug causing

More information

Software Project Seminar VII: Tools of the Craft. 23 march 2006 Jevgeni Kabanov

Software Project Seminar VII: Tools of the Craft. 23 march 2006 Jevgeni Kabanov Software Project Seminar VII: Tools of the Craft 23 march 2006 Jevgeni Kabanov Administrative Info Send your troubles to tarkvaraprojekt@webmedia.ee, not to Ivo directly Next time will be an additional

More information

A comparative study of Programming by Contract and Programming with Exceptions

A comparative study of Programming by Contract and Programming with Exceptions Computer Science Jimmy Byström Leo Wentzel A comparative study of Programming by Contract and Programming with Exceptions Master s Thesis 2003:02 A comparative study of Programming by Contract and Programming

More information

SUMMARY: MODEL DRIVEN SECURITY

SUMMARY: MODEL DRIVEN SECURITY SUMMARY: MODEL DRIVEN SECURITY JAN-FILIP ZAGALAK, JZAGALAK@STUDENT.ETHZ.CH Model Driven Security: From UML Models to Access Control Infrastructres David Basin, Juergen Doser, ETH Zuerich Torsten lodderstedt,

More information

JAVA BASICS II. Example: FIFO

JAVA BASICS II. Example: FIFO JAVA BASICS II Example: FIFO To show how simple data structures are built without pointers, we ll build a doubly-linked list ListItem class has some user data first refers to that ListItem object at the

More information

Designing Robust Classes

Designing Robust Classes Designing Robust Classes Learning Goals You must be able to:! specify a robust data abstraction! implement a robust class! design robust software! use Java exceptions Specifications and Implementations

More information

Homework #1, on the class web pages later today

Homework #1, on the class web pages later today Assertions Reading assignment A. J. Offutt, A Practical System for Mutation Testing: Help for the Common Programmer, Proceedings of the 12th International Conference on Testing Computer Software, Washington,

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Introduction to Software Engineering. 5. Modeling Objects and Classes

Introduction to Software Engineering. 5. Modeling Objects and Classes Introduction to Software Engineering 5. Modeling Objects and Classes Roadmap > UML Overview > Classes, attributes and operations > UML Lines and Arrows > Parameterized Classes, Interfaces and Utilities

More information

SonarJ White Paper. Sonar stands for Software and Architecture. It is meant to support software developers and architects in their daily work.

SonarJ White Paper. Sonar stands for Software and Architecture. It is meant to support software developers and architects in their daily work. SonarJ White Paper Sonar stands for Software and Architecture. It is meant to support software developers and architects in their daily work. Software over its lifecycle needs to be changed, adapted, enhanced

More information

A Runtime Assertion Checker for the Java Modeling Language ( JML)

A Runtime Assertion Checker for the Java Modeling Language ( JML) Computer Science Technical Reports Computer Science 4-2002 A Runtime Assertion Checker for the Java Modeling Language ( JML) Yoonsik Cheon Iowa State University Gary T. Leavens Iowa State University Follow

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

JML. Outline. Métodos Formais em Engenharia de Software. MI, Braga these slides were prepared by adopting/adapting teaching material

JML. Outline. Métodos Formais em Engenharia de Software. MI, Braga these slides were prepared by adopting/adapting teaching material Métodos Formais em Engenharia de Software JML José Carlos Bacelar Almeida Departamento de Informática Universidade do Minho MI, Braga 2008 Outline Design by Contract and JML Design by Contract Java Modeling

More information

Part 5. Verification and Validation

Part 5. Verification and Validation Software Engineering Part 5. Verification and Validation - Verification and Validation - Software Testing Ver. 1.7 This lecture note is based on materials from Ian Sommerville 2006. Anyone can use this

More information

From OCL to Typed First-order Logic

From OCL to Typed First-order Logic 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 From OCL to Typed First-order Logic Copyright 2007-8 Reiner Hähnle and Cesare Tinelli. Notes originally developed by Reiner

More information

Testing and Debugging

Testing and Debugging Testing and Debugging Comp-303 : Programming Techniques Lecture 14 Alexandre Denault Computer Science McGill University Winter 2004 March 1, 2004 Lecture 14 Comp 303 : Testing and Debugging Page 1 Announcements...

More information

Software Testing. Software Testing

Software Testing. Software Testing Software Testing Software Testing Error: mistake made by the programmer/ developer Fault: a incorrect piece of code/document (i.e., bug) Failure: result of a fault Goal of software testing: Cause failures

More information

Formal Specification and Verification

Formal Specification and Verification Formal Specification and Verification Formal Specification, Part III Bernhard Beckert Adaptation of slides by Wolfgang Ahrendt Chalmers University, Gothenburg, Sweden Formal Specification and Verification:

More information

Assertion with Aspect

Assertion with Aspect Assertion with Aspect Takashi Ishio, Toshihiro Kamiya, Shinji Kusumoto, Katsuro Inoue Graduate School of Engineering Science, PRESTO, Japan Science and Technology Agency Osaka University 1-3 Machikaneyama-cho,

More information

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany Softwaretechnik Lecture 08: Testing and Debugging Overview Peter Thiemann University of Freiburg, Germany SS 2012 Literature Essential Reading Why Programs Fail: A Guide to Systematic Debugging, A Zeller

More information

A Class-Level Unit Testing Tool for Java

A Class-Level Unit Testing Tool for Java A Class-Level Unit Testing Tool for Java Tz-Fan Hu and Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University Chiayi 621, Taiwan, R.O.C. Email: {htf97m,naiwei}@cs.ccu.edu.tw

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration

More information

FreePascal changes: user documentation

FreePascal changes: user documentation FreePascal changes: user documentation Table of Contents Jochem Berndsen February 2007 1Introduction...1 2Accepted syntax...2 Declarations...2 Statements...3 Class invariants...3 3Semantics...3 Definitions,

More information

OO Technology: Properties and Limitations for Component-Based Design

OO Technology: Properties and Limitations for Component-Based Design TDDD05 Component-Based Software OO Technology: Properties and Limitations for Component-Based Design Interfaces Design by by Contract Syntactic Substitutability Inheritance Considered Harmful Fragile Base

More information

Classes, interfaces, & documentation. Review of basic building blocks

Classes, interfaces, & documentation. Review of basic building blocks Classes, interfaces, & documentation Review of basic building blocks Objects Data structures literally, storage containers for data constitute object knowledge or state Operations an object can perform

More information

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany

Softwaretechnik. Lecture 08: Testing and Debugging Overview. Peter Thiemann SS University of Freiburg, Germany Softwaretechnik Lecture 08: Testing and Debugging Overview Peter Thiemann University of Freiburg, Germany SS 2012 Literature Essential Reading Why Programs Fail: A Guide to Systematic Debugging, A Zeller

More information

The Lorax Programming Language

The Lorax Programming Language The Lorax Programming Language Doug Bienstock, Chris D Angelo, Zhaarn Maheswaran, Tim Paine, and Kira Whitehouse dmb2168, cd2665, zsm2103, tkp2108, kbw2116 Programming Translators and Languages, Department

More information

EXAMINATIONS 2009 MID-TERM TEST. COMP 202 / SWEN 202 Formal Methods of Computer Science / Formal Foundations of Software Engineering WITH ANSWERS

EXAMINATIONS 2009 MID-TERM TEST. COMP 202 / SWEN 202 Formal Methods of Computer Science / Formal Foundations of Software Engineering WITH ANSWERS T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Time Allowed: 90 minutes EXAMINATIONS 2009 MID-TERM TEST COMP 202 / SWEN 202 Formal Methods

More information

Advances in Programming Languages

Advances in Programming Languages Advances in Programming Languages Lecture 12: Practical Tools for Java Correctness Ian Stark School of Informatics The University of Edinburgh Friday 31 November 2014 Semester 1 Week 7 http://www.inf.ed.ac.uk/teaching/courses/apl

More information

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015 xtreme Programming (summary of Kent Beck s XP book) 1 Contents The software development problem The XP solution The JUnit testing framework 2 The Software Development Problem 3 Risk Examples delivery schedule

More information

Introduction to JML David Cok, Joe Kiniry, and Erik Poll Eastman Kodak Company, University College Dublin, and Radboud University Nijmegen

Introduction to JML David Cok, Joe Kiniry, and Erik Poll Eastman Kodak Company, University College Dublin, and Radboud University Nijmegen Introduction to JML David Cok, Joe Kiniry, and Erik Poll Eastman Kodak Company, University College Dublin, and Radboud University Nijmegen David Cok, Joe Kiniry & Erik Poll - ESC/Java2 & JML Tutorial p.1/30

More information

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Lecture 04 Software Test Automation: JUnit as an example

More information

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM CS 215 Software Design Homework 3 Due: February 28, 11:30 PM Objectives Specifying and checking class invariants Writing an abstract class Writing an immutable class Background Polynomials are a common

More information

Eiffel: Analysis, Design and Programming. ETH Zurich, September-December Exception handling

Eiffel: Analysis, Design and Programming. ETH Zurich, September-December Exception handling Eiffel: Analysis, Design and Programming ETH Zurich, September-December 2008-6- Exception handling What is an exception? An abnormal event Not a very precise definition Informally: something that you don

More information

OCL EXCEPTION HANDLING. A Thesis PRAMOD GURUNATH

OCL EXCEPTION HANDLING. A Thesis PRAMOD GURUNATH OCL EXCEPTION HANDLING A Thesis by PRAMOD GURUNATH Submitted to the Office of Graduate Studies of Texas A&M University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE August

More information

Automatic Black-Box Method-Level Test Case Generation Based on Constraint Logic Programming

Automatic Black-Box Method-Level Test Case Generation Based on Constraint Logic Programming Automatic Black-Box Method-Level Test Case Generation Based on Constraint Logic Programming i-tin Hu and ai-wei Lin Department of Computer Science and Information Engineering ational Chung Cheng University

More information

Formal Methods for Java

Formal Methods for Java Formal Methods for Java Lecture 1: Introduction Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg October 26, 2011 Jochen Hoenicke (Software Engineering) Formal Methods for Java October

More information

Universe Type System for Eiffel. Annetta Schaad

Universe Type System for Eiffel. Annetta Schaad Universe Type System for Eiffel Annetta Schaad Semester Project Report Software Component Technology Group Department of Computer Science ETH Zurich http://sct.inf.ethz.ch/ SS 2006 Supervised by: Dipl.-Ing.

More information

The following topics will be covered in this course (not necessarily in this order).

The following topics will be covered in this course (not necessarily in this order). The following topics will be covered in this course (not necessarily in this order). Introduction The course focuses on systematic design of larger object-oriented programs. We will introduce the appropriate

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 15: Object-Oriented Principles 1 Open Closed Principle (OCP) Classes should be open for extension but closed for modification. OCP states that we should

More information

Java-MOP: A Monitoring Oriented Programming Environment for Java

Java-MOP: A Monitoring Oriented Programming Environment for Java Java-MOP: A Monitoring Oriented Programming Environment for Java Feng Chen and Grigore Roşu Department of Computer Science, University of Illinois at Urbana - Champaign, USA {fengchen, grosu}@uiuc.edu

More information

Javadoc. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 7

Javadoc. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 7 Javadoc Computer Science and Engineering College of Engineering The Ohio State University Lecture 7 Motivation Over the lifetime of a project, it is easy for documentation and implementation to diverge

More information

4 CoffeeStrainer Virtues and Limitations

4 CoffeeStrainer Virtues and Limitations In this chapter, we explain CoffeeStrainer s virtues and limitations and the design decisions that led to them. To illustrate the points we want to make, we contrast CoffeeStrainer with a hypothetical,

More information

Motivation. Correct and maintainable software Cost effective software production Implicit assumptions easily broken

Motivation. Correct and maintainable software Cost effective software production Implicit assumptions easily broken Spec# Andreas Vida Motivation Correct and maintainable software Cost effective software production Implicit assumptions easily broken Need more formal f specification Integration into a popular language

More information

n Specifying what each method does q Specify it in a comment before method's header n Precondition q Caller obligation n Postcondition

n Specifying what each method does q Specify it in a comment before method's header n Precondition q Caller obligation n Postcondition Programming as a contract Assertions, pre/postconditions and invariants Assertions: Section 4.2 in Savitch (p. 239) Loop invariants: Section 4.5 in Rosen Specifying what each method does q Specify it in

More information

CSE 307: Principles of Programming Languages

CSE 307: Principles of Programming Languages CSE 307: Principles of Programming Languages Advanced Topics R. Sekar Topics 1 / 14 1. 2 / 14 Section 1 3 / 14 Semantics of Programs Syntax defines what programs are valid. Semantics defines what the valid

More information

Orthographic Software Modeling A Practical Approach to View Based Development

Orthographic Software Modeling A Practical Approach to View Based Development Orthographic Software Modeling A Practical Approach to View Based Development Colin Atkinson University of Mannheim Germany MSI 2009 7 th October 2009 Oldenburg Outline Modern software engineering paradigms

More information

Code Contracts. Pavel Parízek. CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics

Code Contracts. Pavel Parízek.   CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Code Contracts http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Pavel Parízek Code Contracts 2 Assertions Typically used as internal checks in the program

More information

OCL Support in MOF Repositories

OCL Support in MOF Repositories OCL Support in MOF Repositories Joachim Hoessler, Michael Soden Department of Computer Science Technical University Berlin hoessler@cs.tu-berlin.de, soden@cs.tu-berlin.de Abstract From metamodels that

More information

OO Design Principles

OO Design Principles OO Design Principles Software Architecture VO (706.706) Roman Kern Institute for Interactive Systems and Data Science, TU Graz 2018-10-10 Roman Kern (ISDS, TU Graz) OO Design Principles 2018-10-10 1 /

More information

A FLEXIBLE STRATEGY FOR EMBEDDING AND CONFIGURING RUN- TIME CONTRACT CHECKS IN.NET COMPONENTS

A FLEXIBLE STRATEGY FOR EMBEDDING AND CONFIGURING RUN- TIME CONTRACT CHECKS IN.NET COMPONENTS International Journal of Software Engineering and Knowledge Engineering World Scientific Publishing Company A FLEXIBLE STRATEGY FOR EMBEDDING AND CONFIGURING RUN- TIME CONTRACT CHECKS IN.NET COMPONENTS

More information

BCS Higher Education Qualifications. Diploma in IT. Object Oriented Programming Syllabus

BCS Higher Education Qualifications. Diploma in IT. Object Oriented Programming Syllabus BCS Higher Education Qualifications Diploma in IT Object Oriented Programming Syllabus Version 3.0 December 2016 This is a United Kingdom government regulated qualification which is administered and approved

More information

17. Assertions. Outline. Built-in tests. Built-in tests 3/29/11. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen

17. Assertions. Outline. Built-in tests. Built-in tests 3/29/11. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen 17. Assertions Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen Outline Introduction (BIT, assertion, executable assertion, why?) Implementation-based vs responsability-based assertions Implementation

More information

Another Mediocre Assertion Mechanism for C++

Another Mediocre Assertion Mechanism for C++ Another Mediocre Assertion Mechanism for C++ Pedro Guerreiro Departamento de Informática Faculdade de Ciências e Tecnologia Universidade Nova de Lisboa P-2825-114 Caparica, Portugal pg@di.fct.unl.pt Copyright

More information

USE CASE BASED REQUIREMENTS VERIFICATION

USE CASE BASED REQUIREMENTS VERIFICATION USE CASE BASED REQUIREMENTS VERIFICATION Verifying the consistency between use cases and assertions Stéphane S. Somé, Divya K. Nair School of Information Technology and Engineering (SITE), University of

More information

CITS5501 Software Testing and Quality Assurance Formal methods

CITS5501 Software Testing and Quality Assurance Formal methods CITS5501 Software Testing and Quality Assurance Formal methods Unit coordinator: Arran Stewart May 1, 2018 1 / 49 Sources Pressman, R., Software Engineering: A Practitioner s Approach, McGraw-Hill, 2005

More information

Patterns for polymorphic operations

Patterns for polymorphic operations Patterns for polymorphic operations Three small object structural patterns for dealing with polymorphism Alexander A. Horoshilov hor@epsylontech.com Abstract Polymorphism is one of the main elements of

More information

Chapter 1: Principles of Programming and Software Engineering

Chapter 1: Principles of Programming and Software Engineering Chapter 1: Principles of Programming and Software Engineering Data Abstraction & Problem Solving with C++ Fifth Edition by Frank M. Carrano Software Engineering and Object-Oriented Design Coding without

More information

17. Assertions. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen

17. Assertions. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen 17. Assertions Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen Outline Introduction (BIT, assertion, executable assertion, why?) Implementation-based vs responsability-based assertions Implementation

More information

Formal Verification for safety critical requirements From Unit-Test to HIL

Formal Verification for safety critical requirements From Unit-Test to HIL Formal Verification for safety critical requirements From Unit-Test to HIL Markus Gros Director Product Sales Europe & North America BTC Embedded Systems AG Berlin, Germany markus.gros@btc-es.de Hans Jürgen

More information

1: Specifying Requirements with Use Case Diagrams

1: Specifying Requirements with Use Case Diagrams Outline UML Design Supplement 1: Specifying Requirements with Use Case Diagrams Introduction Use Case Diagrams Writing Use Cases Guidelines for Effective Use Cases Slide adapted from Eran Toch s lecture

More information

JML tool-supported specification for Java Erik Poll Radboud University Nijmegen

JML tool-supported specification for Java Erik Poll Radboud University Nijmegen JML tool-supported specification for Java Erik Poll Radboud University Nijmegen Erik Poll - JML p.1/41 Overview The specification language JML Tools for JML, in particular runtime assertion checking using

More information

Specification tips and pitfalls

Specification tips and pitfalls Specification tips and pitfalls David Cok, Joe Kiniry, and Erik Poll Eastman Kodak Company, University College Dublin, and Radboud University Nijmegen David Cok, Joe Kiniry & Erik Poll - ESC/Java2 & JML

More information