Błaej Pietrzak Goal. Two approaches. Process. If we limit testing to method scope

Size: px
Start display at page:

Download "Błaej Pietrzak Goal. Two approaches. Process. If we limit testing to method scope"

Transcription

1 Błaej Pietrzak Class scope integration Design by Contract Invariant Boundaries pattern Non-modal class pattern FREE state model Quasi-modal class pattern Modal class pattern If we limit testing to method scope Easily miss faults related to intraclass usages Method interactions are a common source of faults Side effects and fault masking are sources of error Eercising methods in various sequences is necessary to reveal intraclass bugs Goal Demonstrate that class under test is ready to test Two approaches Small pop Alpha-Omega cycle A Big Bang integration at class level Ecersise all untrusted components simultaneously Effective when CUT is small and simple Servers of the class are stable Inherited features are stable Few intraclass dependencies eist Process Develop entire class Write a test driver using any appropriate test pattern Run the test suite Debug as needed 1

2 Alpha-Omega States: Alpha State: object before it is constructed Omega State: object after it has been deleted Alpha-Omega Cycle: Take an object from alpha to omega Send a message to every method at least once Shows that class is ready for more etensive testing No attempt is made to achieve any coverage Order of calling methods: Constructor method Accessor method Boolean (predicate/is) method Modifier (set) method Iterator method Destructor method Order within steps: private, protected, public Precondition Conditions that must hold before a method can eecute Client class must fulfill precondition Postcondition Specify conditions that must hold after a method completes Server class must fulfill postcondition Class invariant Specifies a condition that must hold anytime a client class could invoke an object s method Must be true on entry and eit of public methods Constructor Before: check class precondition After: check class invariant, check constructor postcondition Destructor Before: check class invariant, check destructor precondition After: check destructor postcondition Method Before: check class invariant, check method precondition After: check method postcondition, check class invariant! " Contracts are inherited Subclass must fulfill its superclass s public type contract Require no more ensure no less! Inheritance rules Subclass may keep or strengthen the class invariant Subclass may keep or weaken the precondition Subclass may keep or strengthen the postcondition Intent Select test-efficient test value combinations for classes, interfaces, and components composed of comple and primitive data types Contet The valid and invalid combinations of instance variable values may be specified by the class invariant The class invariant typically refers to instance variables that are instances of primitive and comple data type The Invariant Boundaries pattern does not consider input/output relationship or message sequence

3 Fault Model Bugs in implementation of constraints needed to define and enforce a domain formed by several comple boundaries Subclass invariants are often implicit or accidental, leading to misinterpretation and misuse Strategy 1. Develop the class invariant. Develop on points and off points for each condition in the invariant using Develop in points for variables not referenced in a condition. Represent the results in a domain matri Entry Criteria The class invariant eists or can be created test suite s entry criteria designed with another pattern must be fulfilled Eit Criteria A complete set of domain tests has been developed Consequences The class invariant development is difficult and time consuming After the class invariant is developed test suite creation is fast The number of test cases grows linearly with the number of conditions in the invariant class ClientProfile { Account account = new Account(); Money creditlimit = new Money(); short trcounter; Account abstract states: Opened, Closed, Idle, Locked, Debit creditlimit is in range ± creditlimit >= trcounter * trcounter must be >= 0 and <= 5000 Define Class Invariant assert (trcounter >= 0) && (trcounter <= 5000) && (creditlimit>= trcounter * ) &&!account.isclosed()); Develop on points and off points Condition trcounter >= 0 trcounter <= 5000 creditlimit >= trcounter * !account.isClosed() On point Opened Off point Closed Develop on points and off points cont. creditlimit min = (0 * 100) = creditlimit ma = (5000 * 100) = trcounter central = ( ) / = 500 creditlimit central = (500 * 100) = creditlimit off = creditlimit central =

