OBJECT-ORIENTED TESTING. TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews.

Slides:



Advertisements
Similar presentations
Unit Testing in the OO Context(Chapter 19-Roger P)
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Lecture # 2 : Process Models
Object-Oriented Analysis and Design
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
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)
Software Testing and Quality Assurance
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
Object-oriented Testing SIM3302. Objectives To cover the strategies and tools associated with object oriented testing  Analysis and Design Testing 
Component-Level Design
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
©Ian Sommerville 2006Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
1 Object-Oriented Software Engineering CIS 375 Bruce R. Maxim UM-Dearborn.
System Design Chapter 8. Objectives  Understand the verification and validation of the analysis models.  Understand the transition from analysis to.
Introduction To System Analysis and design
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
1 Object-Oriented Testing CIS 375 Bruce R. Maxim UM-Dearborn.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 13b: Software Testing Strategies Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
1 Software Engineering Muhammad Fahad Khan Software Engineering Muhammad Fahad Khan University Of Engineering.
1 Chapter 7 Software Testing Strategies. 2 Software Testing Testing is the process of exercising a program with the specific intent of finding errors.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
SOFTWARE DESIGN.
Object Oriented Testing: An Overview
Requirements as Usecases Capturing the REQUIREMENT ANALYSIS DESIGN IMPLEMENTATION TEST.
CS 4850: Senior Project Fall 2014 Object-Oriented Design.
1 What is OO Design? OO Design is a process of invention, where developers create the abstractions necessary to meet the system’s requirements OO Design.
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Chapter : 19 Testing Object-Oriented Applications.
Lecture 18: Object-Oriented Design
Internet and Intranet Protocols and Applications Lecture 5a: HTTP Client-Server Design and Implementation February 15, 2005 Arthur Goldberg Computer Science.
Software testing techniques Software testing techniques Object-oriented software testing Presentation on the seminar Kaunas University of Technology.
LECTURE 19 23/11/15 Software Quality and Testing.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
1 Unified Modeling Language, Version 2.0 Chapter 2.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Chapter 24 객체지향 응용프로그램 테스팅 Testing Object-Oriented Applications 임현승 강원대학교 Revised from the slides by Roger S. Pressman and Bruce R. Maxim for the book.
1 Lecture 15: Chapter 19 Testing Object-Oriented Applications Slide Set to accompany Software Engineering: A Practitioner’s Approach, 7/e by Roger S. Pressman.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
Software Engineering By Germaine Cheung Hong Kong Computer Institute Lecture 7.
CSIS 4850: CS Senior Project – Spring 2009 CSIS 4850: Senior Project Spring 2009 Object-Oriented Design.
Software Engineering Lecture 19: Object-Oriented Testing & Technical Metrics.
Software Engineering Lecture 10: System Engineering.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 14b: Software Testing Techniques Software Engineering: A Practitioner’s Approach, 6/e Chapter.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Unified Modeling Language
Object Oriented Concepts -I
Software Engineering: A Practitioner’s Approach, 6/e Chapter 13 Software Testing Strategies copyright © 1996, 2001, 2005 R.S. Pressman & Associates,
Object-Oriented Design
Object-Oriented Analysis
Chapter 24 Testing Object-Oriented Applications
CRC Modeling (class-relationship-collaborator)
Object-Oriented Design
Chapter 19 Testing Object-Oriented Applications
Chapter 10 – Software Testing
CS 8532: Advanced Software Engineering
Chapter 19 Testing Object-Oriented Applications
Chapter 17 Software Testing Strategies.
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

OBJECT-ORIENTED TESTING

TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews can be used to examine the correctness and consistency of both analysis and design models.  Correctness of OOA and OOD Models  Consistency of OOA and OOD Models

Correctness of OOA and OOD Models The notation and syntax used to represent analysis and design models will be tied to the specific analysis and design method that is chosen for the project. Hence, syntactic correctness is judged on proper use of the symbology; During analysis and design, semantic correctness must be judged based on the model’s conformance to the real world problem domain.

Consistency of OOA and OOD Models The consistency of OOA and OOD models may be judged by “considering the relationships among entities in the model. The CRC model and an object-relationship diagram can be used to facilitate this activity. Each CRC card lists the class name, its responsibilities (operations), and its collaborators The object-relationship model provides a graphic representation of the connections between classes.

To review the class model following steps have been recommended. 1. Revisit the CRC model and the object-relationship model  Cross check to ensure that all collaborations implied by the OOA model are properly represented. 2. Inspect the description of each CRC index card to determine if a delegated responsibility is part of the collaborator’s definition. 3. Invert the connection to ensure that each collaborator that is asked for service is receiving requests from a reasonable source. 4. Using the inverted connections examined in step 3, determine whether other classes might be required and whether responsibilities are properly grouped among the classes.

