SlideShare a Scribd company logo
1 of 32
Download to read offline
TTTTeeeesssstttt AAAAuuuuttttoooommmmaaaattttiiiioooonnnn 
MMMMyyyytttthhhhssss 
AApprriill 2211,, 22001100 
KKWWSSQQAA QQuuaalliittyy AAssssuurraannccee CCoonnffeerreennccee 
KKeevviinn BBuurrrr 
OOttttaawwaa SSooffttwwaarree QQuuaalliittyy AAssssoocciiaattiioonn 
661133--225533--44225577 osqa.org
Myths aabboouutt AAuuttoommaattiioonn 
 Test automation only saves you time during 
Regression testing 
 You can’t automate tests until… 
 the product is stable 
 you have a product to test. 
 until the requirements are stable
RReeaall LLiiffee EExxaammpplleess:: 
AApppplliiccaattiioonn LLeevveell TTeessttiinngg 
 Translated SMTP email to x400 
format 
 Very mature system 
 Testing took 1 week 
 Uncovered 8 failures (bugs) 
 Work was done by 1st year co-op 
[More later] 
100.00 
90.00 
80.00 
70.00 
60.00 
50.00 
40.00 
30.00 
20.00 
10.00 
System under Test: 
 36 Fields 
 29 Trillion Exhaustive 
Testcases 
 72 “defaults” Testcases 
75% branch coverage 
 47 Pair-wise Testcases 
93% branch coverage 
E-mail Coverage Results 
Testsuite 
Coverage (%) 
0.00 
1 2 3 4 5 6 7 8 9 
Block 
Branch
More RReeaall LLiiffee EExxaammpplleess:: 
UUnniitt LLeevveell TTeessttiinngg 
System under Test: 
 Unit testing of Controllers and 
Device Drivers on Real-time 
Embedded System 
 First iteration was manual 
 Everything after the second was 
automated 
 Effort is measured in test 
vectors: a single test input 
3000 
2500 
2000 
1500 
1000 
500 
0 
1 2 3 4 5 6 
Iteration 
 Iteration 1 represents the number of manual test vectors that can 
be run in 2 weeks.. 
 By iteration 6 productivity essentially increased 2.5 times ! 
 Over 5,000 more test vectors were run than possible manually! 
 This is equivalent to 10 weeks extra testing for free. 
 The tester also able took a 2 week vacation and worked on other 
assignments, which would have been impossible originally 
Test Vectors 
New 
Regression
And More RReeaall LLiiffee EExxaammpplleess:: 
 SSOOAA SSyysstteemm PPeerrffoorrmmaannccee TTeessttiinngg 
 110000 tteessttccaasseess,, 11 hhoouurr ppeerr tteessttccaassee,, oonn 22 tteessttbbeeddss,, iinn 11 wweeeekk bbyy 
11 tteesstteerr 
 UUpp ttoo 110000 ssiimmuullaatteedd uusseerrss wwiitthh mmuullttiippllee rroolleess,, mmuullttiippllee eevveenntt 
ppaatttteerrnnss,, eettcc.. 
 TTeesstteerr wwaass aallssoo wwrriittiinngg aa tteesstt ttooooll aatt tthhee ssaammee ttiimmee.. 
 WWeebb AApppplliiccaattiioonn SSyysstteemm TTeessttiinngg 
 7700 tteessttccaasseess ccrreeaatteedd aanndd eexxeeccuutteedd iinn 11 wweeeekk.. 
 RReedduucceedd 770000 tteesstt ccaasseess ttoo 113300 IInntteeggrraattiioonn TTeessttccaasseess 
 AAuuttoommaatteedd IInnssttaallllaattiioonn tteessttiinngg ffoorr eevveerryy ppoossssiibbllee 
ccoonnffiigguurraattiioonn ooff rroouuttiinngg ffrraammeewwoorrkk.. 
 EEttcc..
AAggeennddaa 
 MMyytthhss vvss.. RReeaalliittyy 
 TTyyppeess ooff AAuuttoommaattiioonn 
11.. AAuuttoommaatteedd TTeesstt CCrreeaattiioonn 
22.. AAuuttoommaatteedd TTeesstt EExxeeccuuttiioonn 
33.. AAuuttoommaatteedd TTeesstt VVaalliiddaattiioonn 
 WWhheenn AAuuttoommaattiioonn GGooeess WWrroonngg 
 CCoonncclluussiioonn
Data Driven EEccoonnoommiieess ooff SSccaallee 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--------- 
-- 
TC1--- 
-------- 
--------- 
-- 
TC1--- 
-------- 
--- 
--- 
-------- 
-------- 
-------- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
-- -- -- -- -- -- -- -- -- -- -- -- - - - - 
--- 
-------- 
-------- 
-------- 
--- 
-------- 
-------- 
-------- 
TC 
TC 
TC 
TC 
TC 
TC 
TC 
Test 
Driver 
-- -- -- -- -- -- -- -- -- -- -- -- - - - - 
OR
2.0 Automated TTeesstt EExxeeccuuttiioonn 
Approach Pros Cons 
 Requires experienced programmer 
to maintain/create parser 
 Keyword “scripts” have to be 
maintained 
 Simple keywords capture 
actions 
 Requires testers to have least 
coding experience 
Keyword 
Driven 
 Requires better coding skills 
 Test scenarios may be complex in 
order to take advantage of 
common test driver 
 Uses parameters or data files to 
drive testcases 
 Fastest to create testcases 
 Less code, less maintenance 
Data 
Driven 
 Requires good programmers to 
support re-useable code. 
 Uses shared libraries for 
common functions 
 Faster to create, easier to 
maintain  more robust 
 Supports mix of coding skills 
Shared 
code 
 Needs more planning 
 Maintenance is a problem 
 Leads to code duplication 
 Slowest to create (unless copying) 
 More robust 
 Intermediate coding skills 
Structured 
Code 
 Breaks easily 
 Hopeless to maintain 
 Fast and easy to create 
 Requires little to no coding 
experience 
Record 
and 
Playback
2.1 Data DDrriivveenn AAuuttoommaattiioonn 
 aakkaa TTaabbllee ddrriivveenn 
 EEaacchh tteesstt ccaassee iiss 11 lliinnee iinn 
ttaabbllee 
 TTeesstt ddrriivveerr aauuttoommaatteess aa uussee-- 
ccaassee 
 UUssee tteesstt aattttrriibbuutteess aanndd 
eexxppeecctteedd rreessuullttss ttoo ccrreeaattee aa 
ddaattaa ttaabbllee ffoorr tteesstt ddrriivveerr 
 BBeehhaavviioorr iiss ddaattaa mmooddeelleedd.. 
TTeesstt ddrriivveerr mmaayy ddrriivvee SSUUTT 
ddiirreeccttllyy oorr ccrreeaattee aa tteesstt 
ssccrriipptt ffoorr eeaacchh tteesstt ccaassee 
 TTeesstt ddrriivveerr mmaayy iinntteerraacctt wwiitthh 
mmuullttiippllee aauuttoommaattiioonn ttoooollss 
bbeehhiinndd tthhee sscceenneess.. 
 TTeesstt ddrriivveerr ccaann bbee aass 
