Information System Design (IT60105) Lecture 26 Object-Oriented System Testing.

Slides:



Advertisements
Similar presentations
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Advertisements

Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Unified Modeling Language
Object-Oriented Analysis and Design
Systems development life cycle & development methodologies
Introduction To System Analysis and Design
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Programming Language Paradigms: summary. Object-oriented programming Objects are the fundamental building blocks of a program. Interaction is structured.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Stéphane Ducasse6.1 Essential Concepts Why OO? What is OO? What are the benefits? What are the KEY concepts? Basis for all the lectures.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
© Copyright Eliyahu Brutman Programming Techniques Course.
Visual Basic Introduction IDS 306 from Shelly, Cashman & Repede Microsoft Visual Basic 5: Complete Concepts and Techniques.
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Object Oriented Concepts. Movement toward Objects Instead of data-oriented or process-oriented Analysis, many firms are now moving to object-oriented.
C++ fundamentals.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
1 Review: Two Programming Paradigms Structural (Procedural) Object-Oriented PROGRAM PROGRAM FUNCTION OBJECT Operations Data OBJECT Operations Data OBJECT.
Java Course Outline Kumar Harshit, USW. Course Description Teaches students to program using the Java programming language with the help of the Netbeans.
CS415 C++ Programming Takamitsu Kawai x4212 G11 CERC building WV Virtual Environments Lab West Virginia University.
Introduction To System Analysis and design
Programming Languages and Paradigms Object-Oriented Programming.
Object-Oriented Software Testing. C-S 5462 Object-Oriented Software Testing Research confirms that testing methods proposed for procedural approach are.
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
Chapter 1: Introduction to Systems Analysis and Design
School of Computer Science & Information Technology G6DICP - Lecture 22 The Theory of Object Oriented Programming.
Unified Modeling Language, Version 2.0
Introduction To System Analysis and Design
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
OOP Class Lawrence D’Antonio Lecture 3 An Overview of C++
Systems Analysis and Design in a Changing World, 3rd Edition
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Chapter 7 The Object-Oriented Approach to Requirements.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
Object Oriented Programming
LECTURE 19 23/11/15 Software Quality and Testing.
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 9 Java Fundamentals Objects/ClassesMethods Mon.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Inheritance and Subclasses CS 21a. 6/28/2004 Copyright 2004, by the authors of these slides, and Ateneo de Manila University. All rights reserved L16:
CSCI 171 Presentation 15 Introduction to Object–Oriented Programming (OOP) in C++
Class Relationships Lecture Oo08 Polymorphism. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 10 p.125 n Fowler & Scott, UML.
Testing in OO Environment The reasons for testing is not any different for any of the design and implementation methodologies, including OO methodology.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Basic Characteristics of Object-Oriented Systems
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
CSCE 240 – Intro to Software Engineering Lecture 3.
1 Design Object Oriented Solutions Object Oriented Analysis & Design Lecturer: Mr. Mohammed Elhajj
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Chapter 1: Introduction to Systems Analysis and Design
Roberta Roth, Alan Dennis, and Barbara Haley Wixom
Object-Oriented Analysis and Design
Systems Analysis and Design With UML 2
Review: Two Programming Paradigms
Software Architecture & Design Pattern
3 Fundamentals of Object-Oriented Programming
Testing with OO OO has several key concepts:
Chapter 1: Introduction to Systems Analysis and Design
OBJECT ORIENTED PROGRAMMING
Chapter 22 Object-Oriented Systems Analysis and Design and UML
OBJECT ORIENTED PROGRAMMING
Chapter 1: Introduction to Systems Analysis and Design
Presentation transcript:

Information System Design (IT60105) Lecture 26 Object-Oriented System Testing

Overview of Testing OO Programs2 Lecture #23 Procedural vs OO paradigms Why not Traditional Testing? Issues Methodology

Overview of Testing OO Programs3  Procedural Vs OO programs  Procedural Vs OO Software development

Overview of Testing OO Programs4 Example: Procedural Program int x, y, radious, length, sh_type; float angle; enum { CIRCLE=0, SQUARE=1 } void draw (sh_type){ case CIRCLE: /* code to draw circle */ break; case SQUARE: /* code to draw square*/ break; case default: break; } void rotate (int sh_type, int dgree){ case CIRCLE: /*code to rotate circle */ break; case SQUARE: /*codeto rotate square*/ break; case default: break; } void move (int x_off,y_off){ x= x+x_off; y= y+y_off; } This is a procedural program for graphical tool. Two shapes are there: circle, square. Each have functions draw(), rotate(), move() main() rotate()move()draw()

Overview of Testing OO Programs5 Example: OO Program public class Shape(){ public int x, y; float angle; public abstract void draw ( ); public void rotate(int degree); public void move(int x_off, y_off){ x= x+x_off; y= y+y_off; }} public class Circle extends Shape{ private int radious; public void draw(){/* code*/ } public void rotate( int dgree){ draw(); }} public class Square extends Shapes{ private int length; public void draw(){/* code*/ } public void rotate(int degree){ /* code*/ }} This is an Object-oriented program for graphical tool. Two shapes are there: circle, square. Each have functions draw(), rotate(), move() Shape CircleSquare Note: 1. Methods in oo programs are shorter in oo programs 2.Arbitrary sequence of class methods can call because of reuse

