What is Testing in Software Engineering?

tommychauhan 14 views 86 slides May 30, 2024
Slide 1
Slide 1 of 86
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86

About This Presentation

SE


Slide Content

Unit 4

What is Testing?
•“Testingistheprocessofexecutingaprogramwiththeintentoffindingerrors.”
•Testingaprogramconsistsofprovidingtheprogramwithasetoftestinputs(ortestcases)and
observingiftheprogrambehavesasexpected.
•Iftheprogramfailstobehaveasexpected,thentheconditionsunderwhichfailureoccursare
notedforlaterdebuggingandcorrection.
•Somecommonlyusedtermsassociatedwithtestingare:
i.Failure:Thisisamanifestationofanerror(ordefectorbug).But,themerepresenceofan
errormaynotnecessarilyleadtoafailure.
ii.Testcase:Thisisthetriplet[I,S,O],whereIisthedatainputtothesystem,Sisthestateofthe
systematwhichthedataisinput,andOistheexpectedoutputofthesystem.
iii.Testsuite:Thisisthesetofalltestcaseswithwhichagivensoftwareproductistobetested.

Aim of testing
•Theaimofthetestingprocessistoidentifyalldefectsexistinginasoftwareproduct.
•Itisnotpossibletoguaranteethatthesoftwareiserrorfree.
•Thisisbecausetheinputdatadomainofmostsoftwareproductsisverylarge.Itisnotpracticalto
testthesoftwareexhaustivelywithrespecttoeachvaluethattheinputdatamayassume.
•Evenwiththispracticallimitationofthetestingprocess,theimportanceoftestingshouldnotbe
underestimated.
•Testingprovidesapracticalwayofreducingdefectsinasystemandincreasingtheusers’
confidenceinadevelopedsystem.

Software Testing Principles
•Softwaretestingisaprocedureofimplementingsoftwareortheapplicationtoidentifythe
defectsorbugs.
•Fortestinganapplicationorsoftware,weneedtofollowsomeprinciplestomakeourproduct
defectsfree,andthatalsohelpsthetestengineerstotestthesoftwarewiththeireffortandtime.
•Letusseethesevendifferenttestingprinciples,onebyone:
1.Testingshowsthepresenceofdefects
2.ExhaustiveTestingisnotpossible
3.EarlyTesting
4.DefectClustering
5.PesticideParadox
6.Testingiscontext-dependent
7.Absenceoferrorsfallacy

Software Testing Principles: 1. Testing shows the
presence of defects
•Thetestengineerwilltesttheapplicationtomakesurethattheapplicationisbugordefectsfree.
•Whiledoingtesting,wecanonlyidentifythattheapplicationorsoftwarehasanyerrors.
•Theprimarypurposeofdoingtestingistoidentifythenumbersofunknownbugswiththehelpof
variousmethodsandtestingtechniquesbecausetheentiretestshouldbetraceabletothe
customerrequirement,whichmeansthattofindanydefectsthatmightcausetheproductfailure
tomeettheclient'sneeds.
•Bydoingtestingonanyapplication,wecandecreasethenumberofbugs,whichdoesnotmean
thattheapplicationisdefect-freebecausesometimesthesoftwareseemstobebug-freewhile
performingmultipletypesoftestingonit.
•Butatthetimeofdeploymentintheproductionserver,iftheend-userencountersthosebugs
whicharenotfoundinthetestingprocess.

Software Testing Principles: Exhaustive
Testing is not possible
•Sometimesitseemstobeveryhardtotestallthemodulesandtheirfeatureswitheffectiveand
non-effectivecombinationsoftheinputsdatathroughouttheactualtestingprocess.
•Hence,insteadofperformingtheexhaustivetestingasittakesboundlessdeterminationsand
mostofthehardworkisunsuccessful.
•Sowecancompletethistypeofvariationsaccordingtotheimportanceofthemodulesbecause
theproducttimelineswillnotpermitustoperformsuchtypeoftestingscenarios.

Software Testing Principles: Early Testing
•Hereearlytestingmeansthatallthetestingactivitiesshouldstartintheearlystagesofthe
softwaredevelopmentlifecycle'srequirementanalysisstagetoidentifythedefectsbecauseif
wefindthebugsatanearlystage,itwillbefixedintheinitialstageitself,whichmaycostusvery
lessascomparedtothosewhichareidentifiedinthefuturephaseofthetestingprocess.
•Toperformtesting,wewillrequiretherequirementspecificationdocuments;therefore,ifthe
requirementsaredefinedincorrectly,thenitcanbefixeddirectlyratherthanfixingthemin
anotherstage,whichcouldbethedevelopmentphase.

