ISTQBCH3

download ISTQBCH3

of 47

Transcript of ISTQBCH3

  • 8/9/2019 ISTQBCH3

    1/47

    Static

    Testing

    1 Principles 2 Lifecycle

    4 Dynamic testtechniques

    3 Static testing

    5 Management 6 Tools

    Software TestingISTQB / ISEB Foundation Exam Practice

    hapter 3

  • 8/9/2019 ISTQBCH3

    2/47

    Contents

    Reviews and the test process

    Types of review

    Static analysis

  • 8/9/2019 ISTQBCH3

    3/47

    People techniques

    individual:desk-checking, data-stepping, proof-reading

    group:Reviews (infor al ! for al": for consensus#alkthrough: for education$nspection ( ost for al": to find faults

    Static techniques !o not e"ecute co!e

    Static techniques !o not e"ecute co!e

  • 8/9/2019 ISTQBCH3

    4/47

    %enefits of reviews

    &evelop ent productivity i prove entReduced develop ent ti escales

    Reduced testing ti e and cost'ifeti e cost reductionsReduced fault levels

    $ proved custo er relationsetc

  • 8/9/2019 ISTQBCH3

    5/47

    Reviews are cost-effective

    )* ti es reduction in faults reaching test, testingcost reduced +y * to .*

    /and+ook of #alkthroughs, $nspections ! TechnicalReviews - 0reed an ! #ein+erg

    reduce faults +y a factor of )*

    Structured #alkthroughs - 1ourdon

  • 8/9/2019 ISTQBCH3

    6/47

    2 reduction in schedules, re ove .* -3 of faults at each stage, 2. ti es

    reduction in aintenance cost, any others

    Software $nspection - 4il+ ! 4raha

  • 8/9/2019 ISTQBCH3

    7/47

    #hat can +e $nspected5 Anything written downcan be Inspected policy, strategy, +usiness plans, arketing or

    advertising aterial, contractssyste require ents, feasi+ility studies,acceptance test plans

    test plans, test designs, test cases, testresults

  • 8/9/2019 ISTQBCH3

    8/47

    syste designs, logical ! physicalsoftware code

    user anuals, procedures, training aterial

  • 8/9/2019 ISTQBCH3

    9/47

    #hat can +e reviewed5

    anything which could +e $nspectedi e anything written down

    plans, visions, 6+ig picture7, strategicdirections, ideaspro8ect progress

    work co pleted to schedule, etc

    6Should we develop this7 arketing options

  • 8/9/2019 ISTQBCH3

    10/47

    #hat to review 9 $nspect5

    Tests

    Tests

    Tests

    Tests

    #equirements

    Design

    o!e

    $unctions

    %ntegration T

    &nit Test

    'ccept( Test

    System Test

  • 8/9/2019 ISTQBCH3

    11/47

    Costs of reviews

    Rough guide: -) of develop ent efforthalf day a week is )*

    ffort required for reviewsplanning (+y leader 9 oderator"preparation 9 self-study checking

    eetingfi;ing 9 editing 9 follow-up

    recording ! analysis of statistics 9 etricsprocess i prove ent (should

  • 8/9/2019 ISTQBCH3

    12/47

    Contents

    Reviews and the test process

    Types of reviewStatic analysis

    Static testing

    1 2

    4 5

    3

    6

    ISTQB / ISEB Foundation Exam Practice

  • 8/9/2019 ISTQBCH3

    13/47

    Types of review of docu ents

    $nfor al Reviewundocu ented

    widely viewed as useful and cheap (+ut no one canprove itor ally docu ented,

    fault-finding Can +e rather su+8ective

  • 8/9/2019 ISTQBCH3

    14/47

    &ecision- aking Review:group discusses docu ent and akes a decision a+outthe content, e g how so ething should +e done, go or

    no-go decision, or technical co ents

  • 8/9/2019 ISTQBCH3

    15/47

    Types of review of docu ents

    #alkthroughauthor guides the group through a docu ent and his orher thought processes, so all understand the sa ething, consensus on changes to ake

    $nspection:for al individual and group checking, using sourcesand standards, according to generic and specific rulesand checklists, using entry and e;it criteria, 'eader

    ust +e trained ! certified, etrics required

  • 8/9/2019 ISTQBCH3

    16/47

    Reviews in general )

    ?+8ectives 9 goalsvalidation ! verification against specifications !standardsachieve consensus (e;cluding $nspection"process i prove ent (ideal, included in$nspection"

  • 8/9/2019 ISTQBCH3

    17/47

    Reviews in general 2

    =ctivitiesplanningoverview 9 kick-off eeting ($nspection"preparation 9 individual checkingreview eeting (not always"follow-up (for so e types"

    etrics recording ! analysis ($nspections andso eti es reviews"

  • 8/9/2019 ISTQBCH3

    18/47

    Reviews in general @

    Roles and responsi+ilities'eader 9 oderator - plans the review 9 $nspection,chooses participants, helps ! encourages,conducts the eeting, perfor s follow-up,

    anages etrics =uthor of the docu ent +eing reviewed 9$nspected

  • 8/9/2019 ISTQBCH3

    19/47

    Reviewers 9 $nspectors - specialised fault-findingroles for $nspectionAanagers - e;cluded fro so e types of review,need to plan pro8ect ti e for review 9 $nspection?thers: e g $nspection9 review Co-ordinator

  • 8/9/2019 ISTQBCH3

    20/47

    Reviews in general B

    &elivera+lesChanges (edits" in review productChange requests for source docu ents (predecessordocu ents to product +eing reviewed 9 $nspected"Process i prove ent suggestions

    to the review 9 $nspection processto the develop ent process which produced the product 8ust

    reviewed 9 $nspectedAetrics ($nspection and so e types of review"

  • 8/9/2019 ISTQBCH3

    21/47

    Reviews in general

    Pitfalls (they don t always work

  • 8/9/2019 ISTQBCH3

    22/47

    'ack of anage ent support - 6lip service7 - wantthe done, +ut don t allow ti e for the tohappen in pro8ect schedules

    0ailure to i prove processes (gets disheartening 8ust getting +etter at finding the sa e thing overagain"

  • 8/9/2019 ISTQBCH3

    23/47

    $nspection is different

    D the docu ent to +ereviewed is given out inadvance

    D typically doEens ofpages to review

    D instructions are Fpleasereview thisF

    D not ust product!sources

    Dchun" or samp#e

    D training! ro#es

  • 8/9/2019 ISTQBCH3

    24/47

    $nspection is different

    D so e people have ti eto look through it and

    ake co ents +efore

    the eeting (which isdifficult to arrange"

    D the eeting often lastsfor hours

    entry criteria tomeeting! may not beworth ho#ding

    $ max%! often muchshorter

  • 8/9/2019 ISTQBCH3

    25/47

    $nspection is different

    D F$ donGt like thisF

    D uch discussion, so ea+out technicalapproaches, so e a+outtrivia

    D donGt really know if it wasworthwhile, +ut we keepdoing it

    &u#e 'io#ations! ob ecti'e!not sub ecti'e

    D no discussion! high#yfocused! anti(tri'ia

    on#y do it if 'a#ue is

    pro'en )continua##y*

  • 8/9/2019 ISTQBCH3

    26/47

    $nspection is ore and +etter

    entry criteriatrainingopti u checking rate

    prioritising the wordsstandards

    process i prove ente;it criteriaquantified esti ates of

    re aining a8or faultsper page

    typical re)ie*

    early %nspection

    mature %nspection

    effecti)eness return on in)estment

    1+ , 2+- un.no*n

    3+ , 4+- 6 , / hrs 0 %nsp hr

    /+ , 5- / , 3+ hrs 0 %nsp hr

  • 8/9/2019 ISTQBCH3

    27/47

    The $nspection ProcessSoft*are

    De)elopmentStage

    (

    (

    Planning

    ic.off

    %n!h. Meet !it

    hange#equest

    Process%mpro)ement

    ntry

    e"t Soft*areDe)elopment

    Stage

    "it

  • 8/9/2019 ISTQBCH3

    28/47

  • 8/9/2019 ISTQBCH3

    29/47

    Reviews: ti e and siEe deter inerate

    Time

    hec.ing#ate

    Si e

    2 hrs5

    )** pages5

    * pages per hour

    hec.ing#ate

  • 8/9/2019 ISTQBCH3

    30/47

    Review 6Thoroughness75

    ordinary review - finds some faults, one major, fi them,consider the document now corrected and !"

    ma or inor

    inor

  • 8/9/2019 ISTQBCH3

    31/47

  • 8/9/2019 ISTQBCH3

    32/47

    $nspection Thoroughness

    Inspection can find deep-seated faults:# all of that type can $e corrected# $ut needs optimum chec%in& rate

  • 8/9/2019 ISTQBCH3

    33/47

  • 8/9/2019 ISTQBCH3

    34/47

    Contents

    Reviews and the test process

    Types of review

    Static analysis

  • 8/9/2019 ISTQBCH3

    35/47

    #hat can static analysis do5

    #emem8er9 static techniques !onot e"ecute

    the co!e = for of auto ated testing

    check for violations of standards

    check for things which ay +e a fault

  • 8/9/2019 ISTQBCH3

    36/47

    &escended fro co piler technologya co piler statically analyses code, and 6knows7 alot a+out it, e g varia+le usageI finds synta; faultsstatic analysis tools e;tend this knowledgecan find unreacha+le code, undeclared varia+les,para eter type is- atches, uncalled functions !procedures, array +ound violations, etc

  • 8/9/2019 ISTQBCH3

    37/47

    &ata flow analysis

    This is the study of progra varia+lesvaria+le definedJ where a value is stored into itvaria+le used where the stored value is accessedvaria+le is undefined +efore it is defined or when itgoes out of scope

    +defined shou#d not be confused with dec#ared

    " : y ;

    %$ a < 8 T= rea!>S?

    x is defined! y and , are used

    a and b are used! S is defined

  • 8/9/2019 ISTQBCH3

    38/47

    &ata flow analysis faults

    n 9: +

    rea! >"?

    n 9: 1

    *hile " < y !o8egin

    rea! >y?

    *rite> n7y?

    " 9: " , n

    en!

    -ata f#ow anoma#y. n isre(defined without being used

    -ata f#ow fau#t. y is used before it has been defined )first time around the #oop*

  • 8/9/2019 ISTQBCH3

    39/47

    Control flow analysis

    /ighlights:nodes not accessi+le fro start nodeinfinite loops

    ultiple entry to loopswhether code is well structured, i e reduci+lewhether code confor s to a flowchart gra ar any 8u ps to undefined la+els

    any la+els not 8u ped tocyclo atic co ple;ity and other etrics

  • 8/9/2019 ISTQBCH3

    40/47

    Knreacha+le code e;a ple

    Aacro definitions (different for different platfor s the code runs on"

    %uffsiEe: )***Aail+o; a;: )***$0 %uffsiEe L Aail+o; a; T/ >

    rror- ;it>&$0

  • 8/9/2019 ISTQBCH3

    41/47

    Static =nalysis finds the T/ > clauseunreacha+le, so will flag a fault

  • 8/9/2019 ISTQBCH3

    42/47

    Cyclo atic co ple;ity

    cyclo atic co ple;ity is a easure of theco ple;ity of a flow graph

    (and therefore the code that the flow graph represents"

    the ore co ple; the flow graph, the greater theeasure

    it can ost easily +e calculated as:

    co ple;ity H nu +er of decisions M )

  • 8/9/2019 ISTQBCH3

    43/47

    #hich flow graph is ost co ple;5

    )

    2 @

    hat is the cyc#omatic comp#exity0

    l l fl hinit

  • 8/9/2019 ISTQBCH3

    44/47

    ;a ple control flow graph

    #esult : +

    #ight : +

    D@ A=%L more Buestions

    %$ 'ns*er : orrect T=

    #ight : #ight ; 1

    D%$

    D D@

    #esult : >#ight 0 Buestions?

    %$ #esult < 6+- T=

    Print CpassC

    LS

    Print Cfail

    D%$

    !o

    if r:r;1

    en!

    if

    res

    pass

    fail

    en!

    Pseu!o,co!e9

  • 8/9/2019 ISTQBCH3

    45/47

    ?ther static etrics

    lines of code ('?C"operands ! operators (/alstead s etrics"fan-in ! fan-outnesting levelsfunction calls?? etrics: inheritance tree depth, nu +er of

    ethods, coupling ! cohesion

  • 8/9/2019 ISTQBCH3

    46/47

    'i itations and advantages

    'i itations:cannot distinguish Ffail-safeF code fro progra ing faultsor ano alies (often creates overload of spurious error

    essages"does not e;ecute the code, so not related to operatingconditions

    =dvantages:can find faults difficult to FseeFgives o+8ective quality assess ent of code

  • 8/9/2019 ISTQBCH3

    47/47

    Su ary: Ney Points

    Reviews help to find faults in develop entand test docu entation, and should +eapplied early

    Types of review: infor al, walkthrough,technical 9 peer review, $nspection

    Static analysis can find faults and give

    infor ation a+out code without e;ecuting it