OBJECT ORIENTED TESTING - IT Telkom

Document Sample
OBJECT ORIENTED TESTING - IT Telkom Powered By Docstoc
					  Object Oriented Testing Agendas :

SYSTEM TESTING
                              INHERITANCE




 INTEGRATION                 POLYMORPHISM
 TESTING




UNIT TESTING                ENCAPSULATION
              Testing OO Code
Class tests                     Integration
                                   tests




System                             Validation
 tests                               tests
           Testing Definition

To tell somebody that he is wrong is
called criticism. To do so officially is
called testing.

(softwarefundamentals.com)
       Signs That You're Dating A Tester


Your love letters get returned to you marked up with red ink, highlighting
your grammar and spelling mistakes.

When you ask him how you look in a dress, he'll actually tell you.

He won't help you change a broken light bulb because his job is simply to
report and not to fix.

He'll keep bringing up old problems that you've since resolved just to make
sure that they're truly gone.
        Is this worthed ?




Taken from http://www.softwaretestinginstitute.com/
                        Experience Counts
There was a software tester who had an exceptional gift for finding bugs. After serving
his company for many years, he happily retired. Several years later, the company
contacted him regarding a bug in a multi-million-dollar application which no one in the
company was able to reproduce. They tried for many days to replicate the bug but
without success.

In desperation, they called on the retired software tester and after much persuasion he
reluctantly took the challenge.

He came to the company and started studying the application. Within an hour, he
provided the exact steps to reproduce the problem and left. The bug was then fixed.

Later, the company received a bill for $50,000 from the software tester for his service.
The company was stunned with the exorbitant bill for such a short duration of service
and demanded an itemized accounting of his charges.

The software tester responded with the itemization:
Bug Report: $1

Knowing where to look: $49,999
         TRADITIONAL TESTING
• SYSTEM
  – VERIFY SW SATISFIES ALL SW REQRS

• INTEGRATION
  – BASED ON STRUCTURE OF DESIGN
  – TOP DOWN OR BOTTOM UP APPROACH

• UNIT
  – ENCAPSULATES FUNCTIONALITY
    OO DEVELOPMENT & TESTING
•   DEVELOPMENT BASED ON BEHAVIOUR
•   COMPOSITION
•   TYPICALLY RAPID PROTOTYPING
•   INCREMENTAL APPROACH
•   3 TRADITIONAL TESTING LEVELS ARE NOT AS
    CLEARLY DEFINED
    OBJECT ORIENTED TESTING
• SYSTEM
  – SAME AS TRADITIONAL
  – STILL BASED ON REQRS SPEC
• UNIT
  – TWO COMMON STRUCTURES USED
    • METHOD*
    • CLASS
  – SAME AS TRADITIONAL
  OBJECT CLASS A                 F

      METHOD 1              METHOD

 METHOD 2
                                 E


                            METHOD



  B                  C       D


METHOD             METHOD   METHOD
  OBJECT CLASS A                 F

      METHOD 1              METHOD

 METHOD 2
                                 E


                            METHOD



  B                  C       D


METHOD             METHOD   METHOD
   OO INTEGRATION TESTING
• MAIN PROGRAM IS MINIMIZED

• MOST COMPLICATED PART OF OO TESTING

• TESTING BASED ON COMPOSITION IN
  BOTTOM UP APPROACH

• USE OF CLUSTERS
 OO CONCEPTS/EFFECTS ON TESTING
• ENCAPSULATION

• POLYMORPHISM

• INHERITANCE
  ENCAPSULATION TESTING ISSUES
• MINIMIZES RIPPLE EFFECT (AT THE UNIT
  LEVEL) OF MAKING A CHANGE

• HIGHLY DELOCALIZED
  – CHANGE COULD RESULT IN SIGNIFICANT
    REGRESSION TESTING

• ORDER OF TESTING IS IMPORTANT (CAN
  REDUCE TESTING EFFORT)
CLASS A             CLASS C

METHOD              METHOD




 USES                 USES

          CLASS B
          METHOD
            POLYMORPHISM
• AN ATTRIBUTE MAY HAVE MORE THAN ONE
  SET OF VALUES
• AN OPERATION MAY BE IMPLEMENTED BY
  MORE THAN ONE METHOD ( e.g GRAPHICS )
• OVERLOADING (type or number of variables)
• DYNAMIC BINDING
           OO TESTING ISSUES
• POLYMORPHISM
  – DO YOU TEST ONE VARIANT ?
  – DO YOU TEST ALL VARIATIONS ?
  – IF ALL, DO YOU TEST ALL VARIANTS AT ALL LEVELS
    • UNIT
    • “INTEGRATION” OR SYSTEM LEVEL
  – REUSE DRIVERS AND STUBS
          INHERITANCE STRUCTURES

 SINGLE                MULTIPLE          MULTIPLE LEVELS


 BASE           BASE              BASE        BASE



                                             SUBCLASS


SUBCLASS           SUBCLASS


                                             SUBCLASS
INHERITANCE

  RESULT CLASS



 PARENT CLASS

      +

   MODIFIER
    INHERITANCE
                  B
       C
A                 A
       B
                  +
       A          M1
B
       +          C
       M1
                  B
C
        +
                  +
       M2
                  M2
        OO TESTING ISSUES
• INHERITANCE
  – DO YOU COMPLETELY TEST ALL BASE CLASSES AND
    THEIR SUB-CLASSES ?
  – DO YOU COMPLETELY TEST ALL BASE CLASSES AND
    ONLY TEST THE CHANGES OR MODIFICATIONS IN
    THEIR SUB-CLASSES ?
  – AT WHAT LEVELS DO YOU TEST?
  – IN WHICH ORDER DO YOU TEST?
     INHERITED TESTING
   SCENARIO          UNIT   INTEGRATION
     NONE                       X?
      NEW             X         X?
   REDEFINED          X         X
VIRTUAL (COMPLETED    X         X?
   BY SUBCLASS)
  VIRTUAL ( NOT
    COMPLETED)
         CONCLUSION
• OO TESTING LEVELS- UNIT &SYSTEM
  SAME AS TRADITIONAL LEVELS
• OO INTEGRATION TESTING IS
  DIFFERENT AND MORE COMPLEX
• OPTIMAL TEST ORDER SAVES
• TOOLS REQUIRED TO SCALE UP OO
  TESTING

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:12
posted:6/20/2013
language:
pages:24