Ch7-1-ooAnalysis

Ch7-1-ooAnalysis - Introduction to Software Testing Chapter...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Introduction to Software Testing Chapter 7.1 Engineering Criteria for Technologies Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/softwaretest/ The Technologies Chapters 1-5 emphasize criteria on four models of software Emphasis in each chapter was first on the criteria, then on how to construct the models from different software artifacts This chapter discusses how to apply the criteria to specific technologies Most of the ideas in this chapter were developed after the year 2000 Thus they are still evolving Introduction to Software Testing (Ch 7) © Ammann and Offutt 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Chapter 7 Outline 1. Object-Oriented Software 2. Web Applications and Web Services 3. Graphical User Interfaces 4. Real-Time and Embedded Software Introduction to Software Testing (Ch 7) © Ammann and Offutt 3 Section 7.1 Outline 2. Types of Object-Oriented Faults Overview 1. Example 2. The Yo-Yo Graph and Polymorphism 3. Categories of Inheritance Faults 4. Testing Inheritance, Polymorphism and Dynamic Binding 5. Object-Oriented Testing Criteria Introduction to Software Testing (Ch 7) © Ammann and Offutt 4
Background image of page 2
3 Inheritance Allows common features of many classes to be defined in one class Enhance derived features (overriding) A derived class has everything its parent has, plus it can: Introduction to Software Testing (Ch 7) © Ammann and Offutt 5 Restrict derived features Add new features (extension) Inheritance (2) Declared type : The type given when an object reference is declared Clock w1; // declared type Clock Actual type : The type of the current object w1 = new Watch(); // actual type Watch A Introduction to Software Testing (Ch 7) © Ammann and Offutt 6 In Java, the method that is executed is the the lowest lowest version of the method defined between the actual and declared types in the inheritance hierarchy C B
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Access Control (in Java) Class 1 Package public members Class 3 private members default protected members © Ammann and Offutt 7 Class 4 inheritance Class 2 Class 5 Introduction to Software Testing (Ch 7) Polymorphism The same variable can have different types depending on the program execution If B inherits from A , then an object of type B can be used when an object of type A is expected If both A and B define the same method M ( B overrides A ), then the same statement might call either A ’s version of M or B ’s version Introduction to Software Testing (Ch 7) © Ammann and Offutt 8
Background image of page 4
5 Subtype and Subclass Inheritance Subtype Inheritance : If B inherits from A, any object of type B can be substituted for an object of type A A laptop “is a” special type of computer Called substitutability animal deer human Subclass Inheritance : Objects of type B may not be substituted for objects of type A Objects of B may not be “ type compatible In Java’s collection framework, a Stack inherits from a Vector it f i l t t i b t tk id f i i t l t Introduction to Software Testing (Ch 7) © Ammann and Offutt 9
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course SWE 637 taught by Professor Offutt,j during the Fall '08 term at George Mason.

Page1 / 20

Ch7-1-ooAnalysis - Introduction to Software Testing Chapter...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online