5. Determine whether widely requested responsibilities might be combined into a single responsibility. 6. Steps 1 through 5 are applied iteratively to each class and through each evolution of the OOA model. Once the OOD model is created, reviews of the system design and the object design should also be conducted. System design depicts the overall  product architecture  subsystems that compose the product,  subsystems allocated to processors,  design of the user interface. The object model presents the details of each class and the messaging activities that are necessary to implement collaborations between classes. The system design is reviewed by examining the object-behavior model developed during OOA. The object model should be tested against the object-relationship network

OBJECT-ORIENTED TESTING STRATEGIES Unit Testing in the OO Context When object-oriented software is considered, the concept of the unit changes. This means that each class and each instance of a class (object) packages attributes (data) and the operations (also known as methods or services) that manipulate these data. Rather than testing an individual module, the smallest testable unit is the encapsulated class or object. Because a class can contain a number of different operations and a particular operation may exist as part of a number of different classes.

Contd. Example :  To illustrate, consider a class hierarchy in which an operation X is defined for the super-class and is inherited by a number of subclasses.  Each subclass uses operation X, but it is applied within the context of the private attributes and operations that have been defined for the subclass. Unlike unit testing of conventional software, which focus on the algorithmic detail of a module and the data that flow across the module interface, class testing for OO software is driven by the operations encapsulated by the class and the state behavior of the class.

Integration Testing in the OO Context OO software does not have a hierarchical control structure. So integrating operations one at a time into a class is often impossible because of the “direct and indirect interactions of the components that make up the class”. Two different strategies:  Thread based testing integrates the set of classes required to respond to one input or event for the system. Each thread is integrated and tested individually. Regression testing is applied to ensure that no side effects occur.

Use-based testing  Begins the construction of the system by testing those classes (called independent classes) that use very few (if any) of server classes.  After the independent classes are tested, the next layer of classes, called dependent classes, that use the independent classes are tested.  This sequence of testing layers of dependent classes continues until the entire system is constructed. Cluster testing is one step in the integration testing of OO software. Here, a cluster of collaborating classes (determined by examining the CRC and object-relationship model) is exercised by designing test cases.

Validation Testing in an OO Context At the validation or system level, the details of class connections disappear. Like conventional validation, the validation of OO software focuses on user-visible actions and user-recognizable output from the system. To assist in the derivation of validation tests, the tester should draw upon the use-cases that are part of the analysis model. The use-case provides a scenario that has a high likelihood of uncovered errors in user interaction requirements. Conventional black-box testing methods can be used to drive validations tests. In addition, test cases may be derived from the object-behavior model and from event flow diagram created as part of OOA.

TESTING METHODS APPLICABLE AT THE CLASS LEVEL Random Testing for OO Classes Consider a banking application in which an account class has the following operations: open, setup, deposit, withdraw, balance, summarize, creditLimit, and close. Each of these operations may be applied for account, but certain constraints (e.g., the account must be opened before other operations and closed after all operations are completed) are implied by the nature of the problem. Even with these constraints, there are many permutations of the operations. Like this way, class account includes the following operations:  opensetupdepositwithdrawclose This represents the minimum test sequence for account class.

Similarly, opensetupdeposit[deposit|withdraw|balan ce|summarize|creditLimit] n withdrawclose A variety of different operation sequences can be generated randomly. For example: Test case r1: opensetupdepositdepositbalancesummariz ewithdrawclose Test case r2: opensetupdepositwithdrawdepositbalance creditLimitwithdrawclose

Partition Testing at the Class Level Partition testing reduces the number of test cases required to exercise the class Input and output are categorized and test cases are designed to exercise each category. Partitioning categories  State based partitioning  Attributes based partitioning  Category-based partitioning

State based partitioning - class operations based on their ability to change the state of the class. For example, account class, state operations include deposit and withdraw, whereas nonstate operations include balance, summarize, and creditLimit. Tests are designed in a way that exercises operations that change state and those that do not change state separately. Therefore, Test case p1: opensetupdepositdepositwithdrawwithdrawclose Test case p2: opensetupdepositsummarizecreditLimitwithdrawclose Test case p1 changes state, while test case p2 exercises operations that do not change state (other than those in the minimum test sequence).

Attribute-based partitioning - class operations based on the attributes that they use. For example, account class, the attributes balance and creditLimit can be used to define partitions. Operations are divided into three partitions: (1) operations that use creditLimit, (2) operations that modify creditLimit, and (3) operations that do not use or modify creditLimit. Test sequences are then designed for each partition.

Category-based partitioning - class operations based on the generic function that each performs. For example, operations in the account class can be categorized in Initialization operations (open, setup), Computational operations (deposit, withdraw). Queries (balance, summarize, creditLimit) and Termination operations (close).