Software Testing Principles: Defect clustering
•Thedefectclusteringdefinedthatthroughoutthetestingprocess,wecandetectthenumbersof
bugswhicharecorrelatedtoasmallnumberofmodules.
•Wehavevariousreasonsforthis,suchasthemodulescouldbecomplicated;thecodingpartmay
becomplex,andsoon.
•ThesetypesofsoftwareortheapplicationwillfollowtheParetoPrinciple,whichstatesthatwe
canidentifythatapprox.
•Eightypercentofthecomplicationispresentin20percentofthemodules.
•Withthehelpofthis,wecanfindtheuncertainmodules,butthismethodhasitsdifficultiesifthe
sametestsareperformingregularly,hencethesametestwillnotabletoidentifythenewdefects.

Software Testing Principles: Pesticide paradox
•Thisprincipledefinedthatifweareexecutingthesamesetoftestcasesagainandagainovera
particulartime,thenthesekindsofthetestwillnotbeabletofindthenewbugsinthesoftware
ortheapplication.
•Togetoverthesepesticideparadoxes,itisverysignificanttoreviewallthetestcasesfrequently.
•Andthenewanddifferenttestsarenecessarytobewrittenfortheimplementationofmultiple
partsoftheapplicationorthesoftware,whichhelpsustofindmorebugs.

Software Testing Principles: Testing is context-
dependent
•Testingisacontext-dependentprinciplestatesthatwehave
multiplefieldssuchase-commercewebsites,commercial
websites,andsoonareavailableinthemarket.
•Thereisadefinitewaytotestthecommercialsiteaswellas
thee-commercewebsitesbecauseeveryapplicationhasits
ownneeds,features,andfunctionality.
•Tocheckthistypeofapplication,wewilltakethehelpof
variouskindsoftesting,differenttechnique,approaches,
andmultiplemethods.Therefore,thetestingdependson
thecontextoftheapplication.

Software Testing Principles: Absence of errors
fallacy
•Oncetheapplicationiscompletelytestedandtherearenobugsidentifiedbeforetherelease,so
wecansaythattheapplicationis99percentbug-free.
•Butthereisthechancewhentheapplicationistestedbesidetheincorrectrequirements,
identifiedtheflaws,andfixedthemonagivenperiodwouldnothelpastestingisdoneonthe
wrongspecification,whichdoesnotapplytotheclient'srequirements.
•Theabsenceoferrorfallacymeansidentifyingandfixingthebugswouldnothelpifthe
applicationisimpracticalandnotabletoaccomplishtheclient'srequirementsandneeds.

Software Testing
•Software testing can be divided into two steps:
1.Verification:it refers to the set of tasks that ensure that
software correctly implements a specific function.
2.Validation:it refers to a different set of tasks that ensure that
the software that has been built is traceable to customer
requirements.
Verification:“Are we building the product right?”
Validation:“Are we building the right product?”

Methods of Software Testing
Methods
Strategies
white-box
methods
black-box
methods

Black-Box Testing
requirements
eventsinput
output
Comparison

Black-Box Testing
•Blackboxdesigntreatsthesystemasablack-box.
•ItisalsoknownasFunctionalTesting,BehavioralTesting,
Data-DrivenTesting,Input/OutputdrivenTesting.
•Giveinputtothesystem,gettheoutput,comparethe
outputwiththespecification,ifitmatches,thenthe
systemisfine,otherwiseerroristhere.
•Black-Boxtestingattemptstouncoverthefollowing
✓Incorrect functions
✓Missing functions
✓Performance errors
✓Initialization & Termination errors
✓External Database access errors.

White-Box Testing
input
AAAAAA
BBBBBB
CCCC
DDDDD

White-Box Testing
•AlsoknownasStructuralTesting,Clear-BoxTesting,Open-
BoxTesting,Logic-DrivenTesting.
•UsingWhite-Boxtestingmethods,thesoftwareengineer
canderivetestcasesthat.
✓Guaranteethatallindependentpathswithinamodulehave
beenexercisedatleastonce.
✓Exercisealllogicaldecisionsontheirtrueandfalsesides.
✓Executeallloopsattheirboundariesandwithintheir
operationalbounds.
✓Exerciseinternaldatastructurestoensuretheirvalidity.
•white-boxtesting:theinternalstructureofthesoftwareis
takenintoaccounttoderivethetestcases

Difference Between Black Box Testing and
White Box Testing
BLACK BOX TESTING WHITE BOX TESTING
Internal workings of an application are not
required.
Knowledge of the internal workings is must.
Also known as closed box/data driven testing.Also knwon as clear box/structural testing.
End users, testers and developers.Normally done by testers and developers.
THis can only be done by trial and error method.
Data domains and internal boundaries can be
better tested.

Test process in software development
V-model:
implementation
code
detailed
design
specification
requirements
acceptance
test
system
test
integration
test
unit
test

