tailieunhanh - Lecture Software testing and analysis - Chapter 15: Testing object-oriented software

In this chapter, we begin with functional tests based on specification of intended behavior, add selected structural test cases based on the software structure, and work from unit testing and small-scale integration testing toward larger integration and then system testing. | Testing Object Oriented Software Chapter 15 Characteristics of 00 Software Typical 00 software characteristics that impact testing State dependent behavior Encapsulation Inheritance Polymorphism and dynamic binding Abstract and generic classes Exception handling c 2008 Mauro Pezze Michal Young Ch 15 slide 3 Learning objectives Understand how object orientation impacts software testing - What characteristics matter Why - What adaptations are needed Understand basic techniques to cope with each key characteristic Understand staging of unit and integration testing for 00 software intra-class and interclass testing c 2008 Mauro Pezze Michal Young Ch 15 slide 2 Quality activities and 00 sw determined or becomes visible c 2008 Mauro Pezze Michal Young Ch 15 slide 4 00 definitions of unit and integration testing Procedural software - unit single program function or procedure more often a unit of work that may correspond to one or more intertwined functions or programs Object oriented software - unit class or small cluster of strongly related classes . sets of Java classes that correspond to exceptions - unit testing intra-class testing - integration testing inter-class testing cluster of classes - dealing with single methods separately is usually too expensive complex scaffolding so methods are usually tested in the context of the class they belong to c 2008 Mauro Pezze Michal Young Ch 15 slide 5 5 Intraclass state Machine Testing Basic idea - The state of an object is modified by operations - Methods can be modeled as state transitions - Test cases are sequences of method calls that traverse the state machine model State machine model can be derived from specification functional testing code structural testing or both Later Inheritance and dynamic binding c 2008 Mauro Pezze Michal Young Ch 15 slide 7 Orthogonal approach Stages Intra-Class Testing Super subclass relations State machine testing Functional Augmented state machine Data flow model Exceptions