Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "OBJECT ORIENTED TESTING SYSTEM TESTING UNIT TESTING INTEGRATION TESTING INHERITANCE POLYMORPHISM ENCAPSULATION By Maj Nicko Petchiny."— Presentation transcript:

1 OBJECT ORIENTED TESTING SYSTEM TESTING UNIT TESTING INTEGRATION TESTING INHERITANCE POLYMORPHISM ENCAPSULATION 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 METHOD 2 METHOD 1 METHOD OBJECT CLASS A BCD E F

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

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 meth1 meth3meth2 Class 1 A B OUTPUT PORT EVENT A meth1 meth3 meth2 meth1 B OUTPUT PORT EVENT Class 2 Class 3 MM-Path Message 1 2 3

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 METHOD CLASS A CLASS B CLASS C METHOD USES

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 BASE SUBCLASS SINGLE BASE SUBCLASS BASE MULTIPLEMULTIPLE LEVELS

19 INHERITANCE PARENT CLASS MODIFIER + RESULT CLASS

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

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 meth1 meth3meth2 Class 1 INPUT PORT EVENT A B ASF INPUT PORT EVENT OUTPUT PORT EVENT A meth1 meth3 meth2 meth1 B ASF OUTPUT PORT EVENT Class 2 Class 3 MM-Path Message 1 2 3

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 BANK CARDSLOT SECURITY SCREEN Keypad SpecialKeypad NumKeypad

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

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)


Download ppt "OBJECT ORIENTED TESTING SYSTEM TESTING UNIT TESTING INTEGRATION TESTING INHERITANCE POLYMORPHISM ENCAPSULATION By Maj Nicko Petchiny."

Similar presentations


Ads by Google