ccoommpplleexx oorr ssiimmppllee.. 
Create and Set timer T2 
T2 active 
Cancel T2 
T2 inactive 
T2 inactive 
Error is issued 
T2 active 
Reset T2 Error is issued 
TTeesstt AAttttrriibbuuttee PPoossssiibbllee vvaalluueess TTeesstt vvaalluueess 
00,,11,,22,,33,,2200,,4400,,6611,, 
110000,,990000 
00,,11,,22,,……,, 
MMAAXX__VVAALLUUEE 
VVaalluuee 
GGrraannuullaarriittyy 11,,22,,33,,44 11,,22,,33,,44 
oonnee sshhoott ttiimmeerr,, 
ppeerriiooddiicc ttiimmeerr 
oonnee sshhoott ttiimmeerr,, 
ppeerriiooddiicc ttiimmeerr 
TTyyppee 
CCrreeaattee bbrraanncchh aaccttiivvee,, iinnaaccttiivvee aaccttiivvee,, iinnaaccttiivvee 
CCaanncceell bbrraanncchh aaccttiivvee,, iinnaaccttiivvee aaccttiivvee,, iinnaaccttiivvee
2.2 Keyword DDrriivveenn AAuuttoommaattiioonn 
WWiinnddooww AAccttiioonn OObbjjeecctt VVaalluuee 
MMaaiinn CClliicckk NNeexxttBBuuttttoonn 
MMaaiinn CClliicckk MMeennuuBBaarr FFiillee 
MMaaiinn CClliicckk MMeennuuBBaarr PPrriinntt…… 
PPrriinntt EEnntteerrVVaalluuee NNuummbbeerrCCooppiieess 22 
PPrriinntt SSeelleecctt PPrriinntteerrNNaammee AAddoobbee PPDFF 
PPrriinntt CClliicckk OOKKBBuuttttoonn 
 aakkaa TTaabbllee Drriivveenn 
 SSiinnggllee tteesstt ddrriivveerr ffoorr wwhhoollee 
SSyysstteemm uunnddeerr TTeesstt 
 11 tteesstt ccaassee ppeerr ttaabbllee,, 11 aaccttiioonn 
ppeerr lliinnee 
 ee..gg.. WWiinnddooww,, AAccttiioonn,, OObbjjeecctt,, 
VVaalluuee 
 CCaann aallssoo vvaalliiddaattee ddaattaa 
 Deeppeennddiinngg oonn yyoouurr tteesstt ppllaann ““ssttyyllee”” 
tthhiiss ccaann bbeeccoommee eexxeeccuuttaabbllee 
ddooccuummeennttaattiioonn 
 TTeesstt iinnssttrruuccttiioonnss aarree tthhee aauuttoommaattiioonn 
 IIff yyoouu eexxppaanndd ccoonncceepptt ttoo ssiimmpplliiffiieedd 
ssccrriippttiinngg llaanngguuaaggeess 
 ee..gg.. CClliicckk ((““MMaaiinn””,, ““NNeexxttBBuuttttoonn””)) 
 TThhiiss iiss tthhee mmoosstt ppooppuullaarr ddaattaa ddrriivveenn 
tteessttiinngg aapppprrooaacchh bbyy ffaarr.. 
 BBuutt nnoott aass ffaasstt ttoo ccrreeaattee aass pprreevviioouuss 
EE..gg.. SSAAFFSSDEEVV,, SSTTAAFF,,  BBeehhaavviioouurr--BBaasseedd
1.0 Automated TTeesstt CCrreeaattiioonn 
 UUssee mmooddeell ooff ssyysstteemm 
ttoo aauuttoommaattiiccaallllyy 
ggeenneerraattee aauuttoommaatteedd 
tteesstt ccooddee 
 TTyyppeess:: SSttaattee ddiiaaggrraammss 
((iinncclluuddiinngg UUMMLL,, SSDLL,, 
eettcc..)),, SSeettss,, GGrraammmmaarrss,, 
CCoommbbiinnaattiioonnss 
Create and Set timer T2 
T2 active 
Cancel T2 
T2 inactive 
T2 inactive 
Error is issued 
T2 active 
Reset T2 Error is issued 
 TToooollss ttoo vvaalliiddaattee mmooddeell,, ffiinndd mmiinniimmuumm tteesstt ppaatthhss,, eettcc.. 
 BBeesstt ooff aallll:: mmaannaaggee tthhee mmooddeell aanndd nnoott tthhee tteesstt ccooddee
11..11 PPaaiirr-wwiissee tteesstt ggeenneerraattiioonn 
 MMaannyy ssyysstteemmss ssuuffffeerr ffrroomm aa ccoommbbiinnaattoorriiaall 
eexxpplloossiioonn ooff ppoossssiibbllee tteessttccaasseess 
 PPaaiirr--wwiissee tteesstt ggeenneerraattiioonn bbaasseedd oorriiggiinnaallllyy oonn 
Deessiiggnn ooff EExxppeerriimmeennttss TThheeoorryy 
 DOOEE iiss aann eexxcceelllleenntt wwaayy ttoo ccrreeaattee ppeerrffoorrmmaannccee 
cchhaarraacctteerriizzaattiioonn tteessttss ffoorr ppeerrffoorrmmaannccee eessttiimmaattiioonn.. 
 Doo nnoott nneeeedd tthhee bbaallaanncceedd nnuummbbeerr ooff ppaaiirrss iinn DOOEE ffoorr 
rreegguullaarr tteessttiinngg..
PPaaiirr-wwiissee TTeesstt CCaasseess:: 
1133 FFiieellddss,, 33 IInnppuuttss,, 1155 TTeesstt ccaasseess 
TEST Field1 Field2 Field3 Field4 Field5 Field6 Field7 Field8 Field9 Field10 Field11 Field12 Field13 
Case1 1 1 1 1 1 1 1 1 1 1 1 1 1 
Case2 1 2 2 2 2 2 2 2 2 2 1 1 1 
Case3 1 3 3 3 3 3 3 3 3 3 1 1 1 
Case4 2 1 1 2 2 2 3 3 3 1 2 2 1 
Case5 2 2 2 3 3 3 1 1 1 2 2 2 1 
Case6 2 3 3 1 1 1 2 2 2 3 2 2 1 
Case7 3 1 1 3 3 3 2 2 2 1 3 3 1 
Case8 3 2 2 1 1 1 3 3 3 2 3 3 1 
Case9 3 3 3 2 2 2 1 1 1 3 3 3 1 
Case10 1 2 3 1 2 3 1 2 3 1 2 3 2 
Case11 2 3 1 2 3 1 2 3 1 2 3 1 2 
Case12 3 1 2 3 1 2 3 1 2 3 1 2 2 
Case13 1 3 2 1 3 2 1 3 2 1 3 2 3 
Case14 2 1 3 2 1 3 2 1 3 2 1 3 3 
Case15 3 2 1 3 2 1 3 2 1 3 2 1 3 
Maximum possible combinations = 1,594,323
11..11 PPaaiirr-wwiissee tteesstt ggeenneerraattiioonn 
 PPrroodduucceess aa vveerryy ssmmaallll ((bbuutt ttwwiisstteedd)) sseett ooff tteesstt 
ccaasseess 
 EEaassiillyy ffeeeeddss ddiirreeccttllyy iinnttoo ddaattaa ddrriivveenn tteesstt ddrriivveerr 
 UUssee aa ttooooll tthhaatt uusseess rruulleess ((pprreeddiiccaatteess)) ttoo 