Unit Testing
•Involves testing a single isolated module
•Note that unit testing allows us to isolate the errors to a single module
•we know that if we find an error during unit testing it is in the module
we are testing
•Modules in a program are not isolated, they interact with each other.
Possible interactions:
•calling procedures in other modules
•receiving procedure calls from other modules
•sharing variables
•For unit testing we need to isolate the module we want to test, we do this
using two things
•drivers and stubs

Drivers and Stubs
Driver
Module
Under Test
Stub
procedure
call
procedure
call
access to global
variables
•Driver and Stub should have the same interface as the modules they replace
•Driver and Stub should be simpler than the modules they replace

Drivers and Stubs
•Driver:A program that calls the interface procedures of the
module being tested and reports the results
•A driver simulates a module that calls the module currently
being tested
•Stub:A program that has the same interface as a module that is
being used by the module being tested, but is simpler.
•A stub simulates a module called by the module currently
being tested

Integration Testing
•The modules that may work properly and independently may not
work when they are integrated.
•Integration Testing will test whether the modules work well
together.
•This will check whether the design is correct.
•Integration testing: Integrated collection of modules tested as a
group or partial system
•Integration plan specifies the order in which to combine modules
into partial systems
•Different approaches to integration testing
•Bottom-up
•Top-down
•Big-bang
•Sandwich

Module Structure
A
C
D
E F G
H
•A uses C and D; B uses D; C uses E and F; D uses F, G, H and I; H uses I
•Modules A and B are at level 3; Module D is at level 2
Modules C and H are at level 1; Modules E, F, G, I are at level 0
•level 0 components do not use any other components
•level icomponents use at least one component on level i-1 and no
component at a level higher than i-1
I
B
•We assume that
the uses hierarchy is
a directed acyclic graph.
•If there are cycles merge
them to a single module
level 0
level 1

Bottom-Up Integration
•Modules at lower levels are tested using the previously tested
higher level modules
•Non-terminal modules are not tested in isolation
•Requires a module driver for each module to feed the test case
input to the interface of the module being tested
•However, stubs are not needed since we are starting with the
terminal modules and use already tested modules when
testing modules in the lower levels

Bottom-up Integration
A
C
D
E F
G
H
I
B

Top-down Integration
•Only modules tested in isolation are the modules which are at
the highest level
•After a module is tested, the modules directly called by that
module are merged with the already tested module and the
combination is tested
•Requires stub modules to simulate the functions of the missing
modules that may be called
•However, drivers are not needed since we are starting with
the modules which is not used by any other module and use
already tested modules when testing modules in the higher
levels

Top-down Integration
A
C
D
E F
G
H
I
B

Other Approaches to Integration
•Sandwich Integration
•Compromise between bottom-up and top-down testing
•Simultaneously begin bottom-up and top-down testing and meet at a
predetermined point in the middle
•Instead of completely going for top down or bottom up, a layer is
identified in between.
•Above this layer we go for top down and below this layer bottom up.
•Big Bang Integration
•Every module is unit tested in isolation
•After all of the modules are tested they are all integrated together at once
and tested
•No driver or stub is needed
•However, in this approach, it may be hard to isolate the bugs!

System Testing
•Atthesystemtestinglevel,thesystemistestedasawhole,andprimarilyfunctionaltesting
techniquesareusedtotestthesystem.
•Systemtestingensuresthateachsystemfunctionworksasexpectedanditalsotestsfornon-
functionalrequirementslikeperformance,security,reliability,stress,load,etc.
•Thisistheonlyphaseoftestingwhichtestsbothfunctionalandnon-functionalrequirementsofthe
system.Ateamofthetestingpersonsdoesthesystemtestingunderthesupervisionofatestteam
leader.Wealsoreviewallassociateddocumentsandmanualsofthesoftware.
•Thisverificationactivityisequallyimportantandmayimprovethequalityofthefinalproduct.
•Aproperimpactanalysisshouldbedonebeforefixingthedefect.Sometimes,ifthesystem
permits,insteadoffixingthedefects,theyarejustdocumentedandmentionedastheknown
limitations.
•Thismayhappeninasituationwhenfixingisverytimeconsumingortechnicallyitisnotpossible
inthepresentdesign,etc.
•Progressofsystemtestingalsobuildsconfidenceinthedevelopmentteamasthisisthefirstphase
inwhichthecompleteproductistestedwithaspecificfocusonthecustomer’sexpectations.After
thecompletionofthisphase,customersareinvitedtotestthesoftware.

System Testing Types
•Regression Testing
•Load Testing
•Smoke Testing
•Usability Testing
•Security Testing
•Performance Testing
•Stress Testing

