SENG8040_Lesson06_IntegrationTesting1.pptx
Document Details
Uploaded by WorthwhileNephrite1844
Full Transcript
SENG8041 Testing Methodologies Integration Testing Today’s Lesson… From the Course Outline: 4.0 4.1 Integration Testing Define the concept of Integration Testing and its position within the SDLC. 4.2 Discuss the relationships between the various forms of Integration Testing. 4.3 Analyze...
SENG8041 Testing Methodologies Integration Testing Today’s Lesson… From the Course Outline: 4.0 4.1 Integration Testing Define the concept of Integration Testing and its position within the SDLC. 4.2 Discuss the relationships between the various forms of Integration Testing. 4.3 Analyze the interactions between two or more code modules and develop a set of integration tests to ensure proper code coverage. 4.4 Examine cases where Integration Testing can be paired with Performance Testing at an early stage of development to ensure proper response times and system utilization. Discussion: What is Integration Testing? Compared to Unit Testing, what do you think Integration Testing is? Unit Testing Unit tests test small program units or modules of a software system Often individual classes or small components such as methods Unit tests are: Fully automated Easy to develop using a framework such as Jest Execute quickly Provide good test coverage However… Unit Tests Alone Are Not Enough Your classes and their methods may be implemented correctly They are well-tested individually However, that doesn't mean your system's components – made of many classes – are built to work together properly We need to test modules working in combination Testing Level Unit Testing Individual program units, such as procedures, functions, methods in isolation Integration Testing Modules are assembled to construct a larger subsystem and tested Development and testing phases in the V model Unit Test vs Integration Test 7 of 49 Integration Testing In integration testing, also called integration and testing (I&T), the different components of a software application are tested together as a single unit. Despite this, these modules may be coded by different programmers. Integration testing aims to discover any defects that may arise when the modules are integrated and must interact with each other. Integration Testing is also known as string testing or thread testing. 8 of 49 About Integration Testing Construction of a working system from the pieces is not a straightforward task because of numerous interface errors 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 Complete Integration Testing Integration testing is said to be complete when important behaviours are fully described. …doesn't this seem familiar? it is! The complexity with Integration is usually the infrastructure. The base idea of a good test is still the same We just have a different focus now. Result The system is fully integrated together All the test cases have been executed All the severe and moderated defects found have been fixed Advantages of Integration Testing The testing process is relatively fast Code coverage is high An efficient method of detecting system-level issues The early stages of development enable it to detect bugs early Granularity of Integration Testing System integration testing is performed at different levels of granularity Intra-system testing This form of testing constitutes low-level integration testing with the objective of combining the modules together to build a cohesive system Granularity of Integration Testing (continued) Inter-system testing It is a high-level testing phase which requires interfacing independently tested systems Pairwise testing In pairwise integration, only two interconnected systems in an overall system are tested at a time The purpose of pairwise testing is to ensure that two systems under consideration can function together, assuming that the other systems within the overall environment behave as expected Example of Integration Test Mail Box: Check its integration to the Delete Mails Module. 14 of 49 Common Approaches to Integration Testing Common approaches to perform system integration testing Incremental Top-down Bottom-up Sandwich Big-bang Common Approaches to Integration Testing 16 of 49 Incremental System Integration Testing Integration testing is conducted in an incremental manner as a series of test cycles In each test cycle, a few more modules are integrated with an existing and tested build to generated larger builds The complete system is built, cycle by cycle until the whole system is operational for system-level testing Top-Down Integration Testing Module A has been decomposed into modules B, C, and D Modules B, D, E, F, and G are terminal modules First, integrate modules A and B using stubs C' and D' Next, Two replace stub D' with its actual instance D kinds of tests are performed: Test the interface between A and D Regression tests to look for interface defects between A and B in the presence of module D Top-Down Integration Testing(cont) ▪ Stub C` has been replaced with the actual module C, and new stubs E`, F`, and G` are incorporated ▪ Perform tests as follows: ▪ first, test the interface between A and C; ▪ second, test the combined modules A, B, and D in the presence of C ▪ The rest of the process depicted in the right hand side figures. Top-Down Integration Advantages Advantages The engineers continually observe system-level functions as the integration process continues Isolation of interface errors becomes easier because of the incremental nature of the top-down integration Test cases designed to test the integration of a module M are reused during the regression tests performed after integrating other modules Top-Down Integration Testing Disadvantages Disadvantages It may not be possible to observe meaningful system functions because of an absence of lower level modules and the presence of stubs Test case selection and stub design become increasingly difficult when stubs lie far away from the top-level module Bottom-Up Integration Testing We design a test driver to integrate lowest-level modules E, F, and G Return values generated by one module are likely to be used in another module The test driver mimics module C to integrate E, F, and G in a limited way. A new test driver is used At this moment, more modules such as B and D are integrated Bottom-Up Integration Testing(cont.) The new test driver mimics the behavior of module A Finally, the test driver is replaced with module A and further tests are performed Bottom-Up Integration Testing Advantages Advantages One designs the behavior of a test driver by simplifying the behavior of the actual module If the low-level modules and their combined functions are often invoked by other modules, then it is more useful to test them first so that meaningful effective integration of other modules can be done Bottom-Up Integration Testing Disadvantages Disadvantages Discovery of major faults are detected towards the end of the integration process, because major design decision are usually embodied in the top-level modules Engineers cannot observe system-level functions from a partly integrated system – in fact, they cannot observe system-level functions until the top-level test driver is in place Big Bang Integration Testing First, all the modules are individually tested with unit tests all those modules are put together to construct the entire system, which is tested as a whole A Second, Because of integrating everything at one time if any failures occurs, it is difficult to know the root cause of that failure If a bug arises then the integrated modules must be detached in order to find the cause of the bug Generally executed by developers who follow a 'Run it and see' approach D System C B Big Bang Integration Testing Trade-offs Advantages: Empirical studies have shown that top-down and big- bang strategies result in the most reliable systems Big Bang testing has the advantage that everything is finished before integration testing starts Big Bang Integration Testing Trade-offs (continued) Disadvantages: Can result in difficult problem determination since all software must be considered suspect Almost all big-bang tests will result in (some) errors ▪ Large projects may have many interface errors ▪ A large number of errors makes it very difficult to track and monitor testing progress Can be very time consuming If any bug is found then it is very difficult to detach all the modules in order to find out the root cause of it Sandwich Integration Testing In this approach a system is integrated using a mix of top-down, bottom-up, and big-bang approaches A hierarchical system is viewed as consisting of three layers Layer III The bottom-up approach is applied to integrate the modules in the bottom-layer The top layer modules are integrated by using top-down approach The middle layer (also known as the target layer) is integrated by using the big-bang approach after the top and the bottom layers have been integrated Sandwich and bottom-up tend to be used in practice most often Sandwich strategy results in moderately reliable systems Layer II Layer I Sandwich Integration Testing Trade-offs Advantages Top and bottom layer tests can be done in parallel No stubs or drivers are required ▪ Saves development time Sandwich Integration Testing Trade-offs (continued) Disadvantages Does not test the individual subsystems on the target layer thoroughly before integration ▪ Modules B and D, in our example System Integration Test Plans Categories of System Integration Tests: Interface integrity ▪ Internal and external interfaces are tested as each module is integrated Functional validity ▪ Tests to uncover functional errors in each module after it is integrated End-to-end validity ▪ Tests are designed to ensure that a completely integrated system works together from end-toend Pairwise validity ▪ Tests are designed to ensure that any two systems work properly when connected by a network Interface stress ▪ Tests are designed to ensure that the interfaces can sustain the load System endurance ▪ Tests are designed to ensure that the integrated system stay up for weeks Thank You! Any questions?