pprreevveenntt iimmppoossssiibbllee ccoommbbiinnaattiioonnss ooff iinnppuuttss 
 MMooddeelliinngg aarroouunndd tthheemm iiss ttoooo hhaarrdd
11..22 TTeessttiinngg TTeessttiinngg ((FFeeeeddbbaacckk LLoooopp)) 
 HHooww ddoo yyoouu kknnooww yyoouu hhaavvee tteesstteedd eevveerryytthhiinngg?? 
 UUnnddooccuummeenntteedd rreeqquuiirreemmeennttss aanndd ffeeaattuurreess 
 UUnnddooccuummeenntteedd ddeeppeennddeenncciieess 
 UUssiinngg oouutt ooff ddaattee ddooccuummeennttaattiioonn 
 MMiissssiinngg ccooddee 
 HHooww ddoo yyoouu kknnooww yyoouu aarree nnoott wwaassttiinngg ttiimmee tteessttiinngg ssoommee 
ffuunnccttiioonnaalliittyy ttoooo mmuucchh?? 
 MMeeaassuurree wwhhaatt ccooddee wwaass nnoott eexxeeccuutteedd ((ccooddee 
ccoovveerraaggee)) 
 WWhhaatteevveerr ffuunnccttiioonnaalliittyy tthhaatt ccooddee wwaass wwrriitttteenn ttoo 
iimmpplleemmeenntt iiss mmiissssiinngg ffrroomm tthhee tteessttssuuiittee 
 DDooeess nnoott tteellll yyoouu aannyytthhiinngg aabboouutt tthhee ccooddee tthhaatt wwaass 
eexxeeccuutteedd
Error vvss.. BBrraanncchh CCoovveerraaggee 
0.450 0.500 0.550 0.600 0.650 0.700 0.750 0.800 0.850 
Branch Coverage 
1 
0.9 
0.8 
Fault Coverage 
0.7 
0.6 
0.5 
0.4 
0.3 
0.2 
0.1 
0 
WWiitthhoouutt mmeeaassuurriinngg ccoovveerraaggee,, tteessttss oofftteenn oonnllyy eexxeerrcciissee 
7700%% ooff tthhee ccooddee,, hhoowweevveerr bbuuggss oofftteenn hhiiddee iinn tthhee hhaarrdd ttoo 
tteesstt ccooddee,, aass iinn tthhiiss eexxaammppllee.. 
Ref: “The Relationship Between Test Coverage and Reliability” by Yeshwant Malaiya, Naixin Li, Jim Bieman, Rick Karich, Bob Skibbe, Proc. 5th ISSRE, Nov. 1994
CCoovveerraaggee RReessuullttss - PPrroocceedduurree TTeesstt 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
Testcase 
100.00 
90.00 
80.00 
70.00 
60.00 
50.00 
40.00 
30.00 
20.00 
10.00 
0.00 
Branch Coverage 
Total Coverage 
96.08 
Redundantt code coverage miightt be wastted ttesttiing ttiime 
Branch Coverage (%) 
Duplicate Coverage
Sanity SSuubbssyysstteemm CCoovveerraaggee 
CCooddee CCoovveerraaggee -- nnoott jjuusstt ffoorr UUnniitt TTeesstt 
V.56 V.87 
Area Procedures Hits Percent Hit Procedures Hits Percent Hit 
7 0 0 7 0 0 
0 0 0 88 13 15 
810 33 4 895 36 4 
102 26 25 114 38 33 
5545 893 16 7454 1117 15 
1736 304 18 2302 325 14 
570 24 4 606 65 11 
407 2 0 424 32 8 
13 0 0 321 67 21 
46 0 0 46 0 0 
TOTAL 9324 1282 14 12257 1693 14 
Area Subsystems Hits Percent Hit Subsystems Hits Percent Hit 
1 0 0 1 0 0 
1 0 0 1 1 100 
1 1 100 1 1 100 
1 1 100 1 1 100 
24 18 75 25 24 96 
4 4 100 4 4 100 
2 1 50 1 1 100 
3 1 33 3 1 33 
1 0 0 1 1 100 
1 0 0 1 0 0 
TOTAL 39 26 67 39 34 87
2.1 RRiisskk BBaasseedd TTeessttiinngg 
 RRaarreellyy aabbllee ttoo tteesstt eevveerryytthhiinngg 
 SSoommee ppaarrttss ooff tthhee ccooddee tteenndd ttoo hhaavvee mmoorree bbuuggss tthhaann 
ootthheerr ppllaacceess 
 NNeeww oorr cchhaannggeedd ccooddee 
 CCoommpplleexx ccooddee 
 FFuunnccttiioonnaalliittyy mmoosstt uusseedd bbyy ccuussttoommeerrss.. 
 EEttcc.. 
 UUssee rriisskk mmeettrriiccss ttoo ffooccuuss tteessttiinngg oonn tthhee ppaarrttss ooff tthhee ccooddee 
mmoosstt lliikkeellyy ttoo hhaavvee bbuuggss ccuussttoommeerrss wwiillll ffiinndd.. 
 MMaannyy ttyyppeess –– jjuusstt ggooiinngg ttoo mmeennttiioonn aauuttoommaatteedd..
Correlating Complexity wwiitthh PPrroobblleemmss 
100 
97.0% 
Predicted Model 
0 25 50 75 100 
80 
60 
40 
20 
0 
 6644%% ooff pprroobblleemmss ffoouunndd iinn ttoopp 2255%% ccoommpplleexx ccooddee 
 33%% ooff pprroobblleemmss ffoouunndd iinn bboottttoomm 2255%% ccoommpplleexx ccooddee 
 FFooccuuss tteessttiinngg oonn hhiigghhllyy ccoommpplleexx ccooddee aanndd aavvooiidd ssppeennddiinngg ttiimmee 
oonn lleeaasstt ccoommpplleexx.. 
Module Count % 
64.40 
Actual 
Cumulative Problem Count %
3.0 Automated TTeesstt VVaalliiddaattiioonn 
((aakkaa OOrraaccllee)) 
 HHaarrdd ccooddeedd 
 EExxpplliicciitt ““AAsssseerrttss”” oorr ccooddeedd 
iinntteerraaccttiioonn wwiitthh SSUUTT ((ee..gg.. tthhrroouugghh 
AAPPII)) 
 CCrreeaatteedd bbyy mmooddeell!! 
 SUT does not follow test case’s 
logic 
 Generate verification code as well as execution 
code
3.0 Automated TTeesstt VVaalliiddaattiioonn 
((aakkaa OOrraaccllee)) 
 CCaappttuurree RReeppllaayy 
 CCoommppaarree tteesstt rreessuullttss ttoo rreessuullttss 
ffrroomm aa pprreevviioouuss vveerrssiioonn 
 Previous version becomes the 
“Oracle” 
 Previous version could also be a 
model (e.g. prototype) 
 FFiilltteerr oouutt oorr cclleeaann uupp tthhee cchhaannggeeaabbllee bbiittss 
 BBiittmmaappss bbaadd,, tteexxtt aanndd nnuummbbeerrss ggoooodd
When Automation GGooeess WWrroonngg 
 Find false positives – no-one trusts results 
 Does not find any bugs 
 Runs slower than manual testing 
 Tests become un-maintainable after a couple 
releases
When Automation GGooeess WWrroonngg 
 Find false positives – no-one 