System Testing: Regression Testing
•REGRESSIONTESTINGisatypeofsoftwaretestingthatintendstoensurethatchanges
(enhancementsordefectfixes)tothesoftwarehavenotadverselyaffectedit.Rerunningoftests
canbeonbothfunctionalandnon-functionaltests.
•ReasonsforRegressionTesting
•TheneedforRegressionTestingcouldariseduetoanyofthechangesbelow:
i.Defectfix
ii.Newfeature
iii.Changeinanexistingfeature
iv.Coderefactoring
v.Changeintechnicaldesign/architecture
vi.Changeinconfiguration/environment(hardware,software,network)

Smoke Testing
•Smoketestingcoversmostofthemajorfunctionsofthesoftwarebutnoneofthemindepth.
•Theresultofthistestisusedtodecidewhethertoproceedwithfurthertesting.
•Ifthesmoketestpasses,goaheadwithfurthertesting.Ifitfails,haltfurthertestsandaskfora
newbuildwiththerequiredfixes.
•Ifanapplicationisbadlybroken,detailedtestingmightbeawasteoftimeandeffort.
•Smoketesthelpsinexposingintegrationandmajorproblemsearlyinthecycle.
•Itcanbeconductedonbothnewlycreatedsoftwareandenhancedsoftware.
•Smoketestisperformedmanuallyorwiththehelpofautomationtools/scripts.Ifbuildsare
preparedfrequently,itisbesttoautomatesmoketesting.

Usability Testing
•USABILITYTESTINGisatypeofsoftwaretestingdonefromanend-user’sperspectiveto
determineifthesystemiseasilyusable.Itfallsundernon-functionaltesting.
•UsabilityTestingusestheBlackBoxTestingmethodwhereinternalstructureofthesystemis
unknownandisalwaysexecutedmanuallybecauseoftheneedforhumaninteractionand
perception.

Security Testing
•SECURITYTESTINGisatypeofsoftwaretestingthatintendstouncovervulnerabilitiesofthe
systemanddeterminethatitsdataandresourcesareprotectedfrompossibleintruders.Itisa
typeofnon-functionaltesting.
•Therearefourmainfocusareastobeconsideredinsecuritytesting(Especiallyforweb
sites/applications):
•Networksecurity:Thisinvolveslookingforvulnerabilitiesinthenetworkinfrastructure(resources
andpolicies).
•Systemsoftwaresecurity:Thisinvolvesassessingweaknessesinthevarioussoftware(operating
system,databasesystem,andothersoftware)theapplicationdependson.
•Client-sideapplicationsecurity:Thisdealswithensuringthattheclient(browseroranysuch
tool)cannotbemanipulated.
•Server-sideapplicationsecurity:Thisinvolvesmakingsurethattheservercodeandits
technologiesarerobustenoughtofendoffanyintrusion.

Performance Testing
•PERFORMANCE TESTINGis a type of software testing that intends to determine how a system
performs in terms of responsiveness and stability under a certain load. It is a type of non-
functional testing.
•Performance Testing mainly focuses on the following software quality attributes:
•Responsiveness:The ability of software to respond quickly or complete assigned tasks within a
reasonable time.
•Concurrency:The ability of software to service multiple requests to the same resources at the
same time.
•Reliability:The ability of software to perform a required function under stated conditions for the
stated period of time without any errors.
•Stability:The ability of software to remain stable under varying loads or over time.
•Scalability:The measure of software’s ability to increase or decrease in performance in response
to changes in software’s processing demands.

LOAD Testing
•Loadtestingisusedtoidentifywhethertheinfrastructureusedforhostingtheapplication
issufficientornot
•Itisusedtofindiftheperformanceoftheapplicationissustainablewhenitisatthepeakofits
userload
•Ittellsushowmanysimultaneoususerscantheapplicationhandleandthescaleofthe
applicationrequiredintermsofhardware,networkcapacityetc.,sothatmoreuserscouldaccess
theapplication
•Ithelpstoidentifythemaximumoperatingcapacityofanapplicationaswellas
anybottlenecksanddeterminewhichelementiscausingdegradation.E.g.Ifthenumberofusers
areincreasedthenhowmuchCPU,memorywillbeconsumed,whatisthenetworkand
bandwidthresponsetime.

Stress Testing
•Itisatypeofnon-functionaltesting
•Itinvolvestestingbeyondnormaloperationalcapacity,oftentoabreakingpoint,inorderto
observetheresults
•Itisaformofsoftwaretestingthatisusedtodeterminethestabilityofagivensystem
•Itputgreateremphasisonrobustness,availabilityanderrorhandlingunderaheavyload,rather
thanonwhatwouldbeconsideredcorrectbehaviorundernormalcircumstances
•Thegoalsofsuchtestsmaybetoensurethesoftwaredoesnotcrashinconditionsofinsufficient
computationalresources(suchasmemory,diskspace,networkrequestetc)
•Stresstestingisalsocalledfatiguetesting
•Themainpurposeofstresstesting:Makesurethatthesystemfailsandrecoverseasily,this
qualityisalsoknownasrecoverability.

