SlideShare una empresa de Scribd logo
1 de 13
Chapter 19
         Testing Object-Oriented Applications
          Slide Set to accompany
          Software Engineering: A Practitioner’s Approach, 7/e
          by Roger S. Pressman

          Slides copyright © 1996, 2001, 2005, 2009 by Roger S. Pressman


          For non-profit educational use only
          May be reproduced ONLY for student use at the university level when used in conjunction
          with Software Engineering: A Practitioner's Approach, 7/e. Any other reproduction or use is
 These slides are designed to
          prohibited without the express written permission of the author.

accompany Software Engineering: A on a website for student
        All copyright information MUST appear if these slides are posted
        use.
Practitioner’s Approach, 7/e (McGraw-
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                                          1
OO Testing
       To adequately test OO systems, three things
        must be done:
           the definition of testing must be broadened to
            include error discovery techniques applied to object-
            oriented analysis and design models
           the strategy for unit and integration testing must
            change significantly, and
           the design of test cases must account for the unique
            characteristics of OO software.
 These slides are designed to
accompany Software Engineering: A
Practitioner’s Approach, 7/e (McGraw-
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                         2
‘Testing’ OO Models
       The review of OO analysis and design models
        is especially useful because the same semantic
        constructs (e.g., classes, attributes, operations,
        messages) appear at the analysis, design, and
        code level
       Therefore, a problem in the definition of class
        attributes that is uncovered during analysis
        will circumvent side affects that might occur if
 These the problem were not discovered until design
         slides are designed to
accompany Software Engineering: A
        or code (or even the next iteration of analysis).
Practitioner’s Approach, 7/e (McGraw-
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                     3
Correctness of OO Models
       During analysis and design, semantic correctness can be
        asesssed based on the model’s conformance to the real
        world problem domain.
     If the model accurately reflects the real world (to a level
        of detail that is appropriate to the stage of development
        at which the model is reviewed) then it is semantically
        correct.
     To determine whether the model does, in fact, reflect
        real world requirements, it should be presented to
        problem domain experts who will examine the class
 These definitions and hierarchy for omissions and ambiguity.
         slides are designed to
accompany relationships (instance connections) are evaluated
     Class
               Software Engineering: A
        to determine whether they accurately reflect real-world
Practitioner’s Approach, 7/e (McGraw-
        object connections.
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                         4
Class Model Consistency
       Revisit the CRC model and the object-relationship
        model.
     Inspect the description of each CRC index card to
        determine if a delegated responsibility is part of the
        collaborator’s definition.
     Invert the connection to ensure that each collaborator
        that is asked for service is receiving requests from a
        reasonable source.
     Using the inverted connections examined in the
        preceding step, determine whether other classes might
 These be required or whether responsibilities are properly
         slides are designed to
accompany Softwarethe classes.
        grouped among
                           Engineering: A
     Determine whether widely requested responsibilities
Practitioner’s Approach,into a(McGraw-
        might be combined 7/e single responsibility.
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                        5
OO Testing Strategies
         Unit testing
              the concept of the unit changes
              the smallest testable unit is the encapsulated class
              a single operation can no longer be tested in isolation (the
               conventional view of unit testing) but rather, as part of a
               class
         Integration Testing
           Thread-based testing integrates the set of classes required to respond
           
           to one input or event for the system
          Use-based testing begins the construction of the system by testing
           those classes (called independent classes) that use very few (if any)
 These slides are designed to
           of server classes. After the independent classes are tested, the next
           layer of classes, called dependent classes
accompany Software Engineering: A of collaborating classes
          Cluster testing [McG94] defines a cluster

Practitioner’s Approach, 7/e the CRC and object-relationship model)
           (determined by examining (McGraw-
           is exercised by designing test cases that attempt to uncover errors
Hill 2009).in the collaborations.
             Slides copyright 2009 by
Roger Pressman.                                                      6
OO Testing Strategies
       Validation Testing
          details of class connections disappear
          draw upon use cases (Chapters 5 and 6) that are part
           of the requirements model
          Conventional black-box testing methods (Chapter
           18) can be used to drive validation tests




 These slides are designed to
accompany Software Engineering: A
Practitioner’s Approach, 7/e (McGraw-
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                       7
OOT Methods
   Berard [Ber93] proposes the following approach:

      1. Each test case should be uniquely identified and should be
      explicitly associated with the class to be tested,
      2. The purpose of the test should be stated,
      3. A list of testing steps should be developed for each test and
      should contain [BER94]:
         a. a list of specified states for the object that is to be tested
         b. a list of messages and operations that will be exercised as
            a consequence of the test
         c.   a list of exceptions that may occur as the object is tested
          d. a list of external conditions (i.e., changes in the
 These slides are designed to
      environment                   external to the software that must
      exist in order to properly                conduct the test)
accompany Software information that willA in understanding or
         e. supplementary
                           Engineering: aid
Practitioner’s Approach, 7/e (McGraw-
            implementing the test.

Hill 2009). Slides copyright 2009 by
Roger Pressman.                                       8
Testing Methods
         Fault-based testing
               The tester looks for plausible faults (i.e., aspects of the
               implementation of the system that may result in defects). To
               determine whether these faults exist, test cases are designed to
               exercise the design or code.
         Class Testing and the Class Hierarchy
              Inheritance does not obviate the need for thorough testing of all
               derived classes. In fact, it can actually complicate the testing
               process.
         Scenario-Based Test Design
           
          Scenario-based testing concentrates on what the user does, not
 These slides the product does. This means capturing the tasks (via use-
          what are designed to
accompany Software Engineering:then applying them and their
          cases) that the user has to perform, A
          variants as tests.
Practitioner’s Approach, 7/e (McGraw-
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                                         9
OOT Methods: Random Testing
      Random testing
          identify operations applicable to a class
          define constraints on their use
          identify a minimum test sequence
            • an operation sequence that defines the minimum life
              history of the class (object)
          generate a variety of random (but valid) test sequences
           • exercise other (more complex) class instance life
 These slides are designed to
             histories

accompany Software Engineering: A
Practitioner’s Approach, 7/e (McGraw-
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                            10
OOT Methods: Partition Testing
         Partition Testing
              reduces the number of test cases required to test a class in
               much the same way as equivalence partitioning for
               conventional software
              state-based partitioning
                • categorize and test operations based on their ability to change
                  the state of a class
              attribute-based partitioning
                • categorize and test operations based on the attributes that they
                  use
              category-based partitioning
 These slidescategorize and test operations based on the generic function
            • are designed to
              each performs
accompany Software Engineering: A
Practitioner’s Approach, 7/e (McGraw-
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                                11
OOT Methods: Inter-Class Testing
       Inter-class testing
         
         For each client class, use the list of class operators to
         generate a series of random test sequences. The
         operators will send messages to other server classes.
       For each message that is generated, determine the
         collaborator class and the corresponding operator in the
         server object.
       For each operator in the server object (that has been
         invoked by messages sent from the client object),
         determine the messages that it transmits.
       For each of the messages, determine the next level of

These slides arethat are invoked and incorporate these into the
         operators designed to
         test sequence
accompany Software Engineering: A
Practitioner’s Approach, 7/e (McGraw-
Hill 2009). Slides copyright 2009 by
Roger Pressman.                                            12
OOT Methods: Behavior Testing
   The tests to be                        empty                   set up
   designed should         open            acct   setup Accnt      acct

   achieve all state
   coverage [KIR94].
                                                                     deposit
                                                                     (initial)
   That is, the                                                                   deposit
   operation
   sequences should                                              working
                                                                  acct
   cause the                                       balance
                                                     credit                       withdraw
   Account class to                               accntInfo
   make transition                                                   withdrawal
   through all                                                       (final)


These slides states
   allowable
                are designed to            dead                 nonworking
                                           acct                    acct
accompany Software Engineering: A
                                                     close


Practitioner’s Approach, 7/e at(McGraw-class (adapt ed f rom [ KIR94] )
                       Figure 14.3 St e diagram f or Account

Hill 2009). Slides copyright 2009 by
Roger Pressman.                                               13

Más contenido relacionado

La actualidad más candente

Testing terms & definitions
Testing terms & definitionsTesting terms & definitions
Testing terms & definitions
Sachin MK
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
Nishant Worah
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
Fincy V.J
 

La actualidad más candente (20)

Python: Object-Oriented Testing (Unit Testing)
Python: Object-Oriented Testing (Unit Testing)Python: Object-Oriented Testing (Unit Testing)
Python: Object-Oriented Testing (Unit Testing)
 
Software testing methods
Software testing methodsSoftware testing methods
Software testing methods
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
11 software testing_strategy
11 software testing_strategy11 software testing_strategy
11 software testing_strategy
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Testing
TestingTesting
Testing
 
H testing and debugging
H testing and debuggingH testing and debugging
H testing and debugging
 
@#$@#$@#$"""@#$@#$"""
@#$@#$@#$"""@#$@#$"""@#$@#$@#$"""@#$@#$"""
@#$@#$@#$"""@#$@#$"""
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testing
 
Testing terms & definitions
Testing terms & definitionsTesting terms & definitions
Testing terms & definitions
 
debugging and testing
debugging and testingdebugging and testing
debugging and testing
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Testing and types of Testing
Testing and types of TestingTesting and types of Testing
Testing and types of Testing
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
 
Testing chapter updated (1)
Testing chapter updated (1)Testing chapter updated (1)
Testing chapter updated (1)
 
Test cases
Test casesTest cases
Test cases
 
SE2_Lec 20_Software Testing
SE2_Lec 20_Software TestingSE2_Lec 20_Software Testing
SE2_Lec 20_Software Testing
 
Quality assurance tests
Quality assurance testsQuality assurance tests
Quality assurance tests
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
 
Importance of Software testing in SDLC and Agile
Importance of Software testing in SDLC and AgileImportance of Software testing in SDLC and Agile
Importance of Software testing in SDLC and Agile
 

Similar a Ppt19

Chapter 08
Chapter 08Chapter 08
Chapter 08
guru3188
 
Presentasi testing throughout the software life cycle 2
Presentasi testing throughout the software life cycle 2Presentasi testing throughout the software life cycle 2
Presentasi testing throughout the software life cycle 2
Egi Ilham Elnusa
 
Gui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperGui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paper
Izzat Alsmadi
 

Similar a Ppt19 (20)

Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing Strategies
 
5- Requirement.ppt
5- Requirement.ppt5- Requirement.ppt
5- Requirement.ppt
 
TESTING STRATEGY.ppt
TESTING STRATEGY.pptTESTING STRATEGY.ppt
TESTING STRATEGY.ppt
 
SE CHAPTER 2 PROCESS MODELS
SE CHAPTER 2 PROCESS MODELSSE CHAPTER 2 PROCESS MODELS
SE CHAPTER 2 PROCESS MODELS
 
types of testing with descriptions and examples
types of testing with descriptions and examplestypes of testing with descriptions and examples
types of testing with descriptions and examples
 
Chapter 2_Process Models sunorgamisedASE_finalised.ppt
Chapter 2_Process Models sunorgamisedASE_finalised.pptChapter 2_Process Models sunorgamisedASE_finalised.ppt
Chapter 2_Process Models sunorgamisedASE_finalised.ppt
 
Chapter 4 Software Testing_Finalised_BW.ppt
Chapter 4 Software Testing_Finalised_BW.pptChapter 4 Software Testing_Finalised_BW.ppt
Chapter 4 Software Testing_Finalised_BW.ppt
 
Process models
Process modelsProcess models
Process models
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
 
Presentasi testing throughout the software life cycle 2
Presentasi testing throughout the software life cycle 2Presentasi testing throughout the software life cycle 2
Presentasi testing throughout the software life cycle 2
 
ch3.pptx
ch3.pptxch3.pptx
ch3.pptx
 
Unit iii(part d - component level design)
Unit   iii(part d - component level design)Unit   iii(part d - component level design)
Unit iii(part d - component level design)
 
EXTRACTING THE MINIMIZED TEST SUITE FOR REVISED SIMULINK/STATEFLOW MODEL
EXTRACTING THE MINIMIZED TEST SUITE FOR REVISED SIMULINK/STATEFLOW MODELEXTRACTING THE MINIMIZED TEST SUITE FOR REVISED SIMULINK/STATEFLOW MODEL
EXTRACTING THE MINIMIZED TEST SUITE FOR REVISED SIMULINK/STATEFLOW MODEL
 
Peter Zimmerer - Passion For Testing, By Examples - EuroSTAR 2010
Peter Zimmerer - Passion For Testing, By Examples - EuroSTAR 2010Peter Zimmerer - Passion For Testing, By Examples - EuroSTAR 2010
Peter Zimmerer - Passion For Testing, By Examples - EuroSTAR 2010
 
Chapter_25.ppt
Chapter_25.pptChapter_25.ppt
Chapter_25.ppt
 
Testing throughout the software life cycle
Testing throughout the software life cycleTesting throughout the software life cycle
Testing throughout the software life cycle
 
Test Case Optimization and Redundancy Reduction Using GA and Neural Networks
Test Case Optimization and Redundancy Reduction Using GA and Neural Networks Test Case Optimization and Redundancy Reduction Using GA and Neural Networks
Test Case Optimization and Redundancy Reduction Using GA and Neural Networks
 
Gui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperGui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paper
 
Higher Order Testing
Higher Order TestingHigher Order Testing
Higher Order Testing
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Ppt19

  • 1. Chapter 19  Testing Object-Oriented Applications Slide Set to accompany Software Engineering: A Practitioner’s Approach, 7/e by Roger S. Pressman Slides copyright © 1996, 2001, 2005, 2009 by Roger S. Pressman For non-profit educational use only May be reproduced ONLY for student use at the university level when used in conjunction with Software Engineering: A Practitioner's Approach, 7/e. Any other reproduction or use is These slides are designed to prohibited without the express written permission of the author. accompany Software Engineering: A on a website for student All copyright information MUST appear if these slides are posted use. Practitioner’s Approach, 7/e (McGraw- Hill 2009). Slides copyright 2009 by Roger Pressman. 1
  • 2. OO Testing  To adequately test OO systems, three things must be done:  the definition of testing must be broadened to include error discovery techniques applied to object- oriented analysis and design models  the strategy for unit and integration testing must change significantly, and  the design of test cases must account for the unique characteristics of OO software. These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw- Hill 2009). Slides copyright 2009 by Roger Pressman. 2
  • 3. ‘Testing’ OO Models  The review of OO analysis and design models is especially useful because the same semantic constructs (e.g., classes, attributes, operations, messages) appear at the analysis, design, and code level  Therefore, a problem in the definition of class attributes that is uncovered during analysis will circumvent side affects that might occur if These the problem were not discovered until design slides are designed to accompany Software Engineering: A or code (or even the next iteration of analysis). Practitioner’s Approach, 7/e (McGraw- Hill 2009). Slides copyright 2009 by Roger Pressman. 3
  • 4. Correctness of OO Models  During analysis and design, semantic correctness can be asesssed based on the model’s conformance to the real world problem domain.  If the model accurately reflects the real world (to a level of detail that is appropriate to the stage of development at which the model is reviewed) then it is semantically correct.  To determine whether the model does, in fact, reflect real world requirements, it should be presented to problem domain experts who will examine the class These definitions and hierarchy for omissions and ambiguity. slides are designed to accompany relationships (instance connections) are evaluated  Class Software Engineering: A to determine whether they accurately reflect real-world Practitioner’s Approach, 7/e (McGraw- object connections. Hill 2009). Slides copyright 2009 by Roger Pressman. 4
  • 5. Class Model Consistency  Revisit the CRC model and the object-relationship model.  Inspect the description of each CRC index card to determine if a delegated responsibility is part of the collaborator’s definition.  Invert the connection to ensure that each collaborator that is asked for service is receiving requests from a reasonable source.  Using the inverted connections examined in the preceding step, determine whether other classes might These be required or whether responsibilities are properly slides are designed to accompany Softwarethe classes. grouped among Engineering: A  Determine whether widely requested responsibilities Practitioner’s Approach,into a(McGraw- might be combined 7/e single responsibility. Hill 2009). Slides copyright 2009 by Roger Pressman. 5
  • 6. OO Testing Strategies  Unit testing  the concept of the unit changes  the smallest testable unit is the encapsulated class  a single operation can no longer be tested in isolation (the conventional view of unit testing) but rather, as part of a class  Integration Testing Thread-based testing integrates the set of classes required to respond  to one input or event for the system  Use-based testing begins the construction of the system by testing those classes (called independent classes) that use very few (if any) These slides are designed to of server classes. After the independent classes are tested, the next layer of classes, called dependent classes accompany Software Engineering: A of collaborating classes  Cluster testing [McG94] defines a cluster Practitioner’s Approach, 7/e the CRC and object-relationship model) (determined by examining (McGraw- is exercised by designing test cases that attempt to uncover errors Hill 2009).in the collaborations. Slides copyright 2009 by Roger Pressman. 6
  • 7. OO Testing Strategies  Validation Testing  details of class connections disappear  draw upon use cases (Chapters 5 and 6) that are part of the requirements model  Conventional black-box testing methods (Chapter 18) can be used to drive validation tests These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw- Hill 2009). Slides copyright 2009 by Roger Pressman. 7
  • 8. OOT Methods Berard [Ber93] proposes the following approach: 1. Each test case should be uniquely identified and should be explicitly associated with the class to be tested, 2. The purpose of the test should be stated, 3. A list of testing steps should be developed for each test and should contain [BER94]: a. a list of specified states for the object that is to be tested b. a list of messages and operations that will be exercised as a consequence of the test c. a list of exceptions that may occur as the object is tested d. a list of external conditions (i.e., changes in the These slides are designed to environment external to the software that must exist in order to properly conduct the test) accompany Software information that willA in understanding or e. supplementary Engineering: aid Practitioner’s Approach, 7/e (McGraw- implementing the test. Hill 2009). Slides copyright 2009 by Roger Pressman. 8
  • 9. Testing Methods  Fault-based testing  The tester looks for plausible faults (i.e., aspects of the implementation of the system that may result in defects). To determine whether these faults exist, test cases are designed to exercise the design or code.  Class Testing and the Class Hierarchy  Inheritance does not obviate the need for thorough testing of all derived classes. In fact, it can actually complicate the testing process.  Scenario-Based Test Design  Scenario-based testing concentrates on what the user does, not These slides the product does. This means capturing the tasks (via use- what are designed to accompany Software Engineering:then applying them and their cases) that the user has to perform, A variants as tests. Practitioner’s Approach, 7/e (McGraw- Hill 2009). Slides copyright 2009 by Roger Pressman. 9
  • 10. OOT Methods: Random Testing  Random testing  identify operations applicable to a class  define constraints on their use  identify a minimum test sequence • an operation sequence that defines the minimum life history of the class (object)  generate a variety of random (but valid) test sequences • exercise other (more complex) class instance life These slides are designed to histories accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw- Hill 2009). Slides copyright 2009 by Roger Pressman. 10
  • 11. OOT Methods: Partition Testing  Partition Testing  reduces the number of test cases required to test a class in much the same way as equivalence partitioning for conventional software  state-based partitioning • categorize and test operations based on their ability to change the state of a class  attribute-based partitioning • categorize and test operations based on the attributes that they use  category-based partitioning These slidescategorize and test operations based on the generic function • are designed to each performs accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw- Hill 2009). Slides copyright 2009 by Roger Pressman. 11
  • 12. OOT Methods: Inter-Class Testing  Inter-class testing  For each client class, use the list of class operators to generate a series of random test sequences. The operators will send messages to other server classes.  For each message that is generated, determine the collaborator class and the corresponding operator in the server object.  For each operator in the server object (that has been invoked by messages sent from the client object), determine the messages that it transmits.  For each of the messages, determine the next level of These slides arethat are invoked and incorporate these into the operators designed to test sequence accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw- Hill 2009). Slides copyright 2009 by Roger Pressman. 12
  • 13. OOT Methods: Behavior Testing The tests to be empty set up designed should open acct setup Accnt acct achieve all state coverage [KIR94]. deposit (initial) That is, the deposit operation sequences should working acct cause the balance credit withdraw Account class to accntInfo make transition withdrawal through all (final) These slides states allowable are designed to dead nonworking acct acct accompany Software Engineering: A close Practitioner’s Approach, 7/e at(McGraw-class (adapt ed f rom [ KIR94] ) Figure 14.3 St e diagram f or Account Hill 2009). Slides copyright 2009 by Roger Pressman. 13