trusts results 
 Does not find any bugs 
 Runs slower than manual 
testing 
 Tests become un-maintainable 
after a couple releases 
 TTeesstt AAuuttoommaattiioonn//TToooollss hhaavvee ttoo bbee ttrreeaatteedd lliikkee rreeaall ccooddee.. 
 NNeeeeddss ttoo bbee ccooddee rreevviieewweedd,, tteesstteedd,, eettcc.. 
 NNeeeeddss ttoo bbee mmaaiinnttaaiinnaabbllee 
 GGaarrbbaaggee iinn GGaarrbbaaggee oouutt.. 
 NNoo tteecchhnniiqquuee wwiillll ffiinndd aallll bbuuggss –– uussee aa vvaarriieettyy 
 IIff pprroodduucctt bbuuggss eessccaappee,, ffiinndd oouutt wwhhyy aanndd ffiixx tthhee tteesstt ccooddee
RReeaall LLiiffee EExxaammpplleess:: 
AApppplliiccaattiioonn LLeevveell TTeessttiinngg 
100.00 
90.00 
80.00 
70.00 
60.00 
50.00 
40.00 
30.00 
20.00 
10.00 
Benefits: 
 Fewer testcases: less time to test and verify results 
 High level of code coverage 
 Incorporates boundary testing 
 Both success and failure testcases generated 
 Ease of adapting testcase suite to changing requirements 
 We were given the wrong requirements initially and slowly discovered the 
correct ones 
 36 Fields 
 29 Trillion Exhaustive 
Testcases 
 72 “defaults” Testcases 
 75% branch coverage 
 47 Pair-wise Testcases 
 93% branch coverage 
E-mail Coverage Results 
Testsuite 
Coverage (%) 
0.00 
1 2 3 4 5 6 7 8 9 
Block 
Branch
EEvveerryytthhiinngg TTooggeetthheerr 
Modell 
Code 
Code 
Coverage 
Auto 
TCs 
Redefiine 
Modell 
Run Tests 
Churn 
Compllexiity 
Requiirements
Myths aabboouutt AAuuttoommaattiioonn 
 Test automation only saves you time during 
Regression testing 
Deeppeennddiinngg oonn tteecchhnniiqquuee,, yyoouu ccaann ggeenneerraattee aanndd eexxeeccuuttee 
aauuttoommaatteedd tteesstt ccaasseess ffaasstteerr tthhaann mmaannuuaall tteesstt ccaasseess 
 You can’t automate tests until… 
 the product is stable 
 you have a product to test. 
 until the requirements are stable 
MMooddeellss aanndd//oorr TTeesstt ddrriivveerrss ccaann bbee wwrriitttteenn iinn ppaarraalllleell wwiitthh 
pprroodduucctt ccooddee aanndd ttwweeaakkeedd aass nneeeeddeedd..
TThhaannkk-yyoouu!! 
 QQuueessttiioonnss?? 
osqa.org
osqa.org
Baby sstteeppss aanndd CCoonnttiinnuuoouuss 
IImmpprroovveemmeenntt 
 SSeelleecctt aa ggooaall aanndd ppllaann hhooww ttoo ggeett tthheerree 
 Deecciiddee hhooww ttoo mmeeaassuurree ssuucccceessss aanndd mmeeaassuurree 
wwhheerree yyoouu ccuurrrreennttllyy aarree 
 Doonn’’tt ttrryy ttoo ddoo ttoooo mmuucchh 
 SSeellll ssoolluuttiioonnss bbaasseedd oonn nneeeeddss 
 WWoorrkk wwiitthh tthhee wwiilllliinngg aanndd nneeeeddyy ffiirrsstt 
 KKeeeepp ffooccuusseedd oonn ggooaallss aanndd pprroobblleemmss 
 AAlliiggnn tthhee bbeehhaavviioouurr ooff MMaannaaggeerrss aanndd PPrraaccttiioonneerrss 
 MMeeaassuurree aanndd eevvaalluuaattee pprrooggrreessss 
MMaakkiinngg pprroocceessss iimmpprroovveemmeenntt wwoorrkk:: aa ccoonncciissee aaccttiioonn gguuiiddee ffoorr ssooffttwwaarree ...... 
BByy NNeeiill SS.. PPootttteerr,, MMaarryy EE.. SSaakkrryy
RReeffeerreenncceess 
 BBuurrrr,, KKeevviinn  YYoouunngg,, WWiilllliiaamm,, 11999988,, CCoommbbiinnaattoorriiaall tteesstt 
tteecchhnniiqquueess:: TTaabbllee-bbaasseedd aauuttoommaattiioonn,, tteesstt ggeenneerraattiioonn aanndd 
ccooddee ccoovveerraaggee ,, PPrroocceeeeddiinnggss ooff tthhee IInnttll.. CCoonnff.. oonn SSooffttwwaarree TTeessttiinngg 
AAnnaallyyssiiss aanndd RReevviieeww,, SSaann Diieeggoo,, CCAA.. OOccttoobbeerr 11999988,, 
hhttttpp::////aaeettggwweebb..aarrggrreeeennhhoouussee..ccoomm//aaeettgg__nnoorrtteell..ppddff 
 BBuurrrr,, KKeevviinn.. 11999988,, TTeesstt AAcccceelleerraattiioonn,, IIEEEEEE OOttttaawwaa,, JJuunnee 11999988 
 hhttttpp::////wwwwww..ppaaiirrwwiissee..oorrgg// 
 Malaiya, Y., Li, N., Bieman, J., Karich, R.,  Skibbe, B., 1994, The 
Relationship Between Test Coverage and Reliability, Proc. 
5th ISSRE, Nov. 1994 
 Potter, Neil  Sakry, Mary, Making process improvement work: 
A concise action guide for software Managers and 
Practitioners, Pearson Education Inc., 2002
osqa.org

More Related Content

Similar to Test Automation Myths

Comparative study of cyclic activated sludge and conventional activated sludg...
Comparative study of cyclic activated sludge and conventional activated sludg...Comparative study of cyclic activated sludge and conventional activated sludg...
Comparative study of cyclic activated sludge and conventional activated sludg...Arvind Kumar
 
Penetration testing: A proactive approach to secure computing - Eric Vanderbu...
Penetration testing: A proactive approach to secure computing - Eric Vanderbu...Penetration testing: A proactive approach to secure computing - Eric Vanderbu...
Penetration testing: A proactive approach to secure computing - Eric Vanderbu...Eric Vanderburg
 
Von neumann architecture
Von neumann architectureVon neumann architecture
Von neumann architectureNazak Rehman
 
Hardware and operating sytems
Hardware and operating sytemsHardware and operating sytems
Hardware and operating sytemsspooler85
 
CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 07
CS201- Introduction to Programming- Lecture 07CS201- Introduction to Programming- Lecture 07
CS201- Introduction to Programming- Lecture 07Bilal Ahmed
 
Ethernet Over CoAxial(EOC)
Ethernet Over CoAxial(EOC)Ethernet Over CoAxial(EOC)
Ethernet Over CoAxial(EOC)Vishal Katara
 
CS201- Introduction to Programming- Lecture 13
CS201- Introduction to Programming- Lecture 13CS201- Introduction to Programming- Lecture 13
CS201- Introduction to Programming- Lecture 13Bilal Ahmed
 