Acceptance Testing
•AcceptanceTestingisdonebythecustomertotestwhetherthe
systemismeetingtherequirements
•AcceptanceTestingisoftwotypes
✓AlphaTesting
✓BetaTesting

Acceptance Testing
AlphaTesting–
TheAlphatestisconductedinthedeveloper’senvironmentbythe
end-users.Theenvironmentmightbesimulated,withthedeveloper
andthetypicalend-userpresentforthetesting.Theend-useruses
thesoftwareandrecordstheerrorsandproblems.Alphatestis
conductedinacontrolledenvironment.

Acceptance Testing
BetaTesting–
TheBetatestisconductedintheend-user’senvironment.The
developerisnotpresentforthebetatesting.Thebetatestingis
alwaysinthereal-worldenvironmentwhichisnotcontrolledbythe
developer.Theend-userrecordstheproblemsandreportsitbackto
thedeveloperatintervals.Basedontheresultsofthebetatestingthe
softwareismadereadyforthefinalreleasetotheintendedcustomer
base.

Black-Box Testing Techniques
Followingaremaintechniquestoblack-boxtesting.
•Equivalence Class Partitioning
•Boundary Value Analysis
•Cause-Effect Graphs.

Equivalence Class Partitioning
•Equivalencepartitioning(EP)isaspecification-basedorblack-boxtechnique.
•Itcanbeappliedatanyleveloftestingandisoftenagoodtechniquetouse
first.
•Theideabehindthistechniqueistodivide(i.e.topartition)asetoftest
conditionsintogroupsorsetsthatcanbeconsideredthesame(i.e.thesystem
shouldhandlethem equivalently),hence ‘equivalence
partitioning’.Equivalencepartitionsarealsoknownasequivalenceclasses–
thetwotermsmeanexactlythesamething.
•Inequivalence-partitioningtechniqueweneedtotestonlyoneconditionfrom
eachpartition.
•Thisisbecauseweareassumingthatalltheconditionsinonepartition
willbetreatedinthesamewaybythesoftware.
•Ifoneconditioninapartitionworks,weassumealloftheconditionsin
thatpartitionwillwork,andsothereislittlepointintestinganyofthese
others.
•Similarly,ifoneoftheconditionsinapartitiondoesnotwork,thenwe
assumethatnoneoftheconditionsinthatpartitionwillworksoagain
thereislittlepointintestinganymoreinthatpartition.

Guidelines for Equivalence Class Partitioning
•If the range condition is given as an input, then one valid and two invalid equivalence classes are defined.
•If a specific value is given as input, then one valid and two invalid equivalence classes are defined.
•If a member of set is given as an input, then one valid and one invalid equivalence class is defined.
•If Boolean no. is given as an input condition, then one valid and one invalid equivalence class is defined.

Equivalence Class Partitioning (Contd.)
•Iftestingisdoneforaninputboxacceptingnumbers
from1to1000thenthereisnouseinwriting
thousandtestcasesforall1000validinputnumbers
plusothertestcasesforinvaliddata.
•Usingequivalencepartitioningmethodabovetest
casescanbedividedintothreesetsofinputdata
calledasclasses.Eachtestcaseisarepresentativeof
respectiveclass.
•Soinaboveexamplewecandivideourtestcasesinto
threeequivalenceclassesofsomevalidandinvalid
inputs.

Equivalence Class Partitioning (Contd.)
•Testcasesforinputboxacceptingnumbersbetween1and
1000usingEquivalencePartitioning:
1)Oneinputdataclasswithallvalidinputs.Pickasinglevalue
fromrange1to1000asavalidtestcase.Ifyouselectother
valuesbetween1and1000thenresultisgoingtobesame.So
onetestcaseforvalidinputdatashouldbesufficient.
2)Inputdataclasswithallvaluesbelowlowerlimit.I.e.any
valuebelow1,asainvalidinputdatatestcase.
3)Inputdatawithanyvaluegreaterthan1000torepresentthird
invalidinputclass.
•Sousingequivalencepartitioningyouhavecategorizedallpossible
testcasesintothreeclasses.Testcaseswithothervaluesfromany
classshouldgiveyouthesameresult.

Equivalence Class Partitioning (Contd.)
•Let us consider an example of an online shopping site. In this site, each of products has specific
product ID and product name. We can search for product either by using name of product or by
product ID. Here, we consider search field that accepts only valid product ID or product name.
•Let us consider set of products with product IDs and user want to search for Mobiles. Below is table
of some products with their product Id.
•IftheproductIDenteredbyuserisinvalidthenapplicationwillredirectcustomerorusertoerror
page.IfproductIDenteredbyuserisvalidi.e.45formobile,thenequivalencepartitioningmethod
willshowavalidproductID.

