INTEGRATION TESTING

Views:
 
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Integration testing:

1 Integration testing

Testing:

2 Testing What is the overall goal of testing? What claims can we make when testing "passes" or "fails" ? Can we prove that our code has no bugs? testing : systematic attempt to reveal the presence of errors (to "falsify" system) accomplished by exercising defects in the system and revealing problems failed test: an error was demonstrated passed test: no error was found, so far not used to show absence of errors in software does not directly reveal the actual bugs in the code

The Concept of Integration Testing:

The Concept of Integration Testing A software module is a self-contained element of a system Modules are individually tested commonly known as unit testing Next major task is to put the modules, i.e., pieces together to construct the complete system The objective of system integration testing (SIT) is to build a “working” version of the system Putting modules together in an incremental manner Ensuring that the additional modules work as expected without disturbing the functionalities of the modules already put together Integration testing is said to be complete when The system is fully integrated togethr All the test cases have been executed All the severe and moderated defects found have been fixed 3

The Concept of Integration Testing:

The Concept of Integration Testing The major advantages of conducting SIT are as follows: Defects are detected early It is easier to fix defects detected earlier We get earlier feedback on the health and acceptability of the individual modules and on the overall system Scheduling of defect fixes is flexible, and it can overlap with development 4

Steps in Integration-Testing:

Steps in Integration-Testing . 1. Based on the integration strategy, select a component to be tested. Unit test all the classes in the component. 2. Put selected component together; do any preliminary fix-up necessary to make the integration test operational (drivers, stubs) 3. Do functional testing: Define test cases that exercise all uses cases with the selected component 4. Do structural testing: Define test cases that exercise the selected component 5. Execute performance tests 6. Keep records of the test cases and testing activities. 7. Repeat steps 1 to 7 until the full system is tested. The primary goal of integration testing is to identify errors in the (current) component configuration.

Which Integration Strategy should you use?:

Which Integration Strategy should you use ? Factors to consider Amount of test harness (stubs &drivers) Location of critical parts in the system Availability of hardware Availability of components Scheduling concerns Bottom up approach good for object oriented design methodologies Test driver interfaces must match component interfaces ... ...Top-level components are usually important and cannot be neglected up to the end of testing Detection of design errors postponed until end of testing Top down approach Test cases can be defined in terms of functions examined Need to maintain correctness of test stubs Writing stubs can be difficult

System Integration Techniques:

System Integration Techniques Common approaches to perform system integration testing Top-down (from higher levels  no test drivers are needed) Bottom-up (from lower levels  No test stubs necessary ) Sandwich (combination of bottom-up and top-down  no test stubs and drivers needed) Big-bang (all components together) Pre-requisite A module must be available to be integrated A module is said to available for combining with other modules when the module’s check-in request form is ready 7

Check-in Request Form:

Check-in Request Form 8

Incremental integration testing:

Incremental integration testing

Integration Testing: Big-Bang Approach:

Integration Testing: Big-Bang Approach Unit Test F Unit Test E Unit Test D Unit Test C Unit Test B Unit Test A System Test

BIG BANG :

BIG BANG Intent – demonstrate stability by attempting to exercise an entire system with a few test runs Context – bring all components together all at once. All interfaces tested in one go. – usually ends in ‘big-bang’ – system dies miserably… Entry criteria – all components have passed unit testing Exit criteria – Test suite passes 11

BIG BANG:

BIG BANG Consequences – Fails – then what? Failure diagnosis is very difficult. – Even if exit criteria met, many interface faults can still hide. 12

Bottom Up:

Bottom Up Entry criteria – components pass unit tests Exit criteria – interface for each subcomponent has been exercised at least once – complete when all root-level components pass test suites 13

Bottom-up Integration:

Bottom-up Integration A B C D G F E Layer I Layer II Layer III Test F Test E Test G Test C Test D,G Test B, E, F Test A, B, C, D, E, F, G

Pros and Cons of bottom up integration testing:

Pros and Cons of bottom up integration testing Bad for functionally decomposed systems: Tests the most important subsystem (UI) last Useful for integrating the following systems Object-oriented systems real-time systems systems with strict performance requirements

Top-down Testing Strategy:

Top-down Testing Strategy Test the top layer or the controlling subsystem first Then combine all the subsystems that are called by the tested subsystems and test the resulting collection of subsystems Do this until all subsystems are incorporated into the test Special program is needed to do the testing, Test stub : A program or a method that simulates the activity of a missing subsystem by answering to the calling sequence of the calling subsystem and returning back fake data.

Top-down Integration Testing:

Top-down Integration Testing A B C D G F E Layer I Layer II Layer III Test A Layer I Test A, B, C, D Layer I + II Test A, B, C, D, E, F, G All Layers

Pros and Cons of top-down integration testing:

Pros and Cons of top-down integration testing Test cases can be defined in terms of the functionality of the system (functional requirements) Writing stubs can be difficult: Stubs must allow all possible conditions to be tested. Possibly a very large number of stubs may be required, especially if the lowest level of the system contains many methods. One solution to avoid too many stubs: Modified top-down testing strategy Test each layer of the system decomposition individually before merging the layers Disadvantage of modified top-down testing: Both, stubs and drivers are needed

Sandwich Testing Strategy:

Sandwich Testing Strategy Combines top-down strategy with bottom-up strategy The system is view as having three layers A target layer in the middle A layer above the target A layer below the target Testing converges at the target layer How do you select the target layer if there are more than 3 layers? Heuristic: Try to minimize the number of stubs and drivers

Sandwich Testing Strategy:

Sandwich Testing Strategy A B C D G F E Layer I Layer II Layer III Test E Test D,G Test B, E, F Test A, B, C, D, E, F, G Test F Test G Test A Bottom Layer Tests Top Layer Tests Test A,B,C, D

Pros and Cons of Sandwich Testing:

Pros and Cons of Sandwich Testing Top and Bottom Layer Tests can be done in parallel Does not test the individual subsystems thoroughly before integration Solution: Modified sandwich testing strategy

Test Plan for System Integration:

22 Test Plan for System Integration

Test Plan for System Integration:

23 Test Plan for System Integration Table 7.4: A framework for system integration entry criteria

Test Plan for System Integration:

24 Test Plan for System Integration Table 7.5: A framework for system integration exit criteria

THANK YOU:

THANK YOU 25