MSE 602 - Inspect Process Improvememt
MSE 602 - Inspect Process ImprovememtMSE 602 - Inspect Process Improvememt
MSE 602 - Inspect Process ImprovememtAnthony "AJ" Schulte
 
CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27Bilal Ahmed
 
Contract labour act_673
Contract labour act_673   Contract labour act_673
Contract labour act_673 Bishan Sikdar
 
Circular motion2
Circular motion2Circular motion2
Circular motion2wawanut13
 
WHY THE SEATTLE MARKET & EB-5
WHY THE SEATTLE MARKET & EB-5WHY THE SEATTLE MARKET & EB-5
WHY THE SEATTLE MARKET & EB-5usasiapacific
 
234147191 diseno-y-calculo-de-acometidas
234147191 diseno-y-calculo-de-acometidas234147191 diseno-y-calculo-de-acometidas
234147191 diseno-y-calculo-de-acometidasexsal
 
In introduction to Key Performance Indicators
In introduction to Key Performance IndicatorsIn introduction to Key Performance Indicators
In introduction to Key Performance IndicatorsPaul Robere
 

Similar to Test Automation Myths (20)

Comparative study of cyclic activated sludge and conventional activated sludg...
Comparative study of cyclic activated sludge and conventional activated sludg...Comparative study of cyclic activated sludge and conventional activated sludg...
Comparative study of cyclic activated sludge and conventional activated sludg...
 
PMANIKANDAN CV-E&I
PMANIKANDAN CV-E&I PMANIKANDAN CV-E&I
PMANIKANDAN CV-E&I
 
Penetration testing: A proactive approach to secure computing - Eric Vanderbu...
Penetration testing: A proactive approach to secure computing - Eric Vanderbu...Penetration testing: A proactive approach to secure computing - Eric Vanderbu...
Penetration testing: A proactive approach to secure computing - Eric Vanderbu...
 
Von neumann architecture
Von neumann architectureVon neumann architecture
Von neumann architecture
 
Hardware and operating sytems
Hardware and operating sytemsHardware and operating sytems
Hardware and operating sytems
 
Chapter 6 testbench
Chapter 6 testbenchChapter 6 testbench
Chapter 6 testbench
 
CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35
 
CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38
 
CS201- Introduction to Programming- Lecture 07
CS201- Introduction to Programming- Lecture 07CS201- Introduction to Programming- Lecture 07
CS201- Introduction to Programming- Lecture 07
 
Ethernet Over CoAxial(EOC)
Ethernet Over CoAxial(EOC)Ethernet Over CoAxial(EOC)
Ethernet Over CoAxial(EOC)
 
Physics report
Physics reportPhysics report
Physics report
 
CS201- Introduction to Programming- Lecture 13
CS201- Introduction to Programming- Lecture 13CS201- Introduction to Programming- Lecture 13
CS201- Introduction to Programming- Lecture 13
 
MS Unit-6
MS Unit-6MS Unit-6
MS Unit-6
 
MSE 602 - Inspect Process Improvememt
MSE 602 - Inspect Process ImprovememtMSE 602 - Inspect Process Improvememt
MSE 602 - Inspect Process Improvememt
 
CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27
 
Contract labour act_673
Contract labour act_673   Contract labour act_673
Contract labour act_673
 
Circular motion2
Circular motion2Circular motion2
Circular motion2
 
WHY THE SEATTLE MARKET & EB-5
WHY THE SEATTLE MARKET & EB-5WHY THE SEATTLE MARKET & EB-5
WHY THE SEATTLE MARKET & EB-5
 
234147191 diseno-y-calculo-de-acometidas
234147191 diseno-y-calculo-de-acometidas234147191 diseno-y-calculo-de-acometidas
234147191 diseno-y-calculo-de-acometidas
 
In introduction to Key Performance Indicators
In introduction to Key Performance IndicatorsIn introduction to Key Performance Indicators
In introduction to Key Performance Indicators
 

