Ch2-4-design - Introduction to Software Testing Chapter 2.4...

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

View Full Document Right Arrow Icon
Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt www.introsoftwaretesting.com © Ammann & Offutt 2 OO Software and Designs Emphasis on modularity and reuse puts complexity in the design connections Testing design relationships is more important than before Graphs are based on the connections among the software components Connections are dependency relations, also called couplings Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com
Background image of page 1

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

View Full DocumentRight Arrow Icon
© Ammann & Offutt 3 Call Graph The most common graph for structural design testing Nodes : Units (in Java – methods) Edges : Calls to units Example call graph A B C D F E Node coverage : call every unit at least once (method coverage) Edge coverage : execute every call at least once (call coverage) Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com © Ammann & Offutt 4 Call Graphs on Classes Node and edge coverage of class call graphs often do not work very well Individual methods might not call each other at all! Class stack public void push (Object o) public Object pop ( ) public boolean isEmpty (Object o) Other types of testing are needed – do not use graph criteria pop push isEmpty ? ? ? Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com
Background image of page 2
© Ammann & Offutt 5 Inheritance & Polymorphism Caution : Ideas are preliminary and not widely used Example inheritance hierarchy graph A B C D Classes are not executable, so this graph is not directly testable We need objects A B C D a b d c objects What is coverage on this graph ? Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com © Ammann & Offutt 6 Coverage on Inheritance Graph Create an object for each class ? This seems weak because there is no execution Create an object for each class and apply call coverage? OO Call Coverage : TR contains each reachable node in the call graph of an object instantiated for each class in the class hierarchy. OO Object Call Coverage : TR contains each reachable node in the call graph of every object instantiated for each class in the class hierarchy. Data flow is probably more appropriate … Introduction to Software Testing (Ch 2), www.introsoftwaretesting.com
Background image of page 3

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

View Full DocumentRight Arrow Icon
© Ammann & Offutt 7 Data Flow at the Design Level Data flow couplings among units and classes are more complicated than control flow couplings When values are passed, they “change names
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

Ch2-4-design - Introduction to Software Testing Chapter 2.4...

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

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