unit 4 software testing

  • Published on
    06-Mar-2016

  • View
    213

  • Download
    0

DESCRIPTION

unit 4 software testing from boris beizer

Transcript

  • Narasimha Rao.PCompiled with reference from: Software Testing Techniques: Boris Beizer Craft of Software Testing: Brain MarrickUnit 4 Domain Testing

    ref boris beizer

  • Domain Testing

    We will see in this part of Unit 3:

    Domains & Paths

    Nice & Ugly Domains

    Domain Testing

    Domains & Interfaces Testing

    Domains & Testability

    U3

    ref boris beizer

  • Transaction-Flow Testing

    Contents of the unit

    DomainsModel, as a set, pathsPredicatesclosure, dimensionality, assumptionsNice & ugly domainsspecified & implemented domainsNice domains properties, testing implicationsUgly domains, simplification by programmers & testersDomain testingBugs & testing for those bugsTesting procedureVariations, tools, effectivenessDomains & Interface TestingRange, closure, spanInterface range, domain compatibilityFinding the valuesDomains & TestabilityLinearizing, coordinate transformations. Canonical program form

    U3

    ref boris beizer

  • Domain Testing - Domains & Paths

    U3Domain Testing Model INPUTCLASSIFYDO CASE 1OUTPUTDO CASE 2DO CASE 3DO CASE nD1D3(x,y,z,)(1, 2, 3, 4, 5,){ Outcome }D2Dn

    ref boris beizer

  • Domain Testing

    U3Domain Testing

    Views Programs as input data classifiers

    Verifies if the classification is correct

    ref boris beizer

  • Domain Testing - Domains & Paths

    U3Domain Testing Model

    Two Views

    Based on Specs

    Functional Testing

    Based on Implementation information

    Structural Technique

    ref boris beizer

  • Domain Testing - Domains & Paths

    U3Domain Testing Model

    VariablesSimple combinations of two variablesNumbers from - to +

    Input variables as numbers

    Loop-free Programs

    ref boris beizer

  • Domain Testing - Domains & Paths

    U3Domain 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

  • Domain Testing - Domains & Paths

    U3Domain (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

  • Domain Testing - Domains & Paths

    U3Predicates

    Interpretation

    Structural Testing - CFG

    Functional Testing - DFG

    Specifies the Domain Boundary

    n Predicates in Sequence 2n domains

    Or, just two domainsA .AND. B .AND. C

    ref boris beizer

  • Domain Testing - Domains & Paths

    U3Paths

    At least One PATH thru the Program

    More paths for disconnected domains

    ref boris beizer

  • Domain Testing - Domains & Paths

    U3Summary: 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 domains processing is done

    The set of interpreted predicates traversed on that path (ie., the paths predicate expression) defines the domains boundaries.

    ref boris beizer

  • Domain Testing - Domains & Paths - Domain Closure

    U3Boundary: Closed / OpenMINMAXD1D2D3X < MAXX >= MINMINMAXD1D2D3X >= MINX

  • Domain Testing - Domains & Paths - Domain Closure

    Boundary: Closed / Open

    ref boris beizer

  • Domain Testing - Domains & Paths - Domain Dimensionality

    U3

    One dimension per variable

    At least one predicateSlices thru previously defined Domain

    Slicing Boundary

    N-spaces are cut by Hyperplanes

    ref boris beizer

  • Domain Testing - Domains & Paths Bug Assumptions

    U3 Processing is OK. Domain definition may be wrong.

    Boundaries are wrong.

    Predicates are wrong.

    Once input vector is set on the right path, its correctly processed.

    More bugs causing domain errors

    ref boris beizer

  • Domain Testing - Domains & Paths Bug Assumptions..

    U3

    Double-zero representation

    Floating point zero check

    Contradictory domains

    Ambiguous domains

    ref boris beizer

  • Domain Testing - Domains & Paths Bug Assumptions..

    U3

    Over-specified domainsBoundary errors

    Boundary closure

    Shifted

    X > 3 .AND. X < 2 .AND. Y > 3

    ref boris beizer

  • Domain Testing - Domains & Paths - Bug Assumptions

    U3 Boundary errors.Tilted

    Missing

    Extra boundary

    ref boris beizer

  • Domain Testing - Domains & Paths - Bug Assumptions

    U3

    Closure Reversal

    Faulty Logic

    Simplification of compound predicates

    X >= 3

    ref boris beizer

  • Domain Testing - Domains & Paths - Bug Assumptions

    U3

    Strategy for domain testing in 2-dim

    ref boris beizer

  • Domain Testing - Domains & Paths - Restrictions

    U3In General

    Coincidental CorrectnessDT cannot detectExample

    Representative outcome

    Partition testing

    Input EquivalenceD1D2F1(x) : +1F2(x) : -1

    ref boris beizer

  • Domain Testing - Domains & Paths

    U3Domain Testing Model

    ref boris beizer

  • Domain Testing - Domains & Paths - - Restrictions

    U3Simple boundaries & Compound predicatesD1D1

    ref boris beizer

  • Domain Testing - Domains & Paths - - Restrictions

    U3Compound predicates.

    Impact of .OR.

    Concave, Disconnected

    Adjacent domains with same function

    ExampleA B C + D E F

    Eliminate compound predicates

    ref boris beizer

  • Domain Testing - Domains & Paths - Restrictions

    U3 Functional Homogeneity of Bugs

    Functional form still Retained

    a x + b y >= c

    Bugs are only in a, b, c

    ref boris beizer

  • Domain Testing - Domains & Paths - - Restrictions

    U3Linear Vector Space

    Linear boundary predicate, InterpretedSimple relational operators

    Conversion to linear vector space

    2-d Polar co-ordinates

    Polynomials

    Problems with Non-linear Boundaries

    ref boris beizer

  • Domain Testing - Domains & Paths - Restrictions

    U3

    Loop-free Software

    Predicate for each iteration

    Loop over the entire transaction

    Definite loop

    ref boris beizer

  • Domain Testing - Domains & Paths Nice & Ugly domains

    U3Nice Domains

    Requirements

    Bugs ill-defined domains

    Before DT

    Analyze specs

    Make the Boundary Specs Consistent & Complete

    ref boris beizer

  • Domain Testing - Domains & Paths Nice domains

    U3

    Implemented Domains

    Complete, Consistent & Process all inputs

    Specified Domains

    Incomplete, Inconsistent

    Programmers / Designers Effort

    ref boris beizer

  • Domain Testing - Domains & Paths Nice domains

    U3Nice Domains

    Linear, Complete, Systematic, Orthogonal, Consistently Closed, & Convex

    ref boris beizer

  • Domain Testing - Domains & Paths Nice domains

    U3Nice Domains

    Advantages

    Ease of DT

    Fewer Bug Occurrences

    ref boris beizer

  • Domain Testing - Domains & Paths Nice domains

    U3Nice Domains

    Boundaries are

    Linear

    Complete

    Systematic

    OrthogonalClosure consistency

    Convex

    Simply connected

    ref boris beizer

  • Domain Testing - Domains & Paths Nice domains

    U3Linear Boundaries

    Interpreted linear inequalities

    n-dim Hyperplane:

    n+1 Points

    n+1 + 1 Test Cases

    Non-Linear

    Transform

    ref boris beizer

  • Domain Testing - Domains & Paths Nice domains

    U3Complete Boundaries

    Span the total number space (-, +)

    One set of Tests

    Incomplete

    Reasons

    Tests

    ref boris beizer

  • Domain Testing - Domains & Paths - Nice domains

    U3Systematic Boundaries

    Linear Inequalities differing by a constant

    fj (X) kj or, fj (X) g (j, c) g (j, c) = j + k * c

    Parallel linesIdentical Sectors in a Circle

    DTTest a domain Tests for other Domains

    ref boris beizer

  • Domain Testing - Domains & Paths - Nice domains

    U3Orthogonal Boundaries

    Two boundaries or, boundary sets

    Parallel to axes

    DT

    Each Set Independently

    # Tests O (n)

    UjVj

    ref boris beizer

  • Domain Testing - Domains & Paths - Nice domains

    U3Orthogonal Boundaries

    Tilted setstransformationTest cases: O(n)

    Concentric circles with radial lines

    Rectangular coordinatesPolarr aj .AND. r < aj+1 .AND. j .AND. < j+1

    ref boris beizer

  • Domain Testing - Domains & Paths - Nice domains

    U3Non-Orthogonal Boundaries

    Test Intersections O ( n2 ) + O (n)

    ref boris beizer

  • Domain Testing - Domains & Paths - Nice domains

    U3Closure Consistency

    A Simple pattern in all boundary closures

    Example

    Same relational operator for systematic boundaries

    D1D2D3D4

    ref boris beizer

  • Domain Testing - Domains & Paths - Nice domains

    U3Convex Domain

    Line joining any two points lies with in the domain

    DTn on-points & 1 off-pt

    Concave

    But, However, Except, Or in SpecsHandle with special care

    ref boris beizer

  • Domain Testing - Domains & Paths - Nice domains

    U3Simply Connected Domain

    In a single piece

    2 complementary domains

    D1: Convex D2: Concave, not-Connected

    Programmer / Designer

    Convex part FirstD1D2D3

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3Generally,

    From Bad Specs

    Programmer / Designer Simplifies => Ugly to Good

    possibility of Introduction of more bugs ?!?

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3Causes

    Non-linear Boundaries

    Ambiguities & Contradictions

    Simplifying the topology

    Rectifying boundary closures

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3Non-linear Boundaries

    Transform

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3AmbiguitiesHoles in input vector space.

    Missing boundary

    Detected by Specification languages & tools.

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3Contradictions..

    Overlapping of

    Domain Specs

    Closure Specs

    D1D2D3

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3Simplifying the Topology.

    Complexity !

    Concavity, Holes, Disconnectedness

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3Simplifying the Topology.

    Smoothing out concavity

    Filling in Holes

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3Simplifying the Topology.

    Joining the pieces

    Correct:

    Connect disconnected boundary segments

    Extend boundaries to infinity

    ref boris beizer

  • Domain Testing - Domains & Paths Ugly Domains

    U3Rectifying Boundary Closures.

    make closures in one direction for parallel boundaries with closures in both directions

    Force a Bounding Hyperplane to belong to the Domain.

    Consistent DirectionInclusion / Exclusion Consistency

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3General DT Strategy

    Select test points near the boundaries.

    Define test strategy for each possible bug related to boundary

    Test points for a domain useful to test its adjacent domain.

    Run the tests. By post test analysis determine if any boundaries are faulty & if so how?

    Run enough tests to verify every boundary of every domain

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3DT for Specific Domain Bugs

    Generally,

    Interior point

    Exterior point

    Epsilon neighborhood

    Extreme point

    On point

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3DT for Specific Domain Bugs

    Domain D1Epsilon neighborhoodBoundary pointExtremepointOn PointsOff Points

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U31-d Domains

    2-d Domains

    Equality & inequality Predicates

    Random Testing

    Testing n-dimensional Domains

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Testing 1-d Domains : Bugs with open boundariesClosure BugShift left BugShift Right Bug

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Missing BoundaryExtra BoundaryTesting 1-d Domains : Bugs with open boundariesBugs with Closed Boundaries : Similar to the above

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Testing 2-d Domains

    Closure bug

    Boundary Shift : up / down

    Tilted Boundary

    Extra Boundary

    Missing Boundary

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3

    Strategy for domain testing in 2-dim2 n : Domains share tests 3 n : no sharing of tests by domains

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Equality & Inequality Predicates

    An Equality predicate defines a line in 2-d

    cccABadbTo avoid bugs

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Random Testing

    A Point in the center : verifies computation

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Testing n-Dimensional Domains (strategy)

    n-dimensions, p boundary segments

    (n+1)*p test cases : n on points & 1 off point

    Extreme pt shared : 2 * p points

    Equalities over m-dimensions create a subspace of n-m dimensions

    Orthogonal domains with consistent boundary closures, orthogonal to the axes & complete boundaries

    Independent testing

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Procedure for solving for valuesSimple procedure. Need tools.

    Identify input variables

    Identify variables which appear in domain-defining predicates, such as control-flow predicates

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3ProcedureInterpret all domain predicates in terms of input variables:Transform non-linear to linearFind data flow path

    Predicate expression with p # predicates. Find # domains : < 2 p

    Solve inequalities for extreme points

    Use extreme points to solve for nearby on points

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Effectiveness

    Cost effective

    Bugs on boundaries, extreme points

    Hardware logic testing tool intensive

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Domains & Interface Testing

    Domain

    Range

    Function / RoutineClassifyDomainVariableRange

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Domains & Interface Testing

    Span compatibility

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Domains & Interface Testing

    Closure compatibility

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Interface Range/Domain Compatibility Testing

    Test each var independently

    Find an inverse function

    Build a super domain

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Finding the values / solving inequalities

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Domains and Testability

    Linearizing transformations

    PolynomialRectangular to polarGeneric & rational => Taylor series

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Domains and Testability

    Perform transformations for better testing.

    Co-ordinate transformations

    ref boris beizer

  • Domain Testing - Domains & Paths Domain Testing

    U3Domains and Testability

    Canonical Program Form

    ref boris beizer

  • Domain Testing Questions from the previous years exams

    U3

    Explain Nice & Ugly Domains.

    What is domain testing? Discuss applications of domain testing

    Explain the domain boundary bugs for two dimensional domains

    What is the purpose of Domain Testing? Give its schematic representation

    Define the following concepts.Domains2. Domain closure 3. Domain dimensionality 4. Bug assumptions for Domain Testing

    Explain simple domain boundaries & compound predicates.

    Classify what can go wrong with boundaries, then define a test strategy for each case in domain testing.

    ref boris beizer

  • Domain Testing

    U-3

    To Unit 5Paths, Path Products & Regular Expressions

    ref boris beizer

Recommended

View more >