Test Automation Myths

  • 1. TTTTeeeesssstttt AAAAuuuuttttoooommmmaaaattttiiiioooonnnn MMMMyyyytttthhhhssss AApprriill 2211,, 22001100 KKWWSSQQAA QQuuaalliittyy AAssssuurraannccee CCoonnffeerreennccee KKeevviinn BBuurrrr OOttttaawwaa SSooffttwwaarree QQuuaalliittyy AAssssoocciiaattiioonn 661133--225533--44225577 osqa.org
  • 2. Myths aabboouutt AAuuttoommaattiioonn Test automation only saves you time during Regression testing You can’t automate tests until… the product is stable you have a product to test. until the requirements are stable
  • 3. RReeaall LLiiffee EExxaammpplleess:: AApppplliiccaattiioonn LLeevveell TTeessttiinngg Translated SMTP email to x400 format Very mature system Testing took 1 week Uncovered 8 failures (bugs) Work was done by 1st year co-op [More later] 100.00 90.00 80.00 70.00 60.00 50.00 40.00 30.00 20.00 10.00 System under Test: 36 Fields 29 Trillion Exhaustive Testcases 72 “defaults” Testcases 75% branch coverage 47 Pair-wise Testcases 93% branch coverage E-mail Coverage Results Testsuite Coverage (%) 0.00 1 2 3 4 5 6 7 8 9 Block Branch
  • 4. More RReeaall LLiiffee EExxaammpplleess:: UUnniitt LLeevveell TTeessttiinngg System under Test: Unit testing of Controllers and Device Drivers on Real-time Embedded System First iteration was manual Everything after the second was automated Effort is measured in test vectors: a single test input 3000 2500 2000 1500 1000 500 0 1 2 3 4 5 6 Iteration Iteration 1 represents the number of manual test vectors that can be run in 2 weeks.. By iteration 6 productivity essentially increased 2.5 times ! Over 5,000 more test vectors were run than possible manually! This is equivalent to 10 weeks extra testing for free. The tester also able took a 2 week vacation and worked on other assignments, which would have been impossible originally Test Vectors New Regression
  • 5. And More RReeaall LLiiffee EExxaammpplleess:: SSOOAA SSyysstteemm PPeerrffoorrmmaannccee TTeessttiinngg 110000 tteessttccaasseess,, 11 hhoouurr ppeerr tteessttccaassee,, oonn 22 tteessttbbeeddss,, iinn 11 wweeeekk bbyy 11 tteesstteerr UUpp ttoo 110000 ssiimmuullaatteedd uusseerrss wwiitthh mmuullttiippllee rroolleess,, mmuullttiippllee eevveenntt ppaatttteerrnnss,, eettcc.. TTeesstteerr wwaass aallssoo wwrriittiinngg aa tteesstt ttooooll aatt tthhee ssaammee ttiimmee.. WWeebb AApppplliiccaattiioonn SSyysstteemm TTeessttiinngg 7700 tteessttccaasseess ccrreeaatteedd aanndd eexxeeccuutteedd iinn 11 wweeeekk.. RReedduucceedd 770000 tteesstt ccaasseess ttoo 113300 IInntteeggrraattiioonn TTeessttccaasseess AAuuttoommaatteedd IInnssttaallllaattiioonn tteessttiinngg ffoorr eevveerryy ppoossssiibbllee ccoonnffiigguurraattiioonn ooff rroouuttiinngg ffrraammeewwoorrkk.. EEttcc..
  • 6. AAggeennddaa MMyytthhss vvss.. RReeaalliittyy TTyyppeess ooff AAuuttoommaattiioonn 11.. AAuuttoommaatteedd TTeesstt CCrreeaattiioonn 22.. AAuuttoommaatteedd TTeesstt EExxeeccuuttiioonn 33.. AAuuttoommaatteedd TTeesstt VVaalliiddaattiioonn WWhheenn AAuuttoommaattiioonn GGooeess WWrroonngg CCoonncclluussiioonn
  • 7. Data Driven EEccoonnoommiieess ooff SSccaallee --- -------- -------- -------- --- -------- -------- -------- --------- -- TC1--- -------- --------- -- TC1--- -------- --- --- -------- -------- -------- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- --- -------- -------- -------- -- -- -- -- -- -- -- -- -- -- -- -- - - - - --- -------- -------- -------- --- -------- -------- -------- TC TC TC TC TC TC TC Test Driver -- -- -- -- -- -- -- -- -- -- -- -- - - - - OR
  • 8. 2.0 Automated TTeesstt EExxeeccuuttiioonn Approach Pros Cons Requires experienced programmer to maintain/create parser Keyword “scripts” have to be maintained Simple keywords capture actions Requires testers to have least coding experience Keyword Driven Requires better coding skills Test scenarios may be complex in order to take advantage of common test driver Uses parameters or data files to drive testcases Fastest to create testcases Less code, less maintenance Data Driven Requires good programmers to support re-useable code. Uses shared libraries for common functions Faster to create, easier to maintain more robust Supports mix of coding skills Shared code Needs more planning Maintenance is a problem Leads to code duplication Slowest to create (unless copying) More robust Intermediate coding skills Structured Code Breaks easily Hopeless to maintain Fast and easy to create Requires little to no coding experience Record and Playback
  • 9. 2.1 Data DDrriivveenn AAuuttoommaattiioonn aakkaa TTaabbllee ddrriivveenn EEaacchh tteesstt ccaassee iiss 11 lliinnee iinn ttaabbllee TTeesstt ddrriivveerr aauuttoommaatteess aa uussee-- ccaassee UUssee tteesstt aattttrriibbuutteess aanndd eexxppeecctteedd rreessuullttss ttoo ccrreeaattee aa ddaattaa ttaabbllee ffoorr tteesstt ddrriivveerr BBeehhaavviioorr iiss ddaattaa mmooddeelleedd.. TTeesstt ddrriivveerr mmaayy ddrriivvee SSUUTT ddiirreeccttllyy oorr ccrreeaattee aa tteesstt ssccrriipptt ffoorr eeaacchh tteesstt ccaassee TTeesstt ddrriivveerr mmaayy iinntteerraacctt wwiitthh mmuullttiippllee aauuttoommaattiioonn ttoooollss bbeehhiinndd tthhee sscceenneess.. TTeesstt ddrriivveerr ccaann bbee aass ccoommpplleexx oorr ssiimmppllee.. Create and Set timer T2 T2 active Cancel T2 T2 inactive T2 inactive Error is issued T2 active Reset T2 Error is issued TTeesstt AAttttrriibbuuttee PPoossssiibbllee vvaalluueess TTeesstt vvaalluueess 00,,11,,22,,33,,2200,,4400,,6611,, 110000,,990000 00,,11,,22,,……,, MMAAXX__VVAALLUUEE VVaalluuee GGrraannuullaarriittyy 11,,22,,33,,44 11,,22,,33,,44 oonnee sshhoott ttiimmeerr,, ppeerriiooddiicc ttiimmeerr oonnee sshhoott ttiimmeerr,, ppeerriiooddiicc ttiimmeerr TTyyppee CCrreeaattee bbrraanncchh aaccttiivvee,, iinnaaccttiivvee aaccttiivvee,, iinnaaccttiivvee CCaanncceell bbrraanncchh aaccttiivvee,, iinnaaccttiivvee aaccttiivvee,, iinnaaccttiivvee
  • 10. 2.2 Keyword DDrriivveenn AAuuttoommaattiioonn WWiinnddooww AAccttiioonn OObbjjeecctt VVaalluuee MMaaiinn CClliicckk NNeexxttBBuuttttoonn MMaaiinn CClliicckk MMeennuuBBaarr FFiillee MMaaiinn CClliicckk MMeennuuBBaarr PPrriinntt…… PPrriinntt EEnntteerrVVaalluuee NNuummbbeerrCCooppiieess 22 PPrriinntt SSeelleecctt PPrriinntteerrNNaammee AAddoobbee PPDFF PPrriinntt CClliicckk OOKKBBuuttttoonn aakkaa TTaabbllee Drriivveenn SSiinnggllee tteesstt ddrriivveerr ffoorr wwhhoollee SSyysstteemm uunnddeerr TTeesstt 11 tteesstt ccaassee ppeerr ttaabbllee,, 11 aaccttiioonn ppeerr lliinnee ee..gg.. WWiinnddooww,, AAccttiioonn,, OObbjjeecctt,, VVaalluuee CCaann aallssoo vvaalliiddaattee ddaattaa Deeppeennddiinngg oonn yyoouurr tteesstt ppllaann ““ssttyyllee”” tthhiiss ccaann bbeeccoommee eexxeeccuuttaabbllee ddooccuummeennttaattiioonn TTeesstt iinnssttrruuccttiioonnss aarree tthhee aauuttoommaattiioonn IIff yyoouu eexxppaanndd ccoonncceepptt ttoo ssiimmpplliiffiieedd ssccrriippttiinngg llaanngguuaaggeess ee..gg.. CClliicckk ((““MMaaiinn””,, ““NNeexxttBBuuttttoonn””)) TThhiiss iiss tthhee mmoosstt ppooppuullaarr ddaattaa ddrriivveenn tteessttiinngg aapppprrooaacchh bbyy ffaarr.. BBuutt nnoott aass ffaasstt ttoo ccrreeaattee aass pprreevviioouuss EE..gg.. SSAAFFSSDEEVV,, SSTTAAFF,, BBeehhaavviioouurr--BBaasseedd
  • 11. 1.0 Automated TTeesstt CCrreeaattiioonn UUssee mmooddeell ooff ssyysstteemm ttoo aauuttoommaattiiccaallllyy ggeenneerraattee aauuttoommaatteedd tteesstt ccooddee TTyyppeess:: SSttaattee ddiiaaggrraammss ((iinncclluuddiinngg UUMMLL,, SSDLL,, eettcc..)),, SSeettss,, GGrraammmmaarrss,, CCoommbbiinnaattiioonnss Create and Set timer T2 T2 active Cancel T2 T2 inactive T2 inactive Error is issued T2 active Reset T2 Error is issued TToooollss ttoo vvaalliiddaattee mmooddeell,, ffiinndd mmiinniimmuumm tteesstt ppaatthhss,, eettcc.. BBeesstt ooff aallll:: mmaannaaggee tthhee mmooddeell aanndd nnoott tthhee tteesstt ccooddee
  • 12. 11..11 PPaaiirr-wwiissee tteesstt ggeenneerraattiioonn MMaannyy ssyysstteemmss ssuuffffeerr ffrroomm aa ccoommbbiinnaattoorriiaall eexxpplloossiioonn ooff ppoossssiibbllee tteessttccaasseess PPaaiirr--wwiissee tteesstt ggeenneerraattiioonn bbaasseedd oorriiggiinnaallllyy oonn Deessiiggnn ooff EExxppeerriimmeennttss TThheeoorryy DOOEE iiss aann eexxcceelllleenntt wwaayy ttoo ccrreeaattee ppeerrffoorrmmaannccee cchhaarraacctteerriizzaattiioonn tteessttss ffoorr ppeerrffoorrmmaannccee eessttiimmaattiioonn.. Doo nnoott nneeeedd tthhee bbaallaanncceedd nnuummbbeerr ooff ppaaiirrss iinn DOOEE ffoorr rreegguullaarr tteessttiinngg..
  • 13. PPaaiirr-wwiissee TTeesstt CCaasseess:: 1133 FFiieellddss,, 33 IInnppuuttss,, 1155 TTeesstt ccaasseess TEST Field1 Field2 Field3 Field4 Field5 Field6 Field7 Field8 Field9 Field10 Field11 Field12 Field13 Case1 1 1 1 1 1 1 1 1 1 1 1 1 1 Case2 1 2 2 2 2 2 2 2 2 2 1 1 1 Case3 1 3 3 3 3 3 3 3 3 3 1 1 1 Case4 2 1 1 2 2 2 3 3 3 1 2 2 1 Case5 2 2 2 3 3 3 1 1 1 2 2 2 1 Case6 2 3 3 1 1 1 2 2 2 3 2 2 1 Case7 3 1 1 3 3 3 2 2 2 1 3 3 1 Case8 3 2 2 1 1 1 3 3 3 2 3 3 1 Case9 3 3 3 2 2 2 1 1 1 3 3 3 1 Case10 1 2 3 1 2 3 1 2 3 1 2 3 2 Case11 2 3 1 2 3 1 2 3 1 2 3 1 2 Case12 3 1 2 3 1 2 3 1 2 3 1 2 2 Case13 1 3 2 1 3 2 1 3 2 1 3 2 3 Case14 2 1 3 2 1 3 2 1 3 2 1 3 3 Case15 3 2 1 3 2 1 3 2 1 3 2 1 3 Maximum possible combinations = 1,594,323
  • 14. 11..11 PPaaiirr-wwiissee tteesstt ggeenneerraattiioonn PPrroodduucceess aa vveerryy ssmmaallll ((bbuutt ttwwiisstteedd)) sseett ooff tteesstt ccaasseess EEaassiillyy ffeeeeddss ddiirreeccttllyy iinnttoo ddaattaa ddrriivveenn tteesstt ddrriivveerr UUssee aa ttooooll tthhaatt uusseess rruulleess ((pprreeddiiccaatteess)) ttoo pprreevveenntt iimmppoossssiibbllee ccoommbbiinnaattiioonnss ooff iinnppuuttss MMooddeelliinngg aarroouunndd tthheemm iiss ttoooo hhaarrdd
  • 15. 11..22 TTeessttiinngg TTeessttiinngg ((FFeeeeddbbaacckk LLoooopp)) HHooww ddoo yyoouu kknnooww yyoouu hhaavvee tteesstteedd eevveerryytthhiinngg?? UUnnddooccuummeenntteedd rreeqquuiirreemmeennttss aanndd ffeeaattuurreess UUnnddooccuummeenntteedd ddeeppeennddeenncciieess UUssiinngg oouutt ooff ddaattee ddooccuummeennttaattiioonn MMiissssiinngg ccooddee HHooww ddoo yyoouu kknnooww yyoouu aarree nnoott wwaassttiinngg ttiimmee tteessttiinngg ssoommee ffuunnccttiioonnaalliittyy ttoooo mmuucchh?? MMeeaassuurree wwhhaatt ccooddee wwaass nnoott eexxeeccuutteedd ((ccooddee ccoovveerraaggee)) WWhhaatteevveerr ffuunnccttiioonnaalliittyy tthhaatt ccooddee wwaass wwrriitttteenn ttoo iimmpplleemmeenntt iiss mmiissssiinngg ffrroomm tthhee tteessttssuuiittee DDooeess nnoott tteellll yyoouu aannyytthhiinngg aabboouutt tthhee ccooddee tthhaatt wwaass eexxeeccuutteedd
  • 16. Error vvss.. BBrraanncchh CCoovveerraaggee 0.450 0.500 0.550 0.600 0.650 0.700 0.750 0.800 0.850 Branch Coverage 1 0.9 0.8 Fault Coverage 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 WWiitthhoouutt mmeeaassuurriinngg ccoovveerraaggee,, tteessttss oofftteenn oonnllyy eexxeerrcciissee 7700%% ooff tthhee ccooddee,, hhoowweevveerr bbuuggss oofftteenn hhiiddee iinn tthhee hhaarrdd ttoo tteesstt ccooddee,, aass iinn tthhiiss eexxaammppllee.. Ref: “The Relationship Between Test Coverage and Reliability” by Yeshwant Malaiya, Naixin Li, Jim Bieman, Rick Karich, Bob Skibbe, Proc. 5th ISSRE, Nov. 1994
  • 17. CCoovveerraaggee RReessuullttss - PPrroocceedduurree TTeesstt 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Testcase 100.00 90.00 80.00 70.00 60.00 50.00 40.00 30.00 20.00 10.00 0.00 Branch Coverage Total Coverage 96.08 Redundantt code coverage miightt be wastted ttesttiing ttiime Branch Coverage (%) Duplicate Coverage
  • 18. Sanity SSuubbssyysstteemm CCoovveerraaggee CCooddee CCoovveerraaggee -- nnoott jjuusstt ffoorr UUnniitt TTeesstt V.56 V.87 Area Procedures Hits Percent Hit Procedures Hits Percent Hit 7 0 0 7 0 0 0 0 0 88 13 15 810 33 4 895 36 4 102 26 25 114 38 33 5545 893 16 7454 1117 15 1736 304 18 2302 325 14 570 24 4 606 65 11 407 2 0 424 32 8 13 0 0 321 67 21 46 0 0 46 0 0 TOTAL 9324 1282 14 12257 1693 14 Area Subsystems Hits Percent Hit Subsystems Hits Percent Hit 1 0 0 1 0 0 1 0 0 1 1 100 1 1 100 1 1 100 1 1 100 1 1 100 24 18 75 25 24 96 4 4 100 4 4 100 2 1 50 1 1 100 3 1 33 3 1 33 1 0 0 1 1 100 1 0 0 1 0 0 TOTAL 39 26 67 39 34 87
  • 19. 2.1 RRiisskk BBaasseedd TTeessttiinngg RRaarreellyy aabbllee ttoo tteesstt eevveerryytthhiinngg SSoommee ppaarrttss ooff tthhee ccooddee tteenndd ttoo hhaavvee mmoorree bbuuggss tthhaann ootthheerr ppllaacceess NNeeww oorr cchhaannggeedd ccooddee CCoommpplleexx ccooddee FFuunnccttiioonnaalliittyy mmoosstt uusseedd bbyy ccuussttoommeerrss.. EEttcc.. UUssee rriisskk mmeettrriiccss ttoo ffooccuuss tteessttiinngg oonn tthhee ppaarrttss ooff tthhee ccooddee mmoosstt lliikkeellyy ttoo hhaavvee bbuuggss ccuussttoommeerrss wwiillll ffiinndd.. MMaannyy ttyyppeess –– jjuusstt ggooiinngg ttoo mmeennttiioonn aauuttoommaatteedd..
  • 20. Correlating Complexity wwiitthh PPrroobblleemmss 100 97.0% Predicted Model 0 25 50 75 100 80 60 40 20 0 6644%% ooff pprroobblleemmss ffoouunndd iinn ttoopp 2255%% ccoommpplleexx ccooddee 33%% ooff pprroobblleemmss ffoouunndd iinn bboottttoomm 2255%% ccoommpplleexx ccooddee FFooccuuss tteessttiinngg oonn hhiigghhllyy ccoommpplleexx ccooddee aanndd aavvooiidd ssppeennddiinngg ttiimmee oonn lleeaasstt ccoommpplleexx.. Module Count % 64.40 Actual Cumulative Problem Count %
  • 21. 3.0 Automated TTeesstt VVaalliiddaattiioonn ((aakkaa OOrraaccllee)) HHaarrdd ccooddeedd EExxpplliicciitt ““AAsssseerrttss”” oorr ccooddeedd iinntteerraaccttiioonn wwiitthh SSUUTT ((ee..gg.. tthhrroouugghh AAPPII)) CCrreeaatteedd bbyy mmooddeell!! SUT does not follow test case’s logic Generate verification code as well as execution code
  • 22. 3.0 Automated TTeesstt VVaalliiddaattiioonn ((aakkaa OOrraaccllee)) CCaappttuurree RReeppllaayy CCoommppaarree tteesstt rreessuullttss ttoo rreessuullttss ffrroomm aa pprreevviioouuss vveerrssiioonn Previous version becomes the “Oracle” Previous version could also be a model (e.g. prototype) FFiilltteerr oouutt oorr cclleeaann uupp tthhee cchhaannggeeaabbllee bbiittss BBiittmmaappss bbaadd,, tteexxtt aanndd nnuummbbeerrss ggoooodd
  • 23. When Automation GGooeess WWrroonngg Find false positives – no-one trusts results Does not find any bugs Runs slower than manual testing Tests become un-maintainable after a couple releases
  • 24. When Automation GGooeess WWrroonngg Find false positives – no-one trusts results Does not find any bugs Runs slower than manual testing Tests become un-maintainable after a couple releases TTeesstt AAuuttoommaattiioonn//TToooollss hhaavvee ttoo bbee ttrreeaatteedd lliikkee rreeaall ccooddee.. NNeeeeddss ttoo bbee ccooddee rreevviieewweedd,, tteesstteedd,, eettcc.. NNeeeeddss ttoo bbee mmaaiinnttaaiinnaabbllee GGaarrbbaaggee iinn GGaarrbbaaggee oouutt.. NNoo tteecchhnniiqquuee wwiillll ffiinndd aallll bbuuggss –– uussee aa vvaarriieettyy IIff pprroodduucctt bbuuggss eessccaappee,, ffiinndd oouutt wwhhyy aanndd ffiixx tthhee tteesstt ccooddee
  • 25. RReeaall LLiiffee EExxaammpplleess:: AApppplliiccaattiioonn LLeevveell TTeessttiinngg 100.00 90.00 80.00 70.00 60.00 50.00 40.00 30.00 20.00 10.00 Benefits: Fewer testcases: less time to test and verify results High level of code coverage Incorporates boundary testing Both success and failure testcases generated Ease of adapting testcase suite to changing requirements We were given the wrong requirements initially and slowly discovered the correct ones 36 Fields 29 Trillion Exhaustive Testcases 72 “defaults” Testcases 75% branch coverage 47 Pair-wise Testcases 93% branch coverage E-mail Coverage Results Testsuite Coverage (%) 0.00 1 2 3 4 5 6 7 8 9 Block Branch
  • 26. EEvveerryytthhiinngg TTooggeetthheerr Modell Code Code Coverage Auto TCs Redefiine Modell Run Tests Churn Compllexiity Requiirements
  • 27. Myths aabboouutt AAuuttoommaattiioonn Test automation only saves you time during Regression testing Deeppeennddiinngg oonn tteecchhnniiqquuee,, yyoouu ccaann ggeenneerraattee aanndd eexxeeccuuttee aauuttoommaatteedd tteesstt ccaasseess ffaasstteerr tthhaann mmaannuuaall tteesstt ccaasseess You can’t automate tests until… the product is stable you have a product to test. until the requirements are stable MMooddeellss aanndd//oorr TTeesstt ddrriivveerrss ccaann bbee wwrriitttteenn iinn ppaarraalllleell wwiitthh pprroodduucctt ccooddee aanndd ttwweeaakkeedd aass nneeeeddeedd..
  • 30. Baby sstteeppss aanndd CCoonnttiinnuuoouuss IImmpprroovveemmeenntt SSeelleecctt aa ggooaall aanndd ppllaann hhooww ttoo ggeett tthheerree Deecciiddee hhooww ttoo mmeeaassuurree ssuucccceessss aanndd mmeeaassuurree wwhheerree yyoouu ccuurrrreennttllyy aarree Doonn’’tt ttrryy ttoo ddoo ttoooo mmuucchh SSeellll ssoolluuttiioonnss bbaasseedd oonn nneeeeddss WWoorrkk wwiitthh tthhee wwiilllliinngg aanndd nneeeeddyy ffiirrsstt KKeeeepp ffooccuusseedd oonn ggooaallss aanndd pprroobblleemmss AAlliiggnn tthhee bbeehhaavviioouurr ooff MMaannaaggeerrss aanndd PPrraaccttiioonneerrss MMeeaassuurree aanndd eevvaalluuaattee pprrooggrreessss MMaakkiinngg pprroocceessss iimmpprroovveemmeenntt wwoorrkk:: aa ccoonncciissee aaccttiioonn gguuiiddee ffoorr ssooffttwwaarree ...... BByy NNeeiill SS.. PPootttteerr,, MMaarryy EE.. SSaakkrryy
  • 31. RReeffeerreenncceess BBuurrrr,, KKeevviinn YYoouunngg,, WWiilllliiaamm,, 11999988,, CCoommbbiinnaattoorriiaall tteesstt tteecchhnniiqquueess:: TTaabbllee-bbaasseedd aauuttoommaattiioonn,, tteesstt ggeenneerraattiioonn aanndd ccooddee ccoovveerraaggee ,, PPrroocceeeeddiinnggss ooff tthhee IInnttll.. CCoonnff.. oonn SSooffttwwaarree TTeessttiinngg AAnnaallyyssiiss aanndd RReevviieeww,, SSaann Diieeggoo,, CCAA.. OOccttoobbeerr 11999988,, hhttttpp::////aaeettggwweebb..aarrggrreeeennhhoouussee..ccoomm//aaeettgg__nnoorrtteell..ppddff BBuurrrr,, KKeevviinn.. 11999988,, TTeesstt AAcccceelleerraattiioonn,, IIEEEEEE OOttttaawwaa,, JJuunnee 11999988 hhttttpp::////wwwwww..ppaaiirrwwiissee..oorrgg// Malaiya, Y., Li, N., Bieman, J., Karich, R., Skibbe, B., 1994, The Relationship Between Test Coverage and Reliability, Proc. 5th ISSRE, Nov. 1994 Potter, Neil Sakry, Mary, Making process improvement work: A concise action guide for software Managers and Practitioners, Pearson Education Inc., 2002