4 Variable trcounter creditlimit Account Represent the results in a domain matri Constraint Test case Condition >= 0 <= 5000 Typical >= trcounter * Typical!isClosed() Typical Point On Off On Off In On Off In On Off In open ,99 open debit Lockd idle 8..1 open open closed Represent the results in a domain matri cont. Each test case has only one on or off-point Select in-points for all other values in the test case Avoid to repeat in points (increase chance of finding bugs) Accept any message in any state No domain state constraint No message sequence constraint Classes that implement basic data types are often nonmodal i.e. Time class Time { private int hh, mm, ss; public Time(int hh, int mm, int ss) { public void sethour(int value) { public void getsecond() { public boolean equals(time t) { public Time subtract(time t) { Only one abstract state (any possible time) and many concrete states (e.g. 3:00:01, 1:15:9 etc.) Any possible message can accur after any possible message with eception for constructor and destructor No domain state constraint Message sequence constraint Classes that are application controllers are usually unimodal Eample: traffic lights turnonredlight can only be accepted after turnonyellowlight turnongreenlight only after turnonred, turnonyellowlight Imposes sequential constraints on message acceptance that change with the contents of the object Many container and collection classes are quasi-modal e.g. Stack Behaves like modal class, but message sequence constraints are implicitly connected with the contents of the object i.e. stack - size determines whether stack is full, empty, or loaded. It doesn t matter what are the contents of the stack or in what order. Test model is focused on parameters describing the contents i.e. stack size In modal class the contents control the behavior directly

5 Domain state constraint Message sequence constraint Eample Account class Account { private Money saldo; private int accountnumber; private Date lastoperation; public void open() { public Money getsaldo() { public void credit(money creditamount) { public void debit(money debitamount) { public void lock() { public void unlock() { public void regulate() { public void close() { If [saldo == 0] then close() If close() was invoked it cannot accept close() Intent Develop a class scope test suite for a class that does not constrain message sequences Contet Nonmodal class imposes few constraints on message sequence but usually has a comple state space and a comple interface Few or no message sequences are illegal; most message sequences are legal Fault Model Sequential constraints on messages are not imposed so the state control model is trivial State-based testing (see Modal Class Test) is inappropriate Allowed sequence is rejected Allowed sequence produces bad value Methods reporting about abstract state are inconsistent Allowed modifier sequence is rejected Not allowed modifier s argument is accepted resulting in corrupted state Accessor method has incorrect side effect, which changes or corrupts object state Not allowed calculation violates class invariant Some modifier or accessor methods cause inconsistent abstract state view Strategy 1. Develop a set of test cases using Invariant Boundaries pattern. Select a message sequence strategy: define-use (setters and getters), random (setters and getters in random order), or suspect (only suspected combinations of setters and getters) 3. Set the Object Under Test to a test case from the domain matri. Send all the accessor messages 5. Verify that the returned and resulting values are consistent. Repeat until all sequences have been eercised Basic test strategy 1. To set the Object Under Test to a test vector value with a modifier (set, constructor). Verify that modifier has produced a correct state 3. Try each accessor (get) to see that it reports the state correctly without buggy side effect 5

6 Entry Criteria Alpha omega cycle Eit Criteria Object Under Test has taken values of each test case at least once Achieve at least branch coverage on each method in the Class Under Test Consequences The number of tests is m n+1 where m is the number of methods in CUT, n is a number of modifier accessor pairs typically n = public void testtime1() { Time temp = new Time(0,, 9); assert(0, temp.gethour()); assert(, temp.getminute()); assert(9, temp.getsecond()); public void testtime() { time.setminute(); time.sethour(0); time.setsecond(9); assert(0, temp.gethour()); assert(9, temp.getsecond()); assert(, temp.getminute()); public void testtime3() { try { Time temp = new Time(-1,, 8); fail(); catch (SomeEception e) { A system model composed of events (inputs), states and actions (outputs): Output is determined by both current input and past inputs An information concerning past inputs is represented by states Robert V. Binder: Testing Object-Oriented Systems. Models, Patterns and Tools, Addison-Wesley 000 State The Information concerning past inputs Initial State first event is accepted, not need to be entered by a transition Transition An allowable two-state sequence Final State stop accepting events Accepting state Resulting state Machine may be in only one state at a time

7 Event An input or interval of time Action The result or output that follows an event A transition may have an output action Any output action may be used in more than one transition No output action is associated with state, state is passive Incomplete Specification Equivalent (A minimal state machine) Reachability analysis Nonreachable states Dead state no paths lead out of a dead state Dead loop no states outside of the loop may be reached Magic state has no inbound transition but provides transitions to other states A guarded transition cannot fire unless The system is in accepting state for this transition The guarded event occurs The guarded predicate evaluates to true A transition without an eplicit guard: [TRUE] An event not accepted in a certain state: [FALSE] Event-name arg-list [ guard-condition ] / action-epression Not specific for object oriented systems An OO interpretation of generic events, actions and states is needed Limited scalability Up to 0 states on diagram is readable Basic state models do not scale well No Partitioning, hierarchic abstraction If.. else, switch statements Many design patterns in GOF collection: State, Chain of Responsibility, Interpreter, Mediator Other patterns Concurrency cannot be modeled The basic model cannot accomodate two or more simultaneous transition concurrency 7

8 Complete and accurate reflection of implementations to be tested Preserve details essential to fault detection and conformance demonstration Represents all events to the IUT must respond Represents all actions Unambiguous and testable definition of state in a way that checking the resulting state can be automated Flattened Regular Epression (FREE) state model The class under test is flattened to represent the behavior of inherited features Behavior using definitions of state, event, and action that support the development of effective test suites Can be epressed using the UML Object state at method activation and deactivation is the focus of the FREE state model Object state is observable Hybrids are not welcome! Use only one representation (e.g. Mealy machine) Transition is a unique combination of State invariants An associated event Optional guard epressions Event is either A message sent to the class under test A response received from a server of the class under test An interrupt or similar eternal control action that must be accepted by the CUT Guard is A predicate epression associated with an event Action is either A message sent to a server object The response provided by an object of the class under test to its client The (alpha) state A null state representing the declaration for an object before its construction Differs from an initial state An alpha transition The (omega) state It is reached after an object has been destructed or deleted, or has gone out of scope It may differ from an eplicitly modeled final state It is reached by eplicit or implicit destructors 8

9 # %$ &'$ )(* + To obtain the model for subclasses, the class hierarchy is flattened The flattened transition diagram shows the complete behavior of the class under test. Class flattening is not always necessary: When only test within subclass boundaries without checking inherited properties Not enough information about superclass Lack of time May mean that implicit transition is illegal, ignored, or impossible May also be a specification omission An illegal event is an otherwise valid event(message) that should not be accepted given the current state of the UIT A sneak path is the bug that allows an illegal transition or eludes a guard Complete behavior testing should eercise both eplicit and implicit behavior Events and guards constructor Event 1 Event = 0 Event 3 i <= 1000 NI Accepting state epected output A B C Events and guards Accepting state epected output Events and guards Accepting state epected output A B C A B C Event i!= k < ma Event 5 j > 10 k = ma isreset() Ture 9

10 Events and guards destructor don t care ecluded - eplicit transition Accepting state epected output A B C Resp. code Response codes for illegal states Name Acceptance Queue Ignored Marker Rejection Silence Damage stopping Response Eecute eplicit transition Place illegal event in queue for calculation and omitting Do nothing Return non-zero error code Throw IllegalEventEception Turn off the source of event Go to damage stopping routine (e.g. Memory dump) and stop the process An appropriate error message or eception should be produced The abstract state of the object should remain unchanged after rejecting the illegal event Prefer defensive school easier to test 1. Create a testable state model (e.g. FREE state model). Validate state model Structure State names Guarded transitions Well-formed subclass behavior Robustness Strategies: Ehaustive preffered N+ strategy preffered Number of tests about k n /, where k is states no., n is events no. All transitions minimum at least once all states, all events, and all actions Although detects bad or omitted event-action pairs, it cannot be proved that bad state occured. If state machine is incomplete cannot detect sneak paths Number of tests = k n, where k is states no., n is events no. Piecewise (pol. sztukowanie) not recommended Advanced state-based testing UML state models Testing considerations unique to OO implementations It uses a flattened state model All implicit transitions are ecersised to reveal sneak paths The implementation must have a trusted ability to report the resultant state 10

11 1. Develop a testable (e.g. FREE) model of the implementation under test Validate the model using the checklists Epand the statechart Develop a response matri. Generate the round-trip path test cases 3. Generate the sneak path test cases. Sensitize the transitions in each test case FREE model of the implementation under test Flattened transition diagram Response matri FREE state model -> Transition tree Initial state or alpha state (if eists) is a root of the tree. Check the state of every not-final node leaf in the tree and every transition going from that state. For each transition create at least one edge. Each new edge and node represent an event and resulting state reached by outgoing transition:. a) If not guarded condition create one new branch. b) If guard is a simple predicate or composed of only AND operators create one new branch. c) If guard is composed predicate or with OR operators then create new branch for each combination of values that make guard = true.. d) If guard defines dependency that is reached after repetition of some event (e.g. [counter >= 10]) then the test sequence demands at least that number of repetitions. The transition is marked with * 3. For each edge and node from step : 1. Note event, guard and action. If the state represented by new node is already represented in another node (anywhere on diagram) or is ending state then mark this node as ending node don t make new transitions from it. Transition tree -> Conformance test suite Response matri -> Sneak path test suite 11

12 Path sensitization is the process of determining argument and instance variable values that will cause a particular path to be taken. Paths that cannot be eecuted. Short circuit evaluation and comple predicate epressions Contradictory or mutually eclusive conditions,e.g. >1&&<-1 Mutually eclusive, redundant predicates, if (==0) if (!=0). Unstructured code that include upward-branching gotos or branches that enter or eit a loop body without first activating the loop control. Dead code. This should never happen impossible conditions. Intent Develop a class scope test suite for a class whose constraints on message sequence change with the state of the class Contet A quasi-modal class has sequential constraints that reflect the organization of information used by the class Container and collection classes are often quasi-modal Effective testing must distinguish between content that determines behavior and content that does not affect behavior Fault Model Quasi modal class failures occur When invariants related to all members of a collection are not observed Strategy 1. Create N+ state model test suite Use N+ test strategy Model constraint parameters as states Develop test data using invariant boundaries. Run class specific operation-pairs Strategy detailed 1. Develop FREE state model. Characterize state with constraint params not content. Treat each constraint param as state variable.. Generate transition tree. 3. Tabulate events and actions along each path.. Develop test data for each path using Invariant Boundaries pattern for events, messages and actions. 5. Eecute conformance test suite until all tests pass.. Develop sneak path test suite. Add all forbidden transitions in all states and define eception to be thrown. 7. Eecute sneak path test suite until all tests pass. 8. Run class specific operation-pairs. Entry Criteria Alpha omega cycle Eit Criteria Achieve at least branch coverage on each method Provide N+ coverage Optionally develop a class flow graph Identify uncovered alpha-omega paths Ecersise those paths Consequences Testable behavior model is available or can be developed CUT is state observable we have trustworthy built-in tests or feasible access to the CUT so we can determine the resultant state of each test run 1

13 class MyList { protected int size; final public static int MA = 1000; protected List list = new Vector(); public void add(object obj) throws DuplicateEception { public void remove(object obj) { public Object get(int id) { Class Invariant (not content) size >= 0 && size <= MA Transition tree remove()[ size == 1 ] new Empty add() Loaded remove()[size>1]* get() add()[size<ma-1]* add()[size=ma-1] remove() Full get() Empty Loaded Loaded Loaded Loaded Full Conformance test suite public void assertempty() { assert(mylist.isempty()); assert(mylist.isloaded()); assert(mylist.isfull()); public void testalphaemptyloadedempty() { MyList mylist = new MyList(); assertempty(); mylist.add(new Object()); assert(mylist.isloaded()); assert(mylist.isempty()); assert(mylist.isfull()); assertequals(1, mylist.size()); mylist.remove(obj); assertempty(); Response matri for add (not all guards are shown) Events and guards for size add() < 0 = 0 < ma - 1 = ma - 1 > ma - 1 Accepting state epected output Empty 0 Loaded don t care ecluded 0 Acceptance - eecute transition - eplicit transition (specified on state chart) Rejection - throw IllegalEventEception Full Invariant Boundaries for add Condition size < 0 size = 0 size < ma 1 size = ma 1 size > ma 1 On point 0 0 ma 1 ma 1 ma 1 Off point -1-1, 1 ma ma, ma ma 13

14 Sneak path test suite public void testcorruptedempty() { assertempty(); mylist.size = MA ; try { mylist.add(new Object()); fail(); catch (Eception e) { assertempty(); public void testcorruptedfull() { // make a full list assertfull(); mylist.size = MA ; try { mylist.add(new Object()); fail(); catch (Eception e) { assertfull(); public void testaddduplicate() { assertequals(, y); mylist.add(); // check state try { mylist.add(y); fail(); catch (DuplicateEception e){ Run class specific operation-pairs // check state public void testaddremove() { Object elem = new Object(); mylist.add(elem); // check state mylist.remove(elem); assertequals(0, mylist.size()); assert(mylist.contains(elem)); // check state Intent Develop a class scope test suite for a class that has fied constraints on message sequence Contet A modal class has both message and domain constraints on the acceptable sequence of messages Interactions between message sequences and state are often subtle and comple, therefore error prone Fault Model Omited transition message is rejected in allowed state Incorrect action bad response is chosen, although the state and method used were correctly accepted Resulting state is not allowed method develops a bad state in a transition Corrupt state is developed Sneak path allows to accept the message although it should be rejected Strategy 1. Create FREE state model. Generate transition tree 3. Equip the transition tree with full eplication of conditional transition cases. Tabulate events and actions along each path 5. Develop test data for paths use Invariant Boundaries for message events and actions. Develop Conformance tests until all tests pass 7. Develop Sneak path test suite until all tests pass 8. Event Path Sensitization Entry Criteria Alpha omega cycle If critical method/scope functions eist, they should be tested before running the modal because lead-node cannot be reached until all the predecessor tests have passed Eit Criteria Achieve branch coverage on each method in the Class Under Test A full modal class suite provides N+ coverage A higher level of confidence can be obtained by developing a class flow graph to identify and any uncovered alpha-omega paths 1

15 Consequences A testable behavior model is available or can be developed The Class Under Test is state-observable Robert V. Binder: Testowanie systemów obiektowych. Modele wzorce i narzdzia. WNT 003 Jtest - Automatic test generator (commercial) =Jtest&itemId=1 Jcontract Design by Contract in Java (commercial) =Jcontract&itemId=8 Icontract Design by Contract in Java Assertion Definition Language JML Specs Thank You for your attention What is your general impression (1-) Was it too slow or too fast? What important did you learn during the lecture? What to improve and how? 15

Motivation State Machines

Motivation State Machines Motivation State Machines Generating test cases for complex behaviour Textbook Reading: Chapter 7 We are interested in testing the behaviour of object-oriented software systems Behaviour: Interactions

More information

Class Modality. Modality Types. Modality Types. Class Scope Test Design Patterns

Class Modality. Modality Types. Modality Types. Class Scope Test Design Patterns Class Scope Test Design Patterns Testing methods in isolation is not enough Instance variables act like global variables within a class Need to test intraclass interactions Message sequences Class Modality

More information

Błaej Pietrzak

Błaej Pietrzak Błaej Pietrzak blazej.pietrzak@cs.put.poznan.pl Fault model Result-oriented testing Test design approach Domain testing model Category-Partition test pattern Polymorphic message test pattern 1 Exhaustive

More information

State-Based Testing Part B Error Identification. Generating test cases for complex behaviour

State-Based Testing Part B Error Identification. Generating test cases for complex behaviour State-Based Testing Part B Error Identification Generating test cases for complex behaviour Reference: Robert V. Binder Testing Object-Oriented Systems: Models, Patterns, and Tools Addison-Wesley, 2000,

More information

door Sasa Berberovic

door Sasa Berberovic door Sasa Berberovic Overview Reusable Components Subsystems Reusable Components Reuse Mechanisms The Role of Testing in Reuse Reusing Test Suites Test Design Patterns Abstract Class Test Generic Class

More information

Testing Object-Oriented Software. 22 November 2017

Testing Object-Oriented Software. 22 November 2017 Testing Object-Oriented Software 22 November 2017 Testing Object-Oriented Software 2 Problems in object-oriented testing [Binder] Each level in the class hierarchy creates a new context for inherited features:

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

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

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

Software Testing. 2. Models. 2. Models. Testing Approaches. Why Models? (in Testing) (Based on Part II: Models of Testing Object-Oriented Systems)

Software Testing. 2. Models. 2. Models. Testing Approaches. Why Models? (in Testing) (Based on Part II: Models of Testing Object-Oriented Systems) 2. Models (Based on Part II: Models of Testing Object-Oriented Systems) Software Testing 2. Models Models - Why? What? How? Combinational Models - Decision Tables: What? How? - Test Generation State Machines

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

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

Software Testing. 2. Models. 2. Models. Testing Approaches. Why Models? (in Testing) (Based on Part II: Models of Testing Object-Oriented Systems)

Software Testing. 2. Models. 2. Models. Testing Approaches. Why Models? (in Testing) (Based on Part II: Models of Testing Object-Oriented Systems) 2. Models (Based on Part II: Models of Testing Object-Oriented Systems) Software Testing 2. Models Models Why? What? How? Combinational Models Decision Tables: What? How? Test Generation State Machines

More information

Regression testing. Whenever you find a bug. Why is this a good idea?

Regression testing. Whenever you find a bug. Why is this a good idea? Regression testing Whenever you find a bug Reproduce it (before you fix it!) Store input that elicited that bug Store correct output Put into test suite Then, fix it and verify the fix Why is this a good

More information

Integration Testing Qualidade de Software 2

Integration Testing Qualidade de Software 2 Integration Testing Integration Testing Software systems are built with components that must interoperate Primary purpose: To reveal component interoperability faults so that testing at system scope may

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

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

What is software testing? Software testing is designing, executing and evaluating test cases in order to detect faults.

What is software testing? Software testing is designing, executing and evaluating test cases in order to detect faults. ϖοιδ τεσταδδανδχουντ() { ασσερ τεθυαλσ(1, ο.αδδανδχουντ(νεω ΑρραψΛιστ()); ϖοιδ τεσταδδανδχουντ() { ασσερ τεθυαλσ(1, ο.αδδανδχουντ(νεω ΑρραψΛιστ()); ιντ αδδανδχουντ(λιστ λιστ) { ρετυρν λιστ.σιζε(); ιντ

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

Fortgeschrittene objektorientierte Programmierung (Advanced Object-Oriented Programming)

Fortgeschrittene objektorientierte Programmierung (Advanced Object-Oriented Programming) 2014-03-07 Preface Fortgeschrittene objektorientierte Programmierung (Advanced Object-Oriented Programming) Coordinates: Lecturer: Web: Studies: Requirements: No. 185.211, VU, 3 ECTS Franz Puntigam http://www.complang.tuwien.ac.at/franz/foop.html

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

Safety SPL/2010 SPL/20 1

Safety SPL/2010 SPL/20 1 Safety 1 system designing for concurrent execution environments system: collection of objects and their interactions system properties: Safety - nothing bad ever happens Liveness - anything ever happens

More information

Exceptions and assertions

Exceptions and assertions Exceptions and assertions CSE 331 University of Washington Michael Ernst Failure causes Partial failure is inevitable Goal: prevent complete failure Structure your code to be reliable and understandable

More information

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems)

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems) Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems) More Analysis for Functional Correctness Jonathan Aldrich Charlie Garrod School of Computer Science

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

Steps for project success. git status. Milestones. Deliverables. Homework 1 submitted Homework 2 will be posted October 26.

Steps for project success. git status. Milestones. Deliverables. Homework 1 submitted Homework 2 will be posted October 26. git status Steps for project success Homework 1 submitted Homework 2 will be posted October 26 due November 16, 9AM Projects underway project status check-in meetings November 9 System-building project

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

Mutually Enhancing Test Generation and Specification Inference

Mutually Enhancing Test Generation and Specification Inference Mutually Enhancing Test Generation and Specification Inference Tao Xie David Notkin Department of Computer Science & Engineering University of Washington August 15th, 2003 Foundations of Software Engineering,

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

Top Down Design vs. Modularization

Top Down Design vs. Modularization 6.170 Quiz Review Topics: 1. Decoupling 2. 3. AF & RI 4. Iteration Abstraction & Iterators 5. OMs and Invariants 6. Equality, Copying, Views 7. 8. Design Patterns 9. Subtyping 10. Case Studies Decomposition

More information

Chapter 9. Software Testing

Chapter 9. Software Testing Chapter 9. Software Testing Table of Contents Objectives... 1 Introduction to software testing... 1 The testers... 2 The developers... 2 An independent testing team... 2 The customer... 2 Principles of

More information

CSE 331 Software Design & Implementation

CSE 331 Software Design & Implementation CSE 331 Software Design & Implementation Hal Perkins Spring 2017 Exceptions and Assertions 1 Outline General concepts about dealing with errors and failures Assertions: what, why, how For things you believe

More information

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides

1B1b Inheritance. Inheritance. Agenda. Subclass and Superclass. Superclass. Generalisation & Specialisation. Shapes and Squares. 1B1b Lecture Slides 1B1b Inheritance Agenda Introduction to inheritance. How Java supports inheritance. Inheritance is a key feature of object-oriented oriented programming. 1 2 Inheritance Models the kind-of or specialisation-of

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

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

Type Hierarchy. Comp-303 : Programming Techniques Lecture 9. Alexandre Denault Computer Science McGill University Winter 2004

Type Hierarchy. Comp-303 : Programming Techniques Lecture 9. Alexandre Denault Computer Science McGill University Winter 2004 Type Hierarchy Comp-303 : Programming Techniques Lecture 9 Alexandre Denault Computer Science McGill University Winter 2004 February 16, 2004 Lecture 9 Comp 303 : Programming Techniques Page 1 Last lecture...

More information

CS 520 Theory and Practice of Software Engineering Fall 2018

CS 520 Theory and Practice of Software Engineering Fall 2018 CS 520 Theory and Practice of Software Engineering Fall 2018 Nediyana Daskalova Monday, 4PM CS 151 Debugging October 30, 2018 Personalized Behavior-Powered Systems for Guiding Self-Experiments Help me

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

Testing3. State-based Testing

Testing3. State-based Testing Testing3 State-based testing Inheritance Testing interacting classes Communication diagrams Object relation graph (ORD) Regression testing GUI Testing 1 State-based Testing Natural representation with

More information

Implementing a List in Java. CSE 143 Java. Just an Illusion? List Interface (review) Using an Array to Implement a List.

Implementing a List in Java. CSE 143 Java. Just an Illusion? List Interface (review) Using an Array to Implement a List. Implementing a List in Java CSE 143 Java List Implementation Using Arrays Reading: Ch. 13 Two implementation approaches are most commonly used for simple lists: Arrays Linked list Java Interface List concrete

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

Objectives for this class meeting. 1. Conduct review of core concepts concerning contracts and pre/post conditions

Objectives for this class meeting. 1. Conduct review of core concepts concerning contracts and pre/post conditions CSE1720 Click to edit Master Week text 01, styles Lecture 02 Second level Third level Fourth level Fifth level Winter 2015! Thursday, Jan 8, 2015 1 Objectives for this class meeting 1. Conduct review of

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

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

Testing & Debugging TB-1

Testing & Debugging TB-1 Testing & Debugging TB-1 Need for Testing Software systems are inherently complex» Large systems 1 to 3 errors per 100 lines of code (LOC) Extensive verification and validiation is required to build quality

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 24 October 29, 2018 Arrays, Java ASM Chapter 21 and 22 Announcements HW6: Java Programming (Pennstagram) Due TOMORROW at 11:59pm Reminder: please complete

More information

Chapter 10 Classes Continued. Fundamentals of Java

Chapter 10 Classes Continued. Fundamentals of Java Chapter 10 Classes Continued Objectives Know when it is appropriate to include class (static) variables and methods in a class. Understand the role of Java interfaces in a software system and define an

More information

An Introduction to Systematic Software Testing. Robert France CSU

An Introduction to Systematic Software Testing. Robert France CSU An Introduction to Systematic Software Testing Robert France CSU Why do we need to systematically test software? Poor quality products can Inconvenience direct and indirect users Result in severe financial

More information

Type Hierarchy. Lecture 6: OOP, autumn 2003

Type Hierarchy. Lecture 6: OOP, autumn 2003 Type Hierarchy Lecture 6: OOP, autumn 2003 The idea Many types have common behavior => type families share common behavior organized into a hierarchy Most common on the top - supertypes Most specific at

More information

Computation Abstractions. Processes vs. Threads. So, What Is a Thread? CMSC 433 Programming Language Technologies and Paradigms Spring 2007

Computation Abstractions. Processes vs. Threads. So, What Is a Thread? CMSC 433 Programming Language Technologies and Paradigms Spring 2007 CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Threads and Synchronization May 8, 2007 Computation Abstractions t1 t1 t4 t2 t1 t2 t5 t3 p1 p2 p3 p4 CPU 1 CPU 2 A computer Processes

More information

Principles of Testing and Analysis. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Principles of Testing and Analysis. COMP 4004 Fall Notes Adapted from Dr. A. Williams Principles of Testing and Analysis COMP 4004 Fall 2008 Notes Adapted from Dr. A. Williams Software Quality Assurance Lec 3 1 Principles of Testing and Analysis Sensitivity Redundancy Restriction Partition

More information

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties Why testing and analysis Software Testing Adapted from FSE 98 Tutorial by Michal Young and Mauro Pezze Software is never correct no matter what developing testing technique is used All software must be

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Assertions and Exceptions Lecture 11 Fall 2005

Assertions and Exceptions Lecture 11 Fall 2005 Assertions and Exceptions 6.170 Lecture 11 Fall 2005 10.1. Introduction In this lecture, we ll look at Java s exception mechanism. As always, we ll focus more on design issues than the details of the language,

More information

Basic Principles of analysis and testing software

Basic Principles of analysis and testing software Basic Principles of analysis and testing software Software Reliability and Testing - Barbara Russo SwSE - Software and Systems Engineering Research Group 1 Basic principles of analysis and testing As in

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

Jtest Tutorial. Tutorial

Jtest Tutorial. Tutorial Jtest Jtest Welcome to the Jtest. This tutorial walks you through how to perform common Jtest tasks using example files. Please note that although the four types of tests (static analysis, white-box testing,

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

Chapter Goals. Chapter 7 Designing Classes. Discovering Classes Actors (end in -er, -or) objects do some kinds of work for you: Discovering Classes

Chapter Goals. Chapter 7 Designing Classes. Discovering Classes Actors (end in -er, -or) objects do some kinds of work for you: Discovering Classes Chapter Goals Chapter 7 Designing Classes To learn how to discover appropriate classes for a given problem To understand the concepts of cohesion and coupling To minimize the use of side effects To document

More information

a correct statement? You need to know what the statement is supposed to do.

a correct statement? You need to know what the statement is supposed to do. Using assertions for correctness How can we know that software is correct? It is only correct if it does what it is supposed to do. But how do we know what it is supposed to do? We need a specification.

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

Semantic Analysis. CSE 307 Principles of Programming Languages Stony Brook University

Semantic Analysis. CSE 307 Principles of Programming Languages Stony Brook University Semantic Analysis CSE 307 Principles of Programming Languages Stony Brook University http://www.cs.stonybrook.edu/~cse307 1 Role of Semantic Analysis Syntax vs. Semantics: syntax concerns the form of a

More information

Synchronization SPL/2010 SPL/20 1

Synchronization SPL/2010 SPL/20 1 Synchronization 1 Overview synchronization mechanisms in modern RTEs concurrency issues places where synchronization is needed structural ways (design patterns) for exclusive access 2 Overview synchronization

More information

Lecture Notes on Contracts

Lecture Notes on Contracts Lecture Notes on Contracts 15-122: Principles of Imperative Computation Frank Pfenning Lecture 2 August 30, 2012 1 Introduction For an overview the course goals and the mechanics and schedule of the course,

More information

Definition of DJ (Diminished Java)

Definition of DJ (Diminished Java) Definition of DJ (Diminished Java) version 0.5 Jay Ligatti 1 Introduction DJ is a small programming language similar to Java. DJ has been designed to try to satisfy two opposing goals: 1. DJ is a complete

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

Configuration Provider: A Pattern for Configuring Threaded Applications

Configuration Provider: A Pattern for Configuring Threaded Applications Configuration Provider: A Pattern for Configuring Threaded Applications Klaus Meffert 1 and Ilka Philippow 2 Technical University Ilmenau plop@klaus-meffert.de 1, ilka.philippow@tu-ilmena.de 2 Abstract

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 02: Basic Black-Box and White-Box Testing Techniques (Textbook Ch. 4 & 5) Spring 2018 Dietmar Pfahl email: dietmar.pfahl@ut.ee Structure of Lecture 2 Black-Box vs.

More information

An Introduction to Patterns

An Introduction to Patterns An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? - 1 Work on software development patterns stemmed from work on patterns from building architecture

More information

The Java Modeling Language (Part 2)

The Java Modeling Language (Part 2) The Java Modeling Language (Part 2) Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Copyright 1992-2015 by Pearson Education, Inc. All Rights Reserved. Data structures Collections of related data items. Discussed in depth in Chapters 16 21. Array objects Data

More information

A Third Look At Java. Chapter Seventeen Modern Programming Languages, 2nd ed. 1

A Third Look At Java. Chapter Seventeen Modern Programming Languages, 2nd ed. 1 A Third Look At Java Chapter Seventeen Modern Programming Languages, 2nd ed. 1 A Little Demo public class Test { public static void main(string[] args) { int i = Integer.parseInt(args[0]); int j = Integer.parseInt(args[1]);

More information

Implementing a List in Java. CSE 143 Java. List Interface (review) Just an Illusion? Using an Array to Implement a List.

Implementing a List in Java. CSE 143 Java. List Interface (review) Just an Illusion? Using an Array to Implement a List. Implementing a List in Java CSE 143 Java List Implementation Using Arrays Reading: Ch. 22 Two implementation approaches are most commonly used for simple lists: Arrays Linked list Java Interface List concrete

More information

Inheritance. Transitivity

Inheritance. Transitivity Inheritance Classes can be organized in a hierarchical structure based on the concept of inheritance Inheritance The property that instances of a sub-class can access both data and behavior associated

More information

Fundamentals of Software Engineering

Fundamentals of Software Engineering Fundamentals of Software Engineering Reasoning about Programs - Selected Features Ina Schaefer Institute for Software Systems Engineering TU Braunschweig, Germany Slides by Wolfgang Ahrendt, Richard Bubel,

More information

We would like guidance on how to write our programs beyond simply knowing correlations between inputs and outputs.

We would like guidance on how to write our programs beyond simply knowing correlations between inputs and outputs. Chapter 3 Correctness One of the most appealing aspects of computer programs is that they have a close connection to mathematics, in particular, logic. We use these connections implicitly every day when

More information

CS/ENGRD 2110 SPRING Lecture 5: Local vars; Inside-out rule; constructors

CS/ENGRD 2110 SPRING Lecture 5: Local vars; Inside-out rule; constructors 1 CS/ENGRD 2110 SPRING 2017 Lecture 5: Local vars; Inside-out rule; constructors http://courses.cs.cornell.edu/cs2110 Announcements 2 1. Writing tests to check that the code works when the precondition

More information

22c:181 / 55:181 Formal Methods in Software Engineering

22c:181 / 55:181 Formal Methods in Software Engineering 22c:181 / 55:181 Formal Methods in Software Engineering Design by Contract Copyright 2001-11, Matt Dwyer, John Hatcliff, Rod Howell, and Cesare Tinelli. Produced by Cesare Tinelli at the University of

More information

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)?

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)? Testing CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Testing Feb. 15, 2007 Some slides adapted from FSE 98 Tutorial by Michal Young and Mauro Pezze Execute program on sample input

More information

1 Shyam sir JAVA Notes

1 Shyam sir JAVA Notes 1 Shyam sir JAVA Notes 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write

More information

Thirty one Problems in the Semantics of UML 1.3 Dynamics

Thirty one Problems in the Semantics of UML 1.3 Dynamics Thirty one Problems in the Semantics of UML 1.3 Dynamics G. Reggio R.J. Wieringa September 14, 1999 1 Introduction In this discussion paper we list a number of problems we found with the current dynamic

More information

Dynamic Analysis Techniques Part 2

Dynamic Analysis Techniques Part 2 oftware Design (F28SD2): Dynamic Analysis Techniques Part 2 1 Software Design (F28SD2) Dynamic Analysis Techniques Part 2 Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt University

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Faults Found by Random Testing. WanChi Chio Justin Molinyawe

Faults Found by Random Testing. WanChi Chio Justin Molinyawe Faults Found by Random Testing WanChi Chio Justin Molinyawe Introduction Why apply random testing to object oriented software? Cost-efficient in terms of implementation effort and execution time. Introduction

More information

Get out, you will, of this bind If, your objects, you have confined

Get out, you will, of this bind If, your objects, you have confined CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [THREAD SAFETY] Putting the brakes, on impending code breaks Let a reference escape, have you? Misbehave, your code will, out of the blue Get out, you will,

More information

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION Overview, Test specification and cases, Adequacy criteria, comparing criteria, Overview of test execution, From test case specification

More information

Defensive Programming

Defensive Programming Defensive Programming Software Engineering CITS1220 Based on the Java1200 Lecture notes by Gordon Royle Lecture Outline Why program defensively? Encapsulation Access Restrictions Documentation Unchecked

More information

A Short Summary of Javali

A Short Summary of Javali A Short Summary of Javali October 15, 2015 1 Introduction Javali is a simple language based on ideas found in languages like C++ or Java. Its purpose is to serve as the source language for a simple compiler

More information

CS159. Nathan Sprague

CS159. Nathan Sprague CS159 Nathan Sprague What s wrong with the following code? 1 /* ************************************************** 2 * Return the mean, or -1 if the array has length 0. 3 ***************************************************

More information

CS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/

CS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/ CS61C Machine Structures Lecture 4 C Pointers and Arrays 1/25/2006 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS 61C L04 C Pointers (1) Common C Error There is a difference

More information

Part I: Preliminaries 24

Part I: Preliminaries 24 Contents Preface......................................... 15 Acknowledgements................................... 22 Part I: Preliminaries 24 1. Basics of Software Testing 25 1.1. Humans, errors, and testing.............................

More information

Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt

Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt www.introsoftwaretesting.com OO Software and Designs Emphasis on modularity and reuse puts complexity

More information

Exception Handling: A False Sense of Security Cargill, P1

Exception Handling: A False Sense of Security Cargill, P1 This is a slightly modified version of an article that appeared in the November-December 1994 issue of the C++ Report. Exception Handling: A False Sense of Security Cargill, P1 by Tom Cargill Cargill,

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

Principles of Object Oriented Programming. Lecture 4

Principles of Object Oriented Programming. Lecture 4 Principles of Object Oriented Programming Lecture 4 Object-Oriented Programming There are several concepts underlying OOP: Abstract Types (Classes) Encapsulation (or Information Hiding) Polymorphism Inheritance

More information

Testing. Unit, integration, regression, validation, system. OO Testing techniques Application of traditional techniques to OO software

Testing. Unit, integration, regression, validation, system. OO Testing techniques Application of traditional techniques to OO software Testing Basic ideas and principles Traditional testing strategies Unit, integration, regression, validation, system OO Testing techniques Application of traditional techniques to OO software Testing-11,

More information

Readability [Skrien 4.0] Programs must be written for people to read, and only incidentally for machines to execute.

Readability [Skrien 4.0] Programs must be written for people to read, and only incidentally for machines to execute. Readability [Skrien 4.0] Programs must be written for people to read, and only incidentally for machines to execute. Abelson & Sussman Use a good set of coding conventions, such as the ones given in the

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

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

The Java Memory Model

The Java Memory Model Jeremy Manson 1, William Pugh 1, and Sarita Adve 2 1 University of Maryland 2 University of Illinois at Urbana-Champaign Presented by John Fisher-Ogden November 22, 2005 Outline Introduction Sequential

More information