Integration testing

1

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
2

i. 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 The system is fully integrated togethr All the test cases have been executed All the severe and moderated defects found have been fixed 3  Integration testing is said to be complete when    .e..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.

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

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

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

Incremental integration testing A A T1 A T2 B T3 C T4 D T5 B T3 C T4 T2 B T3 T1 T2 T1 T sequence1 est T sequence2 est T sequence3 est .

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

– usually ends in ‘big-bang’ – system dies miserably… Entry criteria – all components have passed unit testing Exit criteria – Test suite passes 11 .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.

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

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 .

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

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 .

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

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

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.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. stubs and drivers are needed .

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 A Layer I C D Layer II Test E Bottom Layer Tests Test B. F. C. E. D. G Top Layer Tests Test A .C.B. E. D Test A. B.G Test A. F E B F G Layer III Test F Test G Test D.

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 Table 7.4: A framework for system integration entry criteria 23 .

5: A framework for system integration exit criteria 24 .Test Plan for System Integration Table 7.

THANK YOU 25 .