ISTQBCH4

download ISTQBCH4

of 54

Transcript of ISTQBCH4

  • 8/9/2019 ISTQBCH4

    1/54

    Dynamic Testing Techniques

    1 Principles 2 Lifecycle

    4 Dynamic test

    techniques

    3 Static testing

    5 Management 6 Tools

    Software Testing

    ISTQB / ISEB Foundation Exam Practice

    hapter 4

  • 8/9/2019 ISTQBCH4

    2/54

    ontents

    !hat is a testing technique"

    #lac$ an% !hite &o' testing

    #lac$ &o' test techniques

    !hite &o' test techniques(rror )uessing

    Dynamic Testing Techniques

    1 2 3

    4 5 6

    ISTQB / ISEB Foundation Exam Practice

  • 8/9/2019 ISTQBCH4

    3/54

    Why dynamic test techniques?

    ('hausti*e testing +use of all possi&le inputs

    an% con%itions, is impractical

    - must use a subset of all possible test casesmust use a subset of all possible test cases

    - must have high probability of detecting faultsmust have high probability of detecting faults -ee% thought processes that help us select

    test cases more intelligently

    -test case design techniques are such thoughttest case design techniques are such thoughtprocessesprocesses

  • 8/9/2019 ISTQBCH4

    4/54

    What is a testing technique?

    a proce%ure for selecting or %esigning tests

    &ase% on a structural or functional mo%el of

    the soft.are

    successful at fin%ing faults /&est/ practice

    a .ay of %eri*ing goo% test cases

    a .ay of o&0ecti*ely measuring a test effort

    Testing should be rigorous, thorough and systematic

    Testing should be rigorous, thorough and systematic

  • 8/9/2019 ISTQBCH4

    5/54

    Using techniques makes testing much more effectiveUsing techniques makes testing much more effective

    Advantages of techniques

    Different people similar pro&a&ility fin% faults

    - gain some independence of thoughtgain some independence of thought

    (ffecti*e testing fin% more faults

    - focus attention on specific types of faultfocus attention on specific types of fault

    - know you're testing the right thingknow you're testing the right thing

    (fficient testing fin% faults .ith less effort

    - avoid duplicationavoid duplication- systematic techniques are measurablesystematic techniques are measurable

  • 8/9/2019 ISTQBCH4

    6/54

    Measurement

    &0ecti*e assessment of thoroughness of

    testing +.ith respect to use of each technique,

    - useful for comparison of one test effort to anotheruseful for comparison of one test effort to another

    (g

    Project A

    60% Equivalence

    partitions

    50% Boundaries

    75% Branches

    Project B

    40% Equivalence

    partitions

    45% Boundaries

    60% Branches

  • 8/9/2019 ISTQBCH4

    7/54

    ontents

    !hat is a testing technique"

    #lac$ an% !hite &o' testing

    #lac$ &o' test techniques

    !hite &o' test techniques(rror )uessing

    Dynamic Testing Techniques

    1 2 3

    4 5 6

    ISTQB / ISEB Foundation Exam Practice

  • 8/9/2019 ISTQBCH4

    8/54

    Three types of systematic technique

    Static +none'ecution,

    examination of documentation,examination of documentation,source code listings, etc.source code listings, etc.

    unctional +#lac$ #o',

    based on behaviour /based on behaviour /functionality of softwarefunctionality of software

    Structural +!hite #o',

    based on structurebased on structureof softwareof software

  • 8/9/2019 ISTQBCH4

    9/54

  • 8/9/2019 ISTQBCH4

    10/54

    Black box versus hite box?

  • 8/9/2019 ISTQBCH4

    11/54

    ontents

    !hat is a testing technique"

    #lac$ an% !hite &o' testing

    #lac$ &o' test techniques

    !hite &o' test techniques(rror )uessing

    Dynamic Testing Techniques

    1 2 3

    4 5 6

    ISTQB / ISEB Foundation Exam Practice

  • 8/9/2019 ISTQBCH4

    12/54

    Black Box test design and

    measurement techniques Techniques %efine% in #S =>252- quivalence partitioningquivalence partitioning

    - !oundary value analysis!oundary value analysis

    - "tate transition testing"tate transition testing

    - #ause-effect graphing#ause-effect graphing

    - "yntax testing"yntax testing

    - $andom testing$andom testing 9lso %efines ho. to specify other techniques

    ? @es

    ? -o

    9lso a measurement

    technique"

  • 8/9/2019 ISTQBCH4

    13/54

    !quivalence partitioning "!#$

    - divide %partition& the inputs, outputs, etc. into areasdivide %partition& the inputs, outputs, etc. into areaswhich are the same %equivalent&which are the same %equivalent&

    - assumption if one value works, all will workassumption if one value works, all will work

    - one from each partition better than all from oneone from each partition better than all from one

    1 1AA 1A1A

    valid invalidinvalid

  • 8/9/2019 ISTQBCH4

    14/54

    Boundary value analysis "B%A$

    - faults tend to lurk near boundariesfaults tend to lurk near boundaries

    - good place to look for faultsgood place to look for faults

    - test values on both sides of boundariestest values on both sides of boundaries

    1 1AA 1A1A

    valid invalidinvalid

  • 8/9/2019 ISTQBCH4

    15/54

    !xample& 'oan

    application

    ustomer -ame

    9ccount num&er

    Loan amount requeste%

    Term of loan

    Monthly repayment

    &er'

    (epa$ent'

    )nterest rate'

    &otal paid back'

    6 di!its* +st

    non,-ero

    .500 to ./000

    + to 0 $ears

    1iniu .+0

    2,64 chars3

  • 8/9/2019 ISTQBCH4

    16/54

    (ustomer name

    -um&er of characters

    2 64 65in*ali% *ali% in*ali%

    1

    Conditions ValidPartitions

    InvalidPartitions

    ValidBoundaries

    InvalidBoundaries

    Customername

    2 to 64 charsvalid chars

    < 2 chars> 64 charsinvalid chars

    2 chars64 chars

    1 chars65 chars0 chars

    ;ali% characters 9ny

    other

    9BaCspace

  • 8/9/2019 ISTQBCH4

    17/54

    Account number

    5 6 =in*ali%

    *ali%in*ali%

    num&er of %igits

    first characterin*ali% Cero

    *ali% nonCero

    Conditions Valid

    Partitions

    Invalid

    Partitions

    Valid

    Boundaries

    Invalid

    BoundariesAccount

    number

    6 diits

    1stnon!"ero

    < 6 diits

    > 6 diits1stdiit # 0non!diit

    100000

    $$$$$$

    5 diits

    % diits0 diits

  • 8/9/2019 ISTQBCH4

    18/54

    'oan amount

    5AA >AAA >AA1

    in*ali% *ali% in*ali%

    4>>

    Conditions Valid

    Partitions

    Invalid

    Partitions

    Valid

    Boundaries

    Invalid

    Boundaries

    &oan

    amount

    500 ! $000 < 500

    >$000

    0non!numericnull

    500

    $000

    4$$

    $001

  • 8/9/2019 ISTQBCH4

    19/54

    (ondition template

    on%itions ;ali%Partitions Tag >>>>

    #3

    #4

    5 %igits

    = %igitsA %igits

    D4

    D5D6

    Loanamount

    5AA >AAA ;5 E 5AAF>AAAA

    nonintegernull

    GH

    G>

    G1A

    G11G12

    5AA>AAA

    #5

    #6

    4>>>AA1

    D=

    DH

  • 8/9/2019 ISTQBCH4

    20/54

    )esign test cases

    Test

    ase

    Description ('pecte% utcome -e. Tags

    o*ere%

    1

    2

    -ame :ohn Smith

    9cc no 123456

    Loan 25AA

    Term 3 years

    -ame 9#

    9cc no 1AAAAA

    Loan 5AA

    Term 1 year

    Term 3 years

    epayment =>H6

    6

    Term 1 year

    epayment 44HA

  • 8/9/2019 ISTQBCH4

    21/54

    Why do both !# and B%A?

  • 8/9/2019 ISTQBCH4

    22/54

    Test ob*ectives?

    or a thorough approach ;PJ

  • 8/9/2019 ISTQBCH4

    23/54

    )ecision tables

    e'plore com&inations of inputsJ situations or

    e*entsJ

    it is *ery easy to o*erloo$ specific

    com&inations of input start &y e'pressing the input con%itions of

    interest so that they are either T7( or 9LS(

    record found

    file exists

    code valid

    policy expired

    account in credit

    due date 0 current date

  • 8/9/2019 ISTQBCH4

    24/54

    !xample& student access

    9 uni*ersity computer system allo.s stu%ents

    an allocation of %isc space %epen%ing on their

    pro0ects

  • 8/9/2019 ISTQBCH4

    25/54

    'ist the input and output conditions

    list the 1output

    conditions2 under the

    input conditions

    +nput (onditions

    +alid username

    +alid password

    3ccount in credit,utput (onditions

    4ogin accepted

    $estricted access

    list the 1input

    conditions2 in the first

    column of the table

  • 8/9/2019 ISTQBCH4

    26/54

    )etermine input combinations

    a%% columns to the ta&le for each unique

    com&ination of input con%itions

    each entry in the ta&le may &e either KT for

    trueJ K for false+nput (onditions

    +alid username 5 5 5 5 6 6 6 6

    +alid password 5 5 6 6 5 5 6 63ccount in credit 5 6 5 6 5 6 5 6

  • 8/9/2019 ISTQBCH4

    27/54

    -ationalise input combinations

    some com&inations may &e impossi&le or not

    of interest

    some com&inations may &e Kequi*alent

    use a hyphen to %enote %ont care

    +nput (onditions

    +alid username 6 5 5 5

    +alid password - 6 5 5

    3ccount in credit - - 6 5

  • 8/9/2019 ISTQBCH4

    28/54

    (omplete the table

    %etermine the e'pecte% output con%itions foreach com&ination of input con%itions

    +nput (onditions

    +alid username 6 5 5 5

    +alid password - 6 5 5

    3ccount in credit - - 6 5

    ,utput (onditions

    4ogin accepted 6 6 5 5

    $estricted access - - 5 6

  • 8/9/2019 ISTQBCH4

    29/54

    )etermine test case groups each column is at least one test case

    +nput (onditions

    +alid username 6 5 5 5

    +alid password - 6 5 5

    3ccount in credit - - 6 5

    ,utput (onditions

    4ogin accepted 6 6 5 5

    $estricted access - - 5 6

    Tags A B ( )

  • 8/9/2019 ISTQBCH4

    30/54

    )esign test cases

    usually one test case for each column &ut can&e none or se*eral

    Test )escription !xpected ,utcome Tag

    + sernae Brb )nvalid usernae A

    2 sernaeusernaetoolon!

    )nvalid usernae A

    sernae BobPassord abcd

    )nvalid passord B

    4 alid user* no disc

    space

    (estricted access

    5 alid user ith discspace

    nrestricted access

  • 8/9/2019 ISTQBCH4

    31/54

    -ationalising outputs

    7 5 6 6

    8 6 5 6

    9 6 6 5 (utput 7 8 9

    if outputs or effects are mutually e'clusi*eJ

  • 8/9/2019 ISTQBCH4

    32/54

    -ationalising dangers

    rationalising is &ase% on assumptions

    assumptions may &e .rongN

    assumptions shoul% &e state%

    assumptions may change o*er time &e a.are of the %angers

    - filling in the full table may find errors which will befilling in the full table may find errors which will be

    missed if you rationalisemissed if you rationalise

    - it is possible to rationalise too farit is possible to rationalise too far

  • 8/9/2019 ISTQBCH4

    33/54

    !xtending decision tables

    (ntries can &e more than 0ust Ktrue or Kfalse

    - completing table needs to be done carefullycompleting table needs to be done carefully

    - rationalising becomes more importantrationalising becomes more important

    (g

    #ode : ;, now 5 5 6 6 5 5 6 6 5 5 6 6#lass 3 product 5 6 5 6 5 6 5 6 5 6 5 6

  • 8/9/2019 ISTQBCH4

    34/54

    )ecision Tables in relation to !# and

    B%A)nput value 8utput value

    9A:;E

    &(E

  • 8/9/2019 ISTQBCH4

    35/54

    ontents

    !hat is a testing technique"

    #lac$ an% !hite &o' testing

    #lac$ &o' test techniques

    !hite &o' test techniques

    (rror )uessing

    Dynamic Testing Techniques

    1 2 3

    4 5 6

    ISTQB / ISEB Foundation Exam Practice

  • 8/9/2019 ISTQBCH4

    36/54

    White Box test design and

    measurement techniques Techniques %efine% in #S =>252

    - "tatement testing"tatement testing

    - !ranch / ?ecision testing!ranch / ?ecision testing

    - ?ata flow testing?ata flow testing- !ranch condition testing!ranch condition testing

    - !ranch condition combination testing!ranch condition combination testing

    - @odified condition decision testing@odified condition decision testing

    - 4#"3A testing4#"3A testing 9lso %efines ho. to specify other techniques

    ? @es

    ? -o

    9lso a measurementtechnique"

  • 8/9/2019 ISTQBCH4

    37/54

    Stronger structural

    techniques (differentstructural elements)

    More tests

    .sing structural coverage

    Increasing coverage

    o*erage O"

    !hat/s

    co*ere%"

    esults O"

    (nough

    tests"Spe

    c

    Spe

    c Soft.areSoft.areTests

    More testsMore testsMore testsMore testsMore testsMore testsMore tests

  • 8/9/2019 ISTQBCH4

    38/54

    The test coverage trap

    Structure exercised,insufficient function

    Structure exercised,insufficient function

    Function exercised,

    insufficient structure

    Function exercised,

    insufficient structure

    better testingbetter testing

    % ;tateent % ecision % ondition obination

    Structural teste%ness

    unctionalteste%ness

    !!" coverage does

    not mean !!" tested#

    !!" coverage does

    not mean !!" tested#$overage is not

    Thoroughness

    $overage is not

    Thoroughness

    ;tateent covera!e

    ;tateent covera!e

  • 8/9/2019 ISTQBCH4

    39/54

    Statement coverage

    percentage of e'ecuta&le statements

    e'ercise% &y a test suite

    number of statements exercisednumber of statements exercised

    total number of statementstotal number of statements e'ample

    - program has ;BB statementsprogram has ;BB statements

    - tests exercise CD statementstests exercise CD statements

    - statement coverage : CDEstatement coverage : CDE

    ?

    Typical a% hoc testing achie*es 6A =5ITypical a% hoc testing achie*es 6A =5I

    ;tateent covera!e

    is norall$ easured

    b$ a so"tare tool3

    !

    is norall$ easured

    b$ a so"tare tool3

    b$

    this test case* e have achieved

    +00% stateent covera!e

    rea%+a,

  • 8/9/2019 ISTQBCH4

    41/54

    )ecision coverage

    "Branch coverage$ percentage of %ecision outcomes

    e'ercise% &y a test suite

    number of decisions outcomes exercisednumber of decisions outcomes exercised

    total number of decision outcomestotal number of decision outcomes e'ample

    - program has ;

  • 8/9/2019 ISTQBCH4

    42/54

    #aths through code