unit 4 software testing

  • Published on
    06-Mar-2016

  • View
    213

  • Download
    0

Embed Size (px)

DESCRIPTION

unit 4 software testing from boris beizer

Transcript

<ul><li><p> Narasimha Rao.PCompiled with reference from: Software Testing Techniques: Boris Beizer Craft of Software Testing: Brain MarrickUnit 4 Domain Testing</p><p>ref boris beizer</p></li><li><p>Domain Testing</p><p>We will see in this part of Unit 3:</p><p>Domains &amp; Paths</p><p>Nice &amp; Ugly Domains</p><p>Domain Testing</p><p>Domains &amp; Interfaces Testing</p><p>Domains &amp; Testability</p><p>U3</p><p>ref boris beizer</p></li><li><p>Transaction-Flow Testing</p><p>Contents of the unit</p><p>DomainsModel, as a set, pathsPredicatesclosure, dimensionality, assumptionsNice &amp; ugly domainsspecified &amp; implemented domainsNice domains properties, testing implicationsUgly domains, simplification by programmers &amp; testersDomain testingBugs &amp; testing for those bugsTesting procedureVariations, tools, effectivenessDomains &amp; Interface TestingRange, closure, spanInterface range, domain compatibilityFinding the valuesDomains &amp; TestabilityLinearizing, coordinate transformations. Canonical program form</p><p>U3</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Domain Testing Model INPUTCLASSIFYDO CASE 1OUTPUTDO CASE 2DO CASE 3DO CASE nD1D3(x,y,z,)(1, 2, 3, 4, 5,){ Outcome }D2Dn</p><p>ref boris beizer</p></li><li><p>Domain Testing </p><p>U3Domain Testing</p><p>Views Programs as input data classifiers</p><p>Verifies if the classification is correct</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Domain Testing Model</p><p>Two Views</p><p>Based on Specs</p><p>Functional Testing</p><p>Based on Implementation information</p><p>Structural Technique</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Domain Testing Model</p><p>VariablesSimple combinations of two variablesNumbers from - to +</p><p>Input variables as numbers</p><p>Loop-free Programs</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Domain Testing Model </p><p>Structural Knowledge is not needed. Only Specs.</p><p>For each Input Case,</p><p>A Hypothetical path for Functional testing</p><p>An Actual path for Structural testing</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Domain (simplified) </p><p>A Single Connected Set of numbers</p><p>No arbitrary discrete sets</p><p>Defined by the boundaries</p><p>One or more boundaries </p><p>Specified by predicates</p><p>Bugs likely at the boundaries</p><p>One or more variables</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Predicates </p><p>Interpretation</p><p>Structural Testing - CFG</p><p>Functional Testing - DFG</p><p>Specifies the Domain Boundary</p><p> n Predicates in Sequence 2n domains</p><p>Or, just two domainsA .AND. B .AND. C</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Paths </p><p>At least One PATH thru the Program</p><p>More paths for disconnected domains</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Summary: Domain for a loop-free program corresponds to a set of numbers defined over the input vector</p><p>For every domain, there is at least one path thru the routine, along which that domains processing is done</p><p>The set of interpreted predicates traversed on that path (ie., the paths predicate expression) defines the domains boundaries.</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Domain Closure</p><p>U3Boundary: Closed / OpenMINMAXD1D2D3X &lt; MAXX &gt;= MINMINMAXD1D2D3X &gt;= MINX </p></li><li><p>Domain Testing - Domains &amp; Paths - Domain Closure</p><p>Boundary: Closed / Open</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Domain Dimensionality</p><p>U3 </p><p>One dimension per variable</p><p>At least one predicateSlices thru previously defined Domain</p><p>Slicing Boundary</p><p>N-spaces are cut by Hyperplanes</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Bug Assumptions</p><p>U3 Processing is OK. Domain definition may be wrong.</p><p> Boundaries are wrong.</p><p> Predicates are wrong.</p><p>Once input vector is set on the right path, its correctly processed.</p><p>More bugs causing domain errors </p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Bug Assumptions..</p><p>U3</p><p>Double-zero representation</p><p>Floating point zero check</p><p>Contradictory domains</p><p>Ambiguous domains</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Bug Assumptions..</p><p>U3</p><p> Over-specified domainsBoundary errors</p><p>Boundary closure</p><p>Shifted</p><p>X &gt; 3 .AND. X &lt; 2 .AND. Y &gt; 3</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Bug Assumptions</p><p>U3 Boundary errors.Tilted</p><p>Missing</p><p>Extra boundary</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Bug Assumptions</p><p>U3 </p><p>Closure Reversal</p><p>Faulty Logic</p><p> Simplification of compound predicates</p><p>X &gt;= 3 </p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Bug Assumptions</p><p>U3 </p><p>Strategy for domain testing in 2-dim</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Restrictions</p><p>U3In General</p><p>Coincidental CorrectnessDT cannot detectExample</p><p>Representative outcome</p><p>Partition testing</p><p>Input EquivalenceD1D2F1(x) : +1F2(x) : -1</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths</p><p>U3Domain Testing Model </p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - - Restrictions</p><p>U3Simple boundaries &amp; Compound predicatesD1D1</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - - Restrictions</p><p>U3Compound predicates.</p><p>Impact of .OR.</p><p>Concave, Disconnected</p><p>Adjacent domains with same function</p><p>ExampleA B C + D E F</p><p>Eliminate compound predicates</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Restrictions</p><p>U3 Functional Homogeneity of Bugs</p><p>Functional form still Retained</p><p> a x + b y &gt;= c</p><p>Bugs are only in a, b, c</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - - Restrictions</p><p>U3Linear Vector Space</p><p>Linear boundary predicate, InterpretedSimple relational operators</p><p>Conversion to linear vector space</p><p>2-d Polar co-ordinates</p><p>Polynomials</p><p>Problems with Non-linear Boundaries</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Restrictions</p><p>U3</p><p>Loop-free Software </p><p>Predicate for each iteration</p><p>Loop over the entire transaction </p><p>Definite loop</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Nice &amp; Ugly domains</p><p>U3Nice Domains</p><p>Requirements</p><p>Bugs ill-defined domains</p><p>Before DT</p><p>Analyze specs</p><p>Make the Boundary Specs Consistent &amp; Complete</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Nice domains</p><p>U3</p><p> Implemented Domains</p><p>Complete, Consistent &amp; Process all inputs</p><p>Specified Domains</p><p>Incomplete, Inconsistent</p><p> Programmers / Designers Effort</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Nice domains</p><p>U3Nice Domains</p><p>Linear, Complete, Systematic, Orthogonal, Consistently Closed, &amp; Convex</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Nice domains</p><p>U3Nice Domains</p><p>Advantages</p><p>Ease of DT</p><p>Fewer Bug Occurrences</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Nice domains</p><p>U3Nice Domains</p><p>Boundaries are</p><p>Linear</p><p>Complete</p><p>Systematic</p><p>OrthogonalClosure consistency</p><p>Convex</p><p>Simply connected</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Nice domains</p><p>U3Linear Boundaries</p><p>Interpreted linear inequalities</p><p>n-dim Hyperplane:</p><p>n+1 Points</p><p>n+1 + 1 Test Cases</p><p>Non-Linear </p><p>Transform</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Nice domains</p><p>U3Complete Boundaries</p><p>Span the total number space (-, +)</p><p>One set of Tests</p><p>Incomplete</p><p>Reasons</p><p>Tests</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Nice domains</p><p>U3Systematic Boundaries</p><p>Linear Inequalities differing by a constant</p><p> fj (X) kj or, fj (X) g (j, c) g (j, c) = j + k * c</p><p>Parallel linesIdentical Sectors in a Circle</p><p>DTTest a domain Tests for other Domains</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Nice domains</p><p>U3Orthogonal Boundaries</p><p>Two boundaries or, boundary sets</p><p>Parallel to axes</p><p>DT</p><p>Each Set Independently</p><p># Tests O (n)</p><p>UjVj</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Nice domains</p><p>U3Orthogonal Boundaries</p><p>Tilted setstransformationTest cases: O(n)</p><p>Concentric circles with radial lines</p><p>Rectangular coordinatesPolarr aj .AND. r &lt; aj+1 .AND. j .AND. &lt; j+1 </p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Nice domains</p><p>U3Non-Orthogonal Boundaries</p><p>Test Intersections O ( n2 ) + O (n)</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Nice domains</p><p>U3Closure Consistency</p><p>A Simple pattern in all boundary closures</p><p>Example</p><p>Same relational operator for systematic boundaries</p><p>D1D2D3D4</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Nice domains</p><p>U3Convex Domain</p><p>Line joining any two points lies with in the domain</p><p>DTn on-points &amp; 1 off-pt</p><p>Concave</p><p> But, However, Except, Or in SpecsHandle with special care</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths - Nice domains</p><p>U3Simply Connected Domain</p><p>In a single piece</p><p>2 complementary domains</p><p>D1: Convex D2: Concave, not-Connected </p><p>Programmer / Designer</p><p>Convex part FirstD1D2D3</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3Generally,</p><p>From Bad Specs </p><p>Programmer / Designer Simplifies =&gt; Ugly to Good</p><p>possibility of Introduction of more bugs ?!?</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3Causes</p><p>Non-linear Boundaries</p><p>Ambiguities &amp; Contradictions</p><p>Simplifying the topology</p><p>Rectifying boundary closures</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3Non-linear Boundaries</p><p>Transform</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3AmbiguitiesHoles in input vector space.</p><p>Missing boundary</p><p>Detected by Specification languages &amp; tools.</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3Contradictions..</p><p>Overlapping of</p><p>Domain Specs</p><p>Closure Specs</p><p>D1D2D3</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3Simplifying the Topology.</p><p>Complexity !</p><p>Concavity, Holes, Disconnectedness</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3Simplifying the Topology.</p><p>Smoothing out concavity</p><p>Filling in Holes</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3Simplifying the Topology.</p><p>Joining the pieces</p><p>Correct:</p><p>Connect disconnected boundary segments</p><p>Extend boundaries to infinity</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Ugly Domains</p><p>U3Rectifying Boundary Closures.</p><p>make closures in one direction for parallel boundaries with closures in both directions</p><p>Force a Bounding Hyperplane to belong to the Domain.</p><p>Consistent DirectionInclusion / Exclusion Consistency</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3General DT Strategy</p><p>Select test points near the boundaries.</p><p>Define test strategy for each possible bug related to boundary</p><p>Test points for a domain useful to test its adjacent domain.</p><p>Run the tests. By post test analysis determine if any boundaries are faulty &amp; if so how?</p><p>Run enough tests to verify every boundary of every domain</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3DT for Specific Domain Bugs</p><p>Generally,</p><p>Interior point</p><p>Exterior point</p><p>Epsilon neighborhood</p><p>Extreme point</p><p>On point</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3DT for Specific Domain Bugs</p><p>Domain D1Epsilon neighborhoodBoundary pointExtremepointOn PointsOff Points</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U31-d Domains</p><p>2-d Domains </p><p>Equality &amp; inequality Predicates</p><p>Random Testing</p><p>Testing n-dimensional Domains</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Testing 1-d Domains : Bugs with open boundariesClosure BugShift left BugShift Right Bug</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Missing BoundaryExtra BoundaryTesting 1-d Domains : Bugs with open boundariesBugs with Closed Boundaries : Similar to the above</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Testing 2-d Domains</p><p>Closure bug</p><p>Boundary Shift : up / down</p><p>Tilted Boundary</p><p>Extra Boundary</p><p>Missing Boundary</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3 </p><p>Strategy for domain testing in 2-dim2 n : Domains share tests 3 n : no sharing of tests by domains</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Equality &amp; Inequality Predicates</p><p>An Equality predicate defines a line in 2-d</p><p>cccABadbTo avoid bugs</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Random Testing</p><p>A Point in the center : verifies computation</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Testing n-Dimensional Domains (strategy)</p><p>n-dimensions, p boundary segments</p><p>(n+1)*p test cases : n on points &amp; 1 off point</p><p>Extreme pt shared : 2 * p points</p><p>Equalities over m-dimensions create a subspace of n-m dimensions</p><p>Orthogonal domains with consistent boundary closures, orthogonal to the axes &amp; complete boundaries </p><p>Independent testing</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Procedure for solving for valuesSimple procedure. Need tools.</p><p>Identify input variables</p><p>Identify variables which appear in domain-defining predicates, such as control-flow predicates</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3ProcedureInterpret all domain predicates in terms of input variables:Transform non-linear to linearFind data flow path</p><p>Predicate expression with p # predicates. Find # domains : &lt; 2 p</p><p>Solve inequalities for extreme points</p><p>Use extreme points to solve for nearby on points </p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Effectiveness</p><p>Cost effective</p><p>Bugs on boundaries, extreme points</p><p>Hardware logic testing tool intensive</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Domains &amp; Interface Testing</p><p>Domain </p><p>Range</p><p>Function / RoutineClassifyDomainVariableRange</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Domains &amp; Interface Testing</p><p>Span compatibility</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Domains &amp; Interface Testing</p><p>Closure compatibility</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Interface Range/Domain Compatibility Testing</p><p>Test each var independently</p><p>Find an inverse function</p><p>Build a super domain</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Finding the values / solving inequalities</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Domains and Testability</p><p>Linearizing transformations</p><p>PolynomialRectangular to polarGeneric &amp; rational =&gt; Taylor series</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Domains and Testability</p><p>Perform transformations for better testing.</p><p>Co-ordinate transformations</p><p>ref boris beizer</p></li><li><p>Domain Testing - Domains &amp; Paths Domain Testing</p><p>U3Domains and Testability</p><p>Canonical Program Form</p><p>ref boris beizer</p></li><li><p>Domain Testing Questions from the previous years exams</p><p>U3</p><p>Explain Nice &amp; Ugly Domains.</p><p>What is domain testing? Discuss applications of domain testing</p><p>Explain the domain boundary bugs for two dimensional domains</p><p>What is the purpose of Domain Testing? Give its schematic representation</p><p>Define the following concepts.Domains2. Domain closure 3. Domain dimensionality 4. Bug assumptions for Domain Testing</p><p>Explain simple domain boundaries &amp; compound predicates.</p><p>Classify what can go wrong with boundaries, then define a test strategy for each case in domain testing.</p><p>ref boris beizer</p></li><li><p>Domain Testing </p><p>U-3</p><p>To Unit 5Paths, Path Products &amp; Regular Expressions</p><p>ref boris beizer</p></li></ul>