Graph Coverage for Design Elements 1.  Use of data abstraction and object oriented software has increased importance on modularity and reuse.  Therefore.

Slides:



Advertisements
Similar presentations
Programming Languages and Paradigms
Advertisements

Giving a formal meaning to “Specialization” In these note we try to give a formal meaning to specifications, implementations, their comparisons. We define.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 7: User-Defined Functions II.
Graph Coverage for Design Elements 1.  Use of data abstraction and object oriented software has increased importance on modularity and reuse.  Therefore.
JDBC Session 4 Tonight: Design Patterns 1.Introduction To Design Patterns 2.The Factory Pattern 3.The Facade Pattern Thursday & Next Tuesday: Data Access.
The Application of Graph Criteria: Source Code  It is usually defined with the control flow graph (CFG)  Node coverage is used to execute every statement.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Parameterized Object Sensitivity for Points-to Analysis for Java Presented By: - Anand Bahety Dan Bucatanschi.
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
COMP171 Data Structure & Algorithm Tutorial 1 TA: M.Y.Chan.
Recap from last time We were trying to do Common Subexpression Elimination Compute expressions that are available at each program point.
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
Previous finals up on the web page use them as practice problems look at them early.
Object-oriented Programming Concepts
CS 106 Introduction to Computer Science I 04 / 21 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 04 / 28 / 2010 Instructor: Michael Eckmann.
Schedule Midterm out tomorrow, due by next Monday Final during finals week Project updates next week.
Use Case Analysis – continued
C++ fundamentals.
Paul Ammann & Jeff Offutt
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt
Control Flow Resolution in Dynamic Language Author: Štěpán Šindelář Supervisor: Filip Zavoral, Ph.D.
Introduction to Software Testing Chapter 7.1 Engineering Criteria for Technologies Paul Ammann & Jeff Offutt
Course Outline Traditional Static Program Analysis –Theory –Classic analysis and applications Points-to analysis, CHA, RTA –The Soot analysis framework.
Software Testing and Maintenance Lecture 4 Graph Coverage for Design Element Paul Ammann & Jeff Offutt Instructor: Hossein Momeni Mazandaran.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Concepts of Software Quality Yonglei Tao 1. Software Quality Attributes  Reliability  correctness, completeness, consistency, robustness  Testability.
CS 4310: Software Engineering Lecture 4 System Modeling The Analysis Stage.
Cohesion and Coupling CS 4311
1 Graph Coverage (4). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
Programming Languages and Paradigms Imperative Programming.
CS 106 Introduction to Computer Science I 04 / 23 / 2010 Instructor: Michael Eckmann.
Information System Design (IT60105) Lecture 26 Object-Oriented System Testing.
CSCI-383 Object-Oriented Programming & Design Lecture 18.
Software Verification Graph Model 2. 2 Graph Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Use cases Specs Design Source.
Paul Ammann & Jeff Offutt
Learners Support Publications Object Oriented Programming.
CSC 131 Fall 2006 Lecture # 6 Object-Oriented Concepts.
Introduction to Software Testing (2nd edition) Chapter 7.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
Introduction to Software Testing Chapter 7.1 Engineering Criteria for Technologies Paul Ammann & Jeff Offutt
Object Oriented Programming
Week 6: Software Design HNDIT Software Engineering Software Design Learning Outcomes  Understand the activities involved in the Design process.
Control Flow Graphs : The if Statement 1 if (x < y) { y = 0; x = x + 1; } else { x = y; } x >= yx < y x = y y = 0 x = x + 1 if (x < y) { y = 0;
Coupling-based Criteria for Integration Testing Journal of Software Testing, Verification, and Analysis, 8(3): , September 1998, Jenny Jin and Jeff.
Chapter 2 : Graph Coverage (part 2)
SysML and Modelica Integration Working Group Meeting 3/11/09 Peter Fritzson Wladimir Schamai.
Inter-procedural analysis
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Paul Ammann & Jeff Offutt
Testing Object-Oriented Software Test Coverage Criteria
Cmpe 589 Spring 2006.
Software Engineering Lecture 4 System Modeling The Analysis Stage.
Main issues: • What do we want to build • How do we write this down
Software Testing and Maintenance 1
Paul Ammann & Jeff Offutt
Graph Coverage for Design Elements CS 4501 / 6501 Software Testing
Object orientation concepts
White-Box Testing Techniques II
Coupling and Cohesion By Bonnie Ngu.
Designing for Inheritance
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
White-Box Testing Techniques II
Graph Coverage for Design Elements CS 4501 / 6501 Software Testing
자바 언어를 위한 정적 분석 (Static Analyses for Java) ‘99 한국정보과학회 가을학술발표회 튜토리얼
White-Box Testing Techniques II
Fundaments of Game Design
Presentation transcript:

Graph Coverage for Design Elements 1

 Use of data abstraction and object oriented software has increased importance on modularity and reuse.  Therefore testing of software based design (design elements) is more important that past  They are usually associated with integration testing.  Since modularity, the software components can be tested independently. 2

Structural Graph Coverage for Desgin Elements  Graph coverage for design elements usually starts by creating graphs that are based on couplings between software components.  Coupling measures the dependency relations between two units by reflecting their interconnections  Faults in one unit may affect the coupled unit.  Coupling provides summary information about the design and the structure of the software. 3

Data-Bound Relationships Between Design Elements  Caller: unit that invokes the callee  An actual parameter (value passed to the callee by the caller; ) is in the caller  Its value is assigned to a formal parameter in the callee. 4

Define du-pairs between Callers and Callees 5 The last-defs are 2, 3 The first-uses are 12, 13

Inter-procedural DU pairs last-def & first-use  The last-def is the definition that goes through the call or return  Can be from caller to callee (parameter or shared variable) or from callee to caller as a return value  The first-use picks up that definition. 6

7 Inter-procedural DU Pairs FX = 14  y = G (x)  print (y) G (a) print (a)  b = 42  return (b) Caller Callee DU pair 11 B (int y) Z = y T = y print (y) Last Defs 2, 3 First Uses 11, 12 callsite first-use last-def x = 5 x = 4 x = 3 B (x)

Coupling Three different ways that different program parts might interact: Parameter Coupling: relationships between caller and callees; passing data as parameters; Shared Data Coupling: one unit writes to some in-memory data, another unit reads this data; External Data Coupling: one unit writes data e.g. to disk, another read reads the data. 8

9 def-use pairs as Normal Coupling Data Flow Analysis I def use A () intra-procedural data flow (within the same unit)  The method A() contains def and use.  Here the variable is omitted  It is assumed that all du pairs refer to the same variable. This is classic Data Flow Coverage for design elements

def-use pairs as Normal Coupling Data Flow Analysis II 10 All du pairs between a caller A() and a callee B() This example is another classic Data Flow Coverage for design elements

11 Parameter Coupling

12 Example Call Site A  B (x)  end A B (Y)  end B Caller Actual Parameter Formal Parameter Callee interface  Applying data flow criteria to def-use pairs between units is too expensive  Too many possibilities  But this is integration testing, and we really only care about the interface …

Coupling Data-flow  We are only testing variables that have a definition on one side and a use on the otherside  we do not impose test requirements in the following case: 13

14  We will generally treat an entire array as one variable.  Because m and n are different objects, there is no du- pair here.  We have a last- def of m.x and a first-use of n.x.

15 Inheritance, Polymorphism & Dynamic Binding and Problems for Data Flow Coverage  Additional control and data connections make data flow analysis more complex  The defining and using units may be in different call hierarchies  When inheritance hierarchies are used, a def in one unit could reach uses in any class in the inheritance hierarchy  With dynamic binding, the same location can reach different uses depending on the current type of the using object  The same location can have different definitions or uses at different points in the execution

def-use pairs in Object-Oriented Software 16 In object oriented software du- pairs are usually based on class and state variables defined for class.  A coupling method F() calls two methods A() and B().  A() defines a variable and B() uses it.  For the variable references to the same, both A() and B() must be called through the same instance context, or object reference.  For example if the callers are o.A() and o.B(), they are called through the instance context of o.  If the calls are not through the same instance context, the definition and use will be different instances of the variable. coupling method

def-use pairs in Object-Oriented Software object-oriented indirect coupling data flow def A() use B() M () N() F() A() M() B() N() Both are calling each other 17  The coupling method F() calls two methods M() and N() which in turn call the methods A() and B().  The def and use are in A() and B(), so the reference is indirect.  The analysis for indirect du- pairs is more complex than one call between the coupling method and the methods with the def and use. Coupling method This is another classic Data Flow Coverage for design elements

def-use pairs in Object-Oriented Software  In object oriented data flow testing A() and B() could be in the same class, or they could be in different classes and accessing the same global variables  These are the advanced topics for inheritance and polymorphisim. 18