integration testing path based
play

Integration Testing Path Based Chapter 13 Call graph based - PowerPoint PPT Presentation

Integration Testing Path Based Chapter 13 Call graph based integration Use the call graph instead of the decomposition tree What is a call graph? IntP2 Call graph definition Is a directed, labeled graph Vertices are methods


  1. Integration Testing Path Based Chapter 13

  2. Call graph based integration  Use the call graph instead of the decomposition tree  What is a call graph? IntP–2

  3. Call graph definition  Is a directed, labeled graph  Vertices are methods  A directed edge joins calling vertex to the called vertex  Adjacency matrix is also used  Does not scale well, although some insights are useful  Nodes of high degree are critical IntP–3

  4. SATM call graph example 5 Look at adjacency 1 7 matrix p204 20 21 22 16 9 4 10 13 12 11 17 18 19 23 24 26 27 25 6 8 2 3 14 15 IntP–4

  5. Call graph integration strategies  What types of integration strategies are used? IntP–5

  6. Call graph integration strategies – 2  What types of integration strategies are used?  Pair-wise Integration Testing  Neighborhood Integration Testing IntP–6

  7. Pair-wise integration  What is pair-wise integration IntP–7

  8. Pair-wise integration session example Some Pair-wise Integration Sessions 5 1 7 20 21 22 16 9 4 10 13 12 11 17 18 19 23 24 26 27 25 6 8 2 3 14 15 IntP–8

  9. Pair-wise integration – 2  The idea behind Pair-Wise integration testing  Eliminate need for developing stubs / drivers  Use actual code instead of stubs/drivers IntP–9

  10. Pair-wise integration – 3  In order not to deteriorate the process to a big-bang strategy  Restrict a testing session to just a pair of units in the call graph  Results in one integration test session for each edge in the call graph IntP–10

  11. Neighbourhood integration  What is neighbourhood integration? IntP–11

  12. Neighbourhood integration example Neighbourhoods for nodes 16 & 26 IntP–12

  13. Neighbourhood integration – 2  The neighbourhood of a node in a graph  The set of nodes that are one edge away from the given node  In a directed graph  All the immediate predecessor nodes and all the immediate successor nodes of a given node IntP–13

  14. Neighbourhood integration – 3  Neighborhood integration testing  Reduces the number of test sessions  #Neighborhoods = #interior_nodes + #source_nodes  Fault isolation is difficult IntP–14

  15. Pros of call-graph integration  What are the pros of call-graph integration? IntP–15

  16. Pros of call-graph integration – 2  What are the pros of call-graph integration?  Reduces the need for drivers and stubs  Relative to functional decomposition integration  Neighborhoods can be combined to create “villages”  Closer to a build sequence  Well suited to devising a sequence of builds with which to implement a system IntP–16

  17. Cons of call-graph integration  What are the cons of call-graph integration? IntP–17

  18. Cons of call-graph integration – 2  What are the cons of call-graph integration?  Suffers from fault isolation problems  Especially for large neighborhoods  Redundancy  Nodes can appear in several neighborhoods  Assumes that correct behaviour follows from correct units and correct interfaces  Not always the case IntP–18

  19. Path-based integration  What is path-based integration? IntP–19

  20. Path-Based Integration – 2  Motivation  Combine structural and behavioral type of testing for integration testing as we did for unit testing  Interface-based testing is structural while interaction-based testing is behavioral  Basic idea  Focus on interactions among system units  Rather than merely to test interfaces among separately developed and tested units IntP–20

  21. Source node  What is a source node? IntP–21

  22. Source node – 2  What is a source node?  A program statement fragment at which program execution begins or resumes.  For example the first “begin” statement in a program.  Nodes immediately after nodes that transfer control to other units. IntP–22

  23. Sink node  What is a sink node? IntP–23

  24. Sink node  What is a sink node?  A statement fragment at which program execution terminates  The final “end” in a program as well as statements that transfer control to other units IntP–24

  25. Module execution path (MEP)  What is a module execution path? IntP–25

  26. Module execution path (MEP) – 2  What is a module execution path?  A sequence of statements within a module that  Begins with a source node  Ends with a sink node  With no intervening sink nodes IntP–26

  27. Message  What is a message? IntP–27

  28. Message – 2  What is a message?  A programming language mechanism by which one unit transfers control to another unit  Usually interpreted as subroutine / function invocations  The unit which receives the message always returns control to the message source IntP–28

  29. MM-path  What is an MM-path? IntP–29

  30. MM-path – 2  What is an MM-path?  A module to module path  An interleaved sequence of module execution paths and messages  Used to describes sequences of module execution paths that include transfers of control among separate units  MM-paths always represent feasible execution paths, and these paths cross unit boundaries IntP–30

  31. MM-path example C 1 A 1 B 1 2 3 2 2 4 3 3 4 5 4 5 6 MM-path Source nodes Sink nodes MEP(A,1) = <1, 2, 3, 6> MEP(A,2) = <1, 2, 4> Module Execution Paths MEP(A,3) = <5, 6> MEP(B,1) = <1, 2> MEP(C,1) = <1, 2, 4, 5> MEP(B,2) = <3, 4> MEP(C,2) = <1, 3, 4, 5> IntP–31

  32. MEPs and DD-paths  What is the correspondence between MEPs and a DD- paths? IntP–32

  33. MEPs and DD-paths – 2  What is the correspondence between MEPs and a DD- paths?  There is no correspondence between MM execution paths and DD-paths IntP–33

  34. MEPs and slices  What is the correspondence between MEPs and slices? IntP–34

  35. MEPs and slices – 2  What is the correspondence between MEPs and slices?  There is no correspondence but there is an analog  The intersection of a module execution path with a unit is the analog of a slice with respect to the MM-path function IntP–35

  36. MM-path graph  What is an MM-path graph? IntP–36

  37. MM-path graph – 2  What is an MM-path graph?  Given a set of units their MM-path graph is the directed graph in which  Nodes are module execution paths  Edges correspond to messages and returns from one unit to another  The definition is with respect to a set of units  It directly supports composition of units and composition-based integration testing IntP–37

  38. MM-path graph example MEP(A,2) MEP(B,1) MEP(A,1) MEP(C,2) MEP(C,1) MEP(A,3) MEP(B,2) Solid lines indicate messages (calls) Dashed lines indicate returns from calls IntP–38

  39. MM-path guidelines  How long, or deep, is an MM-path? What determines the end points?  Quiescence points are natural endpoints for MM-paths  Message quiescence  Data quiescence IntP–39

  40. Message quiescence  Occurs when a unit that sends no messages is reached  Module C in the example IntP–40

  41. Data quiescence  Occurs when a sequence of processing ends in the creation of stored data that is not immediately used  The causal path Data A has no quiescence  The non-causal path D1 and D2 is quiescent at the node P-1 IntP–41

  42. MM-path metric  What is the minimum number of MM-paths that are sufficient to test a system? IntP–42

  43. MM-Path metric – 2  What is the minimum number of MM-paths that are sufficient to test a system?  Should cover all source-to-sink paths in the set of units  What about loops? How should they be treated? IntP–43

  44. MM-Path metric – 3  What about loops? How should they be treated?  Use condensation graphs to get directed acyclic graphs  Avoids an excessive number of paths IntP–44

  45. Pros of path-based integration  Benefits of hybrid of functional and structural testing  Functional – represent actions with input and output  Structural – how they are identified  Avoids pitfall of structural testing  Unimplemented behaviours cannot be tested  Fairly seamless union with system testing IntP–45

  46. Pros of path-based integration – 2  Path-based integration is closely coupled with actual system behaviour  Works well with OO testing  No need for stub and driver development IntP–46

  47. Cons of path-based integration  There is a significant effort involved in identifying MM-paths IntP–47

  48. MM-path compared to other methods Strategy Ability to test Ability to test Fault isolation interfaces co-functionality resolution Functional Acceptable, can Limited to pairs Good to faulty decomposition be deceptive of units unit Call-graph Acceptable Limited to pairs Good to faulty of units unit MM-path Excellent Complete Excellent to unit path level IntP–48

Recommend


More recommend