Boundary Value Analysis
•It’swidelyrecognizedthatinputvaluesattheextremeendsofinputdomain
causemoreerrorsinsystem.
•Moreapplicationerrorsoccurattheboundariesofinputdomain.
•‘Boundaryvalueanalysis’testingtechniqueisusedtoidentifyerrorsat
boundariesratherthanfindingthoseexistincenterofinputdomain.
•BoundaryvalueanalysisisanextpartofEquivalencepartitioningfordesigning
testcaseswheretestcasesareselectedattheedgesoftheequivalenceclasses.

Boundary Value Analysis (Contd.)
•Test cases for input box accepting numbers between
1 and 1000 using Boundary value analysis:
1)Test cases with test data exactly as the input
boundaries of input domain i.e. values 1 and 1000 in
our case.
2)Test data with values just below the extreme edges
of input domains i.e. values 0 and 999.
3)Test data with values just above the extreme edges
of input domain i.e. values 2 and 1001.
•Boundary value analysis is often called as a part of stress and
negative testing.

Boundary Value Analysis
•For each range [R
1, R
2] listed in either the input
or output specifications, choose five cases:
•Values less than R
1
•Values equal to R
1
•Values greater than R
1but less than R
2
•Values equal to R
2
•Values greater than R
2
R
1 R
2

Cause-Effect Graphs
•Thisisbasicallyahardwaretestingtechniqueadaptedtosoftware
testing.
•Itconsidersonlythedesiredexternalbehaviourofasystem.
•Thisisatestingtechniquethataidsinselectingtestcasesthat
logicallyrelateCauses(inputs)toEffects(outputs)toproducetest
cases.
•A“Cause”representsadistinctinputconditionthatbringsaboutan
internalchangeinthesystem.

Cause-Effect Graphs (Contd.)
•An“Effect”representsanoutputcondition,asystemtransformationorastate
resultingfromacombinationofcauses.
•AccordingtoMyerCause&EffectGraphingisdonethroughthefollowingsteps:
•Step–1:Foramodule,identifytheinputconditions(causes)andactions(effect).
•Step–2:Developacause-effectgraph.
•Step–3:Transformcause-effectgraphintoadecisiontable.
•Step–4:Convertdecisiontablerulestotestcases.Eachcolumnofthedecision
tablerepresentsatestcase.

Cause-Effect Graphs (Contd.)

Cause-Effect Graphs (Contd.)
The character in column1 must be A or B. The character in column 2 must be a digit. If these 2 hold
then file update is made. if the character in column1 is incorrect, message x is issued. If character in
column2 is not a digit, message y is issued.
Causes are
c1: character in column1 is A
c2: character in column1 is B
c3: character in column2 is a digit
Effects are:

Cause-Effect Graphs (Contd.)

Cause-Effect Graphs (Contd.)

Coverage Metrics: White Box Testing Techniques
•Coverage metrics
•Statementcoverage:allstatementsintheprogramsshould
beexecutedatleastonce
•Branchcoverage:allbranchesintheprogramshouldbe
executedatleastonce
•Pathcoverage:allexecutionpathsintheprogramshould
beexecutedatlestonce
•The best case would be to execute all paths through
the code,

Read P
Read Q
IF P+Q > 100 THEN
Print “Large”
ENDIF
If P > 50 THEN
Print “P Large”
ENDIF

StatementCoverage(SC):
TocalculateStatementCoverage,findouttheshortestnumberofpathsfollowingwhichallthe
nodeswillbecovered.Herebytraversingthroughpath1A-2C-3D-E-4G-5Hallthenodesare
covered.Sobytravelingthroughonlyonepathallthenodes12345arecovered,sotheStatement
coverageinthiscaseis1.
BranchCoverage(BC):
TocalculateBranchCoverage,findouttheminimumnumberofpathswhichwillensurecovering
ofalltheedges.Inthiscasethereisnosinglepathwhichwillensurecoverageofalltheedgesat
onego.Byfollowingpaths1A-2C-3D-E-4G-5H,maximumnumbersofedges(A,C,D,E,GandH)
arecoveredbutedgesBandFareleft.Tocoverstheseedgeswecanfollow1A-2B-E-4F.Bythe
combiningtheabovetwopathswecanensureoftravelingthroughallthepaths.HenceBranch
Coverageis2.Theaimistocoverallpossibletrue/falsedecisions.

Path Coverage (PC):
Path Coverage ensures covering of all the paths from start to end.
All possible paths are-
1A-2B-E-4F
1A-2B-E-4G-5H
1A-2C-3D-E-4G-5H
1A-2C-3D-E-4F
So path coverage is 4.
Thus for the above example SC=1, BC=2 and PC=4.

