1 / 31

OBJECT ORIENTED TESTING

OBJECT ORIENTED TESTING. SYSTEM TESTING. INHERITANCE. INTEGRATION TESTING. POLYMORPHISM. ENCAPSULATION. UNIT TESTING. By Maj Nicko Petchiny. REFERENCES. Developing an OO Software Testing and Maintenance Environment (King, Gao, Hsia, et-al)

walt
Download Presentation

OBJECT ORIENTED TESTING

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OBJECT ORIENTED TESTING SYSTEM TESTING INHERITANCE INTEGRATION TESTING POLYMORPHISM ENCAPSULATION UNIT TESTING By Maj Nicko Petchiny

  2. REFERENCES • Developing an OO Software Testing and Maintenance Environment (King, Gao, Hsia, et-al) • Incremental Testing of OO Class Structures (Harrold, McGregor) • OO Integration Testing (Jorgensen, Ericksen) • OO Software Testing, A Hierarchical Approach (Siegel)

  3. OUTLINE • TRADITIONAL VS OO SW DEVELOPMENT AND TESTING • OO CONCEPTS/EFFECT ON TESTING • PROPOSED OO INTEGRATION TESTING APPROACH • EXAMPLE USING TEST APPROACH • CONCLUSION

  4. TRADITIONAL DEVELOPMENT & TESTING (WATERFALL LIFE CYCLE) • REQUIREMENTS SPEC SYSTEM TESTING • PRELIMINARY DESIGN INTEGRATION TESTING • FUNCTIONAL • DECOMPOSITION • DETAILED DESIGN UNIT TESTING

  5. TRADITIONAL TESTING • SYSTEM • VERIFY SW SATISFIES ALL SW REQRS • INTEGRATION • BASED ON STRUCTURE OF DESIGN • TOP DOWN OR BOTTOM UP APPROACH • UNIT • ENCAPSULATES FUNCTIONALITY

  6. OO DEVELOPMENT & TESTING • DEVELOPMENT BASED ON BEHAVIOUR • COMPOSITION • TYPICALLY RAPID PROTOTYPING • INCREMENTAL APPROACH • 3 TRADITIONAL TESTING LEVELS ARE NOT AS CLEARLY DEFINED

  7. OBJECT ORIENTED TESTING • SYSTEM • SAME AS TRADITIONAL • STILL BASED ON REQRS SPEC • UNIT • TWO COMMON STRUCTURES USED • METHOD* • CLASS • SAME AS TRADITIONAL(DRIVERS & STUBS)

  8. F OBJECT CLASS A METHOD 1 METHOD METHOD 2 E METHOD B C D METHOD METHOD METHOD

  9. F OBJECT CLASS A METHOD 1 METHOD METHOD 2 E METHOD D B C METHOD METHOD METHOD

  10. OO INTEGRATION TESTING • MAIN PROGRAM IS MINIMIZED • MOST COMPLICATED PART OF OO TESTING • TESTING BASED ON COMPOSITION IN BOTTOM UP APPROACH • USE OF CLUSTERS • ORD - CLASS DEPENDENCIES • BBD OR DIRECTED GRAPHS - SHOWS METHOD DEPENDENCIES

  11. A OUTPUT PORT EVENT Class 3 Class 1 A meth2 meth1 1 meth1 meth2 meth3 B B OUTPUT PORT EVENT Class 2 2 meth1 meth3 3 MM-Path meth2 Message

  12. OO CONCEPTS/EFFECTS ON TESTING • ENCAPSULATION • POLYMORPHISM • INHERITANCE

  13. ENCAPSULATION • CLASS STRUCTURE • INTERFACE DEFINED BY PUBLIC METHODS • BEHAVIOR DEFINED BY METHODS THAT OPERATE ON ITS INSTANCE DATA (IN CONVENTIONAL SEPARATE) • HELPS ENFORCE INFO HIDING

  14. 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)

  15. CLASS A CLASS C METHOD METHOD USES USES CLASS B METHOD

  16. 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

  17. 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

  18. INHERITANCE STRUCTURES SINGLE MULTIPLE MULTIPLE LEVELS BASE BASE BASE BASE SUBCLASS SUBCLASS SUBCLASS SUBCLASS

  19. INHERITANCE RESULT CLASS PARENT CLASS + MODIFIER

  20. INHERITANCE B C A A B + A M1 B + C M1 B C + + M2 M2

  21. INHERITANCE MODIFIERS • NONE (ONLY INHERITED ATTRIBUTE) • ADD NEW ATTRIBUTE(S) • REDEFINE PARENT’S ATTRIBUTE(S) • VIRTUAL ATTRIBUTE (THREADS IN JAVA)

  22. 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?

  23. INHERITED TESTING

  24. OO TESTING METHODOLOGY • JORGENSEN AND ERICKSEN PROPOSE 5 LEVELS • A METHOD - UNIT TESTING • MESSAGE QUIESCENCE - INTEGRATION • EVENT QUIESCENCE - INTEGRATION • THREAD TESTING -SYSTEM • THREAD INTERACTION -SYSTEM

  25. CONSTRUCT DEFINITIONS • MM-PATH (METHOD MESSAGE - PATH) [MESSAGE QUIESCENCE] • SEQUENCE OF EXECUTIONS LINKED BY MESSAGES. • STARTS WITH METHOD AND ENDS WITH A METHOD THAT DOESN’T PRODUCE A MESSAGE

  26. CONSTRUCT DEFINITIONS • ASF (ATOMIC SYSTEM FUNCTION) [EVENT QUIESCENCE] • REPRESENTS AN INPUT EVENT • FOLLOWED BY A SET OF MM-PATHS • TERMINATED BY AN OUPUT EVENT

  27. INPUT PORT EVENT A OUTPUT PORT EVENT Class 3 Class 1 A meth2 meth1 1 meth1 meth2 meth3 B B ASF INPUT PORT EVENT ASF OUTPUT PORT EVENT Class 2 2 meth1 meth3 3 MM-Path meth2 Message

  28. ATM PIN ENTRY • CUSTOMER ENTERS CARD(EVENT) • SCREEN REQUESTING PIN ENTRY IS DISPLAYED • AN INTERLEAVED SEQUENCE OF DIGIT KEY TOUCHES WITH AUDIBLE AND VISUAL FEEDBACK • POSSIBILITY OF CANCELLATION BY CUSTOMER • SYSTEM DISPOSITION(VALID PIN OR CARD RETAINED)

  29. CARDSLOT BANK SCREEN SECURITY SpecialKeypad Keypad NumKeypad

  30. ASF Starts here ASF ends here Customer inserts card Message is displayed CardSlot Screen memberCard showMessage ValidateCard Key pushers Security NumKeypad checkPin getKeyEvents Bank parseKeyEvent pinForPan

  31. 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 • LIMIT DESIGNERS TO STRAIGHT INHERITANCE (NO REDEFINING)

More Related