1 / 76

Software Testing Techniques (STT)

Software Testing Techniques (STT). Unit 4 – Domain Testing. Sudhakar yadav. Compiled with reference from: Software Testing Techniques: Boris Beizer Craft of Software Testing: Brain Marrick. U3. Domain Testing. We will see in this part of Unit 3:

jshanahan
Download Presentation

Software Testing Techniques (STT)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Software Testing Techniques (STT) Unit 4 – Domain Testing Sudhakar yadav Compiled with reference from: Software Testing Techniques: Boris Beizer Craft of Software Testing: Brain Marrick

  2. U3 Domain Testing • We will see in this part of Unit 3: • Domains & Paths • Nice & Ugly Domains • Domain Testing • Domains & Interfaces Testing • Domains & Testability ref boris beizer

  3. U3 Transaction-Flow Testing • Contents of the unit • Domains • Model, as a set, paths • Predicates • closure, dimensionality, assumptions • Nice & ugly domains • specified & implemented domains • Nice domains – properties, testing implications • Ugly domains, simplification by programmers & testers • Domain testing • Bugs & testing for those bugs • Testing procedure • Variations, tools, effectiveness • Domains & Interface Testing • Range, closure, span • Interface range, domain compatibility • Finding the values • Domains & Testability • Linearizing, coordinate transformations. Canonical program form ref boris beizer

  4. U3 Domain Testing - Domains & Paths • Domain Testing Model D1 D2 INPUT CLASSIFY DO CASE 1 OUTPUT D3 (x,y,z,…) { Outcome } Dn DO CASE 2 (1, 2, 3, 4, 5,…) DO CASE 3 ref boris beizer DO CASE n

  5. U3 Domain Testing • Domain Testing • Views Programs as input data classifiers • Verifies if the classification is correct ref boris beizer

  6. U3 Domain Testing - Domains & Paths • Domain Testing Model • Two Views • Based on Specs • Functional Testing • Based on Implementation information • Structural Technique ref boris beizer

  7. U3 Domain Testing - Domains & Paths • Domain Testing Model • Variables • Simple combinations of two variables • Numbers from - to + • Input variables as numbers • Loop-free Programs ref boris beizer

  8. U3 Domain Testing - Domains & Paths • Domain Testing Model • Structural Knowledge is not needed. Only Specs. • For each Input Case, • A Hypothetical path for Functional testing • An Actual path for Structural testing ref boris beizer

  9. D1 U3 Domain Testing - Domains & Paths • Domain (simplified) • A Single Connected Set of numbers • No arbitrary discrete sets • Defined by the boundaries • One or more boundaries • Specified by predicates • Bugs likely at the boundaries • One or more variables ref boris beizer

  10. U3 Domain Testing - Domains & Paths • Predicates • Interpretation • Structural Testing - CFG • Functional Testing - DFG • Specifies the Domain Boundary • n Predicates in Sequence 2n domains • Or, just two domains ref boris beizer A .AND. B .AND. C

  11. U3 Domain Testing - Domains & Paths • Paths • At least One PATH thru the Program • More paths for disconnected domains ref boris beizer

  12. U3 Domain Testing - Domains & Paths • Summary: • Domain for a loop-free program corresponds to a set of numbers defined over the input vector • For every domain, there is at least one path thru the routine, along which that domain’s processing is done • The set of interpreted predicates traversed on that path (ie., the path’s predicate expression) defines the domain’s boundaries. ref boris beizer

  13. U3 Domain Testing - Domains & Paths - Domain Closure • Boundary: Closed / Open X <= MAX X >= MIN MAX MIN D2 D3 D1 Closed ref boris beizer D2 X >= MIN X < MAX D3 D1 Closed Open MIN MAX

  14. MAX MIN D2 D3 D1 Open X < MAX X > MIN Domain Testing - Domains & Paths - Domain Closure • Boundary: Closed / Open ref boris beizer

  15. U3 Domain Testing - Domains & Paths - Domain Dimensionality • One dimension per variable • At least one predicate • Slices thru previously defined Domain • Slicing Boundary • N-spaces are cut by Hyperplanes ref boris beizer

  16. U3 Domain Testing - Domains & Paths – Bug Assumptions • Processing is OK. Domain definition may be wrong. •  Boundaries are wrong. •  Predicates are wrong. • Once input vector is set on the right path, it’s correctly processed. • More bugs causing domain errors … ref boris beizer

  17. defined undefined U3 Domain Testing - Domains & Paths – Bug Assumptions.. • Double-zero representation • Floating point zero check • Contradictory domains • Ambiguous domains ref boris beizer

  18. U3 Domain Testing - Domains & Paths – Bug Assumptions.. • Over-specified domains • Boundary errors • Boundary closure • Shifted X > 3 .AND. X < 2 .AND. Y > 3 ref boris beizer

  19. U3 Domain Testing - Domains & Paths - Bug Assumptions • Boundary errors…. • Tilted • Missing • Extra boundary ref boris beizer

  20. U3 Domain Testing - Domains & Paths - Bug Assumptions • Closure Reversal • Faulty Logic • Simplification of compound predicates X >= 3 ref boris beizer

  21. U3 Domain Testing - Domains & Paths - Bug Assumptions ref boris beizer Strategy for domain testing in 2-dim

  22. U3 Domain Testing - Domains & Paths - Restrictions • In General… • Coincidental Correctness • DT cannot detect • Example • Representative outcome • Partition testing • Input Equivalence F1(x) : +1 ref boris beizer D1 D2 F2(x) : -1

  23. Function f1 D1 INPUT CLASSIFY DO CASE 1 OUTPUT D2 (x, y, z, …) { Outcome } DO CASE 2 (1, 2, 3, 4, 5,…) f2 D3 DO CASE 3 f3 Dn f4 DO CASE n U3 Domain Testing - Domains & Paths • Domain Testing Model ref boris beizer

  24. X X >=0 .AND. X <= 16 0 16 Y Y = 1 .AND. X >=0 .AND. X <= 16 0 16 X U3 Domain Testing - Domains & Paths - - Restrictions • Simple boundaries & Compound predicates D1 D1 ref boris beizer

  25. U3 Domain Testing - Domains & Paths - - Restrictions • Compound predicates…. • Impact of .OR. • Concave, Disconnected • Adjacent domains with same function • Example • A B C + D E F • Eliminate compound predicates ref boris beizer

  26. U3 Domain Testing - Domains & Paths - Restrictions • Functional Homogeneity of Bugs • Functional form still Retained • a x + b y >= c • Bugs are only in a, b, c ref boris beizer

  27. U3 Domain Testing - Domains & Paths - - Restrictions • Linear Vector Space • Linear boundary predicate, Interpreted • Simple relational operators • Conversion to linear vector space • 2-d Polar co-ordinates • Polynomials • Problems with Non-linear Boundaries ref boris beizer

  28. U3 Domain Testing - Domains & Paths - Restrictions • Loop-free Software • Predicate for each iteration • Loop over the entire transaction • Definite loop ref boris beizer

  29. U3 Domain Testing - Domains & Paths – Nice & Ugly domains • Nice Domains • Requirements • Bugs  ill-defined domains • Before DT • Analyze specs • Make the Boundary Specs Consistent & Complete ref boris beizer

  30. U3 Domain Testing - Domains & Paths – Nice domains • Implemented Domains • Complete, Consistent & Process all inputs • Specified Domains • Incomplete, Inconsistent • Programmer’s / Designer’s Effort ref boris beizer

  31. U2 U1 D12 D11 V1 V2 D22 D21 U3 Domain Testing - Domains & Paths – Nice domains • Nice Domains • Linear, Complete, Systematic, Orthogonal, Consistently Closed, & Convex ref boris beizer

  32. U3 Domain Testing - Domains & Paths – Nice domains • Nice Domains • Advantages • Ease of DT • Fewer Bug Occurrences ref boris beizer

  33. U3 Domain Testing - Domains & Paths – Nice domains • Nice Domains • Boundaries are • Linear • Complete • Systematic • Orthogonal • Closure consistency • Convex • Simply connected ref boris beizer

  34. U3 Domain Testing - Domains & Paths – Nice domains • Linear Boundaries • Interpreted linear inequalities • n-dim Hyperplane: • n+1 Points • n+1 + 1 Test Cases • Non-Linear • Transform ref boris beizer

  35. U3 Domain Testing - Domains & Paths – Nice domains • Complete Boundaries • Span the total number space (-, +) • One set of Tests • Incomplete… • Reasons • Tests ref boris beizer

  36. U3 Domain Testing - Domains & Paths - Nice domains • Systematic Boundaries • Linear Inequalities differing by a constant • fj(X) ≥ kjor, fj(X) ≥ g (j, c)g (j, c) = j + k * c • Parallel lines • Identical Sectors in a Circle • DT • Test a domain  Tests for other Domains ref boris beizer

  37. U3 Domain Testing - Domains & Paths - Nice domains • Orthogonal Boundaries • Two boundaries or, boundary sets • Parallel to axes • DT • Each Set Independently • # Tests  O (n) Uj Vj ref boris beizer

  38. U3 Domain Testing - Domains & Paths - Nice domains • Orthogonal Boundaries • Tilted sets • transformation • Test cases: O(n) • Concentric circles with radial lines • Rectangular coordinates • Polar • r ≥aj .AND. r < aj+1 .AND. • ≥ j .AND.  < j+1 ref boris beizer

  39. U3 Domain Testing - Domains & Paths - Nice domains • Non-Orthogonal Boundaries • Test Intersections O ( n2 ) + O (n) ref boris beizer

  40. U3 Domain Testing - Domains & Paths - Nice domains • Closure Consistency • A Simple pattern in all boundary closures • Example • Same relational operator for systematic boundaries ref boris beizer D3 D2 D4 D1

  41. U3 Domain Testing - Domains & Paths - Nice domains • Convex Domain • Line joining any two points lies with in the domain • DT • n on-points & 1 off-pt • Concave • “ But, However, Except, Or … “ in Specs • Handle with special care ref boris beizer

  42. D2 D1 U3 Domain Testing - Domains & Paths - Nice domains • Simply Connected Domain • In a single piece • 2 complementary domains • D1: Convex  D2: Concave, not-Connected • Programmer / Designer • Convex part First D2 D3 D1 ref boris beizer

  43. U3 Domain Testing - Domains & Paths – Ugly Domains • Generally, • From Bad Specs • Programmer / Designer Simplifies => Ugly to Good • possibility of Introduction of more bugs ?!? ref boris beizer

  44. U3 Domain Testing - Domains & Paths – Ugly Domains • Causes • Non-linear Boundaries • 2. Ambiguities & Contradictions • 3. Simplifying the topology • 4. Rectifying boundary closures ref boris beizer

  45. U3 Domain Testing - Domains & Paths – Ugly Domains • Non-linear Boundaries • Transform ref boris beizer

  46. U3 Domain Testing - Domains & Paths – Ugly Domains • Ambiguities • Holes in input vector space. • Missing boundary • Detected by Specification languages & tools. ref boris beizer

  47. U3 Domain Testing - Domains & Paths – Ugly Domains • Contradictions.. • Overlapping of • Domain Specs • Closure Specs ref boris beizer D3 D2 D1

  48. U3 Domain Testing - Domains & Paths – Ugly Domains • Simplifying the Topology…. • Complexity ! • Concavity, Holes, Disconnectedness ref boris beizer

  49. U3 Domain Testing - Domains & Paths – Ugly Domains • Simplifying the Topology…. • Smoothing out concavity • Filling in Holes ref boris beizer

  50. U3 Domain Testing - Domains & Paths – Ugly Domains • Simplifying the Topology…. • Joining the pieces • Correct: • Connect disconnected boundary segments • Extend boundaries to infinity ref boris beizer

More Related