Static testing
•Statictestingistheformofsoftwaretestingwhereyou
donotexecutethecodebeingexamined.
•Thistechniquecouldbecallednon-execution
technique.
•Itisprimarilysyntaxcheckingofthecodeormanually
reviewingthecode,requirementsdocuments,design
documentsetc.tofinderrors.

Static testing (Contd.)
•Fromtheblackboxtestingpointofview,statictesting
involvesreviewingrequirementsandspecifications.
•Thisisdonewithaneyetowardcompletenessor
appropriatenessforthetaskathand.
•ThisistheverificationportionofVerificationand
Validation.
•Thefundamentalobjectiveofstatictestingtechniqueisto
improvethequalityofthesoftwareproductsbyfinding
errorsinearlystagesofsoftwaredevelopmentlifecycle.

Static testing (Contd.)
•Following are the mainStatic Testing techniquesused:
•Formal Technical Reviews
•Walkthrough
•Code Inspection

Formal Technical Reviews
•FormalTechnicalReviewsareconductedbysoftwareengineers.
•Theprimaryobjectiveistofinderrorsduringtheprocesssothattheydonot
becomedefectsafterreleaseofsoftwareastheyuncovererrorsinfunction,logic
design,orimplementation.
•Theideaistohaveearlydiscoveryoferrorssotheydonotpropagatetothenext
stepintheprocess.
•Theyalsoensurethatthesoftwarehasbeenrepresentedaccordingtopredefined
standardsanditisdevelopedinauniformmanner.
•Theymakeprojectsmoremanageableandhelpgroomnewresourcesaswellas
providebackupandcontinuity.

Formal Technical Reviews (Contd.)
•FTRsareusuallyconductedinameetingthatissuccessfulonlyifit
isproperlyplanned,controlled.
•TheproducerinformstheProjectManagerthattheWorkProduct
isreadyandthereviewisneeded.
•Thereviewmeetingconsistsof3-5peopleandadvanced
preparationisrequired.
•Itisimportantthatthispreparationshouldnotrequiremorethan2
hoursofworkperperson.
•Itshouldfocusonspecific(andsmall)partoftheoverallsoftware.
•Forexample,insteadoftheentiredesign,walkthroughsare
conductedforeachcomponent,orsmallgroupofcomponents.By
narrowingfocus,FTRhasahighprobabilityofuncoveringerrors.

Formal Technical Reviews (Contd.)
•Itisimportanttorememberthatthefocusisonawork
product(WP)forwhichtheproduceroftheWPasksthe
projectleaderforreview.
•Projectleaderinformsthereviewleader.
•ThereviewleaderevaluatestheWPforreadinessandif
satisfiedgeneratescopiesofreviewmaterialand
distributestoreviewersforadvancedpreparation.

Formal Technical Reviews Review Meetings
(Contd.)
•Reviewmeeting(RM)isattendedbythereviewleader,allreviewers,andthe
producer.
•Oneofthereviewertakestherolesofrecorder.
•Producerwalksthroughtheproduct,explainingthematerialwhileother
reviewersraiseissuesbasedupontheiradvancedpreparation.
•Whenvalidproblemsorerrorsarerecorded,therecordernoteseachoneof
them.
•AttheendoftheRM,allattendeesofthemeetingmustdecidewhetherto:
Accepttheproductwithoutfurthermodification

Formal Technical Reviews Review Meetings
(Contd.)
•Rejecttheproductduetosevereerrors
– Major errors identified
–Mustreviewagainafterfixing
•Accept the product provisionally
– Minor errorsto be fixed
–Nofurtherreview

Formal Technical Reviews
Review Reporting and Record keeping(Contd.)
•During the FTR the recorder notes all the issues.
•They are summarized at the end and a review issue list is prepared.
•A summary report is produced that includes:
•What is reviewed
•Who reviewed it
•What were the findings and conclusions
•It then becomes part of project historical record.

Formal Technical Reviews
(Contd.)
Thereviewissuelist
•Itissometimesveryusefultohaveaproperreviewissuelist.Ithastwoobjectives.
•IdentifyproblemareaswithintheWPActionitemchecklist
•Itisimportanttoestablishafollow-upproceduretoensurethatitemsontheissuelist
havebeenproperlyaddressed.
ReviewGuidelines
•Itisessentialtonotethatanuncontrolledreviewcanbeworsethannoreview.
•Thebasisprincipleisthatthereviewshouldfocusontheproductandnotthe
producersothatitdoesnotbecomepersonal.
•Errorsshouldbepointedoutgentlyandthetoneshouldbelooseandconstructive.

