05 integration testing

33
Integration Testing G Ramesh [email protected]

Upload: pranky27

Post on 19-Jun-2015

129 views

Category:

Software


0 download

TRANSCRIPT

2. What is Integration Testing Methods of performing integration testing Description of method Where applicable Challenges to be expected 2 Todays Agenda Integration Testing 3. Componentized Development Many teams work together to develop parts to work together Expectation of Standardized environments Plug-n-play Change Management Ability of a dependent module to adapt to change Ability of a independent module to know what a dependent module wants 3 What is Integration Testing: Software Development Scenario 4. Communication gap among the participating teams Poor change management Plug-n-play becoming plug-n-pray! 4 Realities in the Software Development Scenario 5. The whole is greater than the sum of the parts! Even if each component works by itself, an interface of a component to other components may not work 5 Integration Testing 6. Compatibility refers to integration with the environment Database version Network drivers version OS version Compatibility testing is covered as part of Black Box Testing 6 Inter-operability / compatibility Vs Integration 7. How different components of software work together Example AR / AP software integrating with GL Personnel system integrating with Payroll software integrating with Bank Autocredit Railway reservation system integrating with payment gateways which in turn integrates with external logistics system 7 Integration Testing 8. Semantic differences Inconsistent codes Incorrect positional parameters Architectural differences Little endian / Big endian Data item sizes being different Alignment issues Marshalling of data types Side effects and implicit assumptions Global variables Compounded loss of precision 8 Why would integration fail? 9. Dependencies Schedules Resources 9 What factors affect integration testing? 10. Non-incremental Big Bang Incremental Top Down Bottom Up Sandwich integration 10 Methods of Integration 11. Complete all the components Put all of them together in a melting pot Test them all together in one go at the end, when everything is ready 11 Non Incremental Integration Testing: Big Bang Integration 12. Real life use of products? Removes duplication of effort in testing Makes sense when there are a few static modules and features get added on incrementally 12 Big Bang: Advantages? 13. Delay between defect injection and defect detection Failure location whose problem is it? Deadline pressure in the end Inefficient use of slack time Chain being as strong (or as fast) as its weakest link 13 Big Bang: Challenges and Disadvantages 14. Construct and test the program in small segments Errors become easier to isolate and correct Interfaces can get tested more thoroughly A systematic test approach may be applied Lends itself to synchronizing with product plans Three types Top down Bottom up Sandwich 14 Incremental Testing 15. Modules are integrated by moving downwards through the control hierarchy Begins with the main program (main control module) Modules sub-ordinate (directly or transitively) to the main module are integrated Depth first or Breadth first 15 Top Down Integration 16. 16 Example for Top Down Integration M1 M2 M3 M4 M5 M6 M8 M7 17. M1-M2-M5-M8 M1-M2-M6 M1-M3-M7 M1-M4 The full set 17 Top Down, Depth First 18. M1 with M2, M3 and M4 Integrate M5, M6 and M7 Integrate M8 18 Top Down Breadth First 19. How can I integrate M2 to M1 when M5 is not ready? How can I integrate M5 to M2 when M8 is not ready? A stub provides the mechanism to overcome this 19 The Need For Stubs 20. Placeholders for the modules yet to be completed A stub simulates the interface before it is actually ready Typically done by table lookups or hard coded return values When a module gets ready and the corresponding interface is available, the stub is replaced by the real module 20 Stubs 21. Start with the main control module Substitute stubs for all modules directly subordinate to the main control module Depending on integration approach (breadth first / depth first) replace subordinate stubs by actual modules, one at a time Test each integrated part as it gets integrated On completing the test, replace the next stub by the corresponding module and repeat the process from the second step Perform regression testing as necessary to make sure no older defects creep up (covered later) 21 Process for Top Down Integration 22. When the program is well structured When all the decision making happens at the upper levels while the lower levels or worker tasks When there is a pressing need to uncover major control problems early When you want to have demo versions or prototypes with empty can functionality 22 When Top Down Will be applicable.. 23. When lower levels are logic-rich and hence stubs wont do Stubs allow very little data / information flow upwards other than acting as a black box Stubs need to be increasingly sophisticated, almost re-introducing the complexity of development back 23 Challenges in Top Down Testing 24. 24 Levels of complexities of stubs to make integration testing effective.. Stub A Stub B Stub C Stub D Display a trace message Display passed parameter Return a value From a table Do a table search on the input value and pass on associated output value 25. Delay testing till reasonable number of real modules are available Approaches the disadvantages of Big Bang Develop stubs that function parts of the actual module Use the appropriate level of stub discussed Integrate the software from bottom up Leads us to the Bottom Up integration 25 What are some of the solutions? 26. Low Level Modules are combined into clusters or builds that perform a specific sub-function A driver (a control program for testing) is written to co-ordinate the inputs and outputs The cluster is tested Drivers are removed and clusters are combined moving upwards in the program structure 26 Bottom Up Integration 27. 27 Levels of complexities of drivers to make integration testing effective.. Driver A Driver B Driver C Driver D Invoke a Sub-ordinate Send parameter Display a Parameter Combine B & C 28. especially at lower levels As we move higher up, drivers become less of an issue 28 Drivers can also become more and more complicated 29. Top down Major disadvantage: stubs Major advantage: Early control testing Bottom up: Major disadvantage: Delays Major advantage: Absence of stubs Use a combination of top-down and bottom up methods to get the best of both worlds sandwich testing 29 Practical Approach 30. Identify critical modules Addresses several software requirements Is fairly high up in the structure Has a high level of control Is complex or error prone (cyclomatic complexity) Has definite performance requirements Integrate critical modules as early as possible Test the critical modules as often as possible (even if integrated early) 30 Practical Approach (contd) 31. Incremental changes, feature-wise development Big Bang Clear requirements Top down Dynamically changing requirements, design Bottom up Changing architecture, stable design Bi-directional 31 When to use what? 32. Scenario based testing Use case development Defect Bash Levels of defect bash 32 Other methods of integration testing 33. What is Integration Testing Methods of performing integration testing Description of method Where applicable Challenges to be expected 33 Todays Agenda (Recap) Integration Testing