Overview of Testing OO Programs6 Procedural vs OO programs Consists of functions and global data Consists of classes and objects Communication through function calls and global data Communication through message passing and inheritance Control flowBoth data & control flow Functional decompositionRecursion and inheritance Reuse is incidentalReuse is central

Overview of Testing OO Programs7 Procedural vs OO Software Development Primarily waterfall model Incremental iterative and recursive model Units=functionsUnits=classes Data & call couplingInheritance & message coupling ER diagramsSemantic nets Data flow diagramsControl flow diagrams Structured chartsInteraction diagrams Primarily top-down development Top-down & bottom-up development White box testing emphasizedBlock box testing emphasized Analyze a little,Design a little, Code a little, Test a little

Overview of Testing OO Programs8

9 Why not Traditional Testing? Traditional testing considers only static binding. so execution order is to be predefined but this not happen in oo programs Traditional white box testing not adequate: –Traditional testing Consider only on intra-procedural logic and control flow –Traditional testing do not Consider interactions among method calls in a class

Overview of Testing OO Programs10 Why not Traditional Testing? cont Traditional block box testing not adequate: –Basic OO program code structure is different –In oo testing, exhaustive testing is impossible. Because infinite number of method sequences can be possible. –E.g.: Observationally equivalent objects may contain variables with different values. Because Object may contain variables that are not important in the given state Object May contain variable invariants

Overview of Testing OO Programs11 Why not Traditional Testing? cont Traditional dataflow testing not adequate: –Can be applied both to individual methods in a class and to methods in a class that interact through messages –But do not consider dataflow interactions that arise when users of a class invoke sequences of methods in an arbitrary order.

Overview of Testing OO Programs12  OO Paradigms  Language-Specific features

Overview of Testing OO Programs13 OO Paradigms State Dependent Behavior –The behavior of objects depends on their state. so stateless behavioral testing in not sufficient for oo programs. Encapsulation –This giving observability problem (private attributes access is not allowed for outside of class). but test oracles required access of all attributes of class

Overview of Testing OO Programs14 OO Paradigms cont Inheritance –Subclass can invoke constructors of super class, so constructors should consider in testing –Testing of subclass from scratch is expansive. So reuse of superclass tests should consider in testing. Polymorphism and Dynamic binding –Tests should exercise all possible method bindings of polymorphic method call. –Undesidability problem because of dynamic binding

Overview of Testing OO Programs15 OO Paradigms cont Abstract Classes –Non-instantiation problem: abstract classes are incomplete. So they can’t be instantiate directly. –These can be part of interface elements of libraries or components, so these classes should be test. Exception Handling –Textual distance between the point where an exception is thrown and the point where it is handle and Dynamic determination of binding should be consider. Concurrency –Deadlock and race conditions should be consider.

Overview of Testing OO Programs16 Language-Specific features Different languages in using different OO paradigms Language specific hazards: –C++ Naming pollution, friend function, no type safe (dynamic array, pointer, casting), this and new problem and etc. Implicit type coercion with overloaded operators –Java Incompatible on different Java Virtual Machines or an executing user's environment. No thread scheduling policy

Overview of Testing OO Programs17

Overview of Testing OO Programs18 Phases of Testing Intra Class or Class Testing (Unit) –It deals with classes in isolation –It includes Method testing by Traditional testing methods Message testing Inheritance testing Exception testing (local) Polymorphism testing (local) Abstract classes testing

Overview of Testing OO Programs19 Phases of Testing cont Inter Class Testing (Integration) –In this phase, class interactions are considered –It includes Exception testing Polymorphism testing –Integration is not hierarchical in OO Coupling is not via subroutine ‘Top-down’, ‘Bottom-up’ have little meaning –Integration Testing can be done in 2 ways Thread-based Use-based (dependent & independent classes)

Overview of Testing OO Programs20 Phases of Testing cont Integration Testing –Thread-based testing Integrates the set of classes required to respond to one input or event Integrate one thread at a time –Use-based testing Integrate/test independent classes Then, test next layer of (dependent) classes that use the independent classes (layer by layer, or cluster-based) Repeat adding/testing next layer of dependent classes until entire system is constructed Driver classes or methods required to test lower layers

Overview of Testing OO Programs21 Phases of Testing cont System Testing –It considers the software as a whole independently from its internal structure –Traditional system and acceptance testing techniques can be applied.

Overview of Testing OO Programs22 UML diagrams in OO Testing UML diagrams plays vital role in each OO testing phase. Class testing –Statechart diagram, class diagram Interclass testing –Class diagram, activity diagram, interaction diagram System testing –Use case diagram