Walkthrough
•Awalkthroughisatermdescribingtheconsiderationofaprocessatanabstract
level.
•Thetermisoftenemployedinthesoftwareindustry(seesoftwarewalkthrough)
todescribetheprocessofinspectingalgorithmsandsourcecodebyfollowing
pathsthroughthealgorithmsorcodeasdeterminedbyinputconditionsand
choicesmadealongtheway.
•Thepurposeofsuchcodewalkthroughsisgenerallytoprovideassuranceofthe
fitnessforpurposeofthealgorithmorcode;andoccasionallytoassessthe
competenceoroutputofanindividualorteam.

Guidelines of Walkthrough
•Theteamperformingcodewalkthroughshouldnotbeeithertoobigortoo
small.
•Ideally,itshouldconsistofbetweenthreetosevenmembers.
•Discussionshouldfocusondiscoveryoferrorsandnotonhowtofixthe
discoverederrors.
•Inordertofostercooperationandtoavoidthefeelingamongengineersthatthey
arebeingevaluatedinthecodewalkthroughmeeting,managersshouldnot
attendthewalkthroughmeetings.

Code Inspection
•Theaimofcodeinspectionistodiscoversomecommontypesoferrorscaused
duetooversightandimproperprogramming.
•Duringcodeinspectionthecodeisexaminedforthepresenceofcertainkindsof
errors,incontrasttothehandsimulationofcodeexecutiondoneincodewalk
throughs.
•Forinstance,considertheclassicalerrorofwritingaprocedurethatmodifiesa
formalparameterwhilethecallingroutinecallsthatprocedurewithaconstant
actualparameterErrors.

Code Inspection (Contd.)
•Itismorelikelythatsuchanerrorwillbediscoveredbylookingforthesekindsof
mistakesinthecode,ratherthanbysimplyhandsimulatingexecutionofthe
procedure.
•Inadditiontothecommonlymadeerrors,adherencetocodingstandardsisalso
checkedduringcodeinspection.
•Goodsoftwaredevelopmentcompaniescollectstatisticsregardingdifferenttypes
oferrorscommonlycommittedbytheirengineersandidentifythetypeoferrors
mostfrequentlycommitted.
•Suchalistofcommonlycommittederrorscanbeusedduringcodeinspectionto
lookoutforpossible

Code Inspection (Contd.)
•Followingisalistofsomeclassicalprogrammingerrorswhichcanbechecked
duringcodeinspection:
•Useofun-initializedvariables.
•Jumpsintoloops.
•Non-terminatingloops.
•Incompatibleassignments.
•Arrayindicesoutofbounds.
•Improperstorageallocationandde-allocation.
•Mismatchesbetweenactualandformalparameterinprocedurecalls.
•Useofincorrectlogicaloperatorsorincorrectprecedenceamongoperators.
•Impropermodificationofloopvariables.
•Comparisonofequallyoffloatingpointvariables,etc.

Coding
•Thegoalofcodingphaseistotranslatethedesignofthesystemintocodeina
givenprogramminglanguage,whichcanbeexecutedbyacomputerandthat
performsthecomputationspecifiedbythedesign.
•Acodingstandardlistsseveralrulestobefollowedduringcoding,suchastheway
variablesaretobenamed,thewaythecodeistobelaidout,errorreturn
conventions,etc.
•Acodingstandardgivesauniformappearancetothecodeswrittenbydifferent
engineers.
•Itenhancescodeunderstanding.
•Itencouragesgoodprogrammingpractices.

Importance of Good Programming Style
To simplify software maintenance
To avoid problems
To simplify the testing process.
To achieve readability.
To improve modifiability
To improve transportability
To make a robust product

Coding standards and guidelines
•Rulesforlimitingtheuseofglobal:Theseruleslistwhattypesofdatacanbe
declaredglobalandwhatcannot.
•Contentsoftheheadersprecedingcodesfordifferentmodules:Thefollowing
aresomestandardheaderdata:
•Nameofthemodule.
•Dateonwhichthemodulewascreated.
•Author’sname.
•Modificationhistory.
•Synopsisofthemodule.
•Differentfunctionssupported,alongwiththeirinput/outputparameters.
•Globalvariablesaccessed/modifiedbythemodule.

Coding standards and guidelines
•Namingconventionsforglobalvariables,localvariables,andconstant
identifiers:Apossiblenamingconventioncanbethatglobalvariablenames
alwaysstartwithacapitalletter,localvariablenamesaremadeofsmallletters,
andconstantnamesarealwayscapitalletters.
•Errorreturnconventionsandexceptionhandlingmechanisms:Thewayerror
conditionsarereportedbydifferentfunctionsinaprogramarehandledshould
bestandardwithinanorganization.

Coding standards and guidelines: Recommended by SW Development
Organization
•Donotuseacodingstylethatistoocleverortoodifficulttounderstand
•Donotuseanidentifierformultiplepurposes
•Thecodeshouldbewell-documented
•Thelengthofanyfunctionshouldnotexceed10sourcelines
•Donotusegotostatements
•Donotdohardcoding
Tags