Testing KK
Testing KK
.._____
Aa wa know, robuat tut c:aaee are 6n + J
caaet1
,.... __
are 19
u given below:
0
.
1 - 1
t I NJ5tT mad ...y lib t.o eee what happens
- - . ha elec:tauaic circuits analysis, this is -2 I 0
3
i...- at ill tM - that boundary value test cases
......_ _.. eftbrt. Worst case testing for a 4 50
• appaaed t.o 4n + 1 test cases for boundary 5 99
will haw 5 1 = 25 test cases and are given in
6 100
7 101
,.,.,,.,. 8
9
50
50
:,
"
200 299
10 50
14
11 50
300
-IOI 15
16
200
299 100
12 50
-IOO
-
13 50
IOI
-299 17
18
299
200
14 50
299
- 15 50
-He 19 299 299
16 50
-101 20 299 300
--
17 50
-IOO 21 300 100
-
18 50
22 300
I
-..- ..
IOI
- 19 50
23 300 200
11 1 18 24 300 299
u 101 25 300 300
L1
D I y ,,.._ ....,_ . . . . 1NII for the programa with independent input values.
a..illpatwalwahaaW .. tnlJr" I z f t Tbiatechniquedoeanotmakesenseforboolean 0
- i ti when eztreme .......,_. 'lmJB and FALSE, but no choice is available for
clear
.._..,..._lib acwninel fl
jaat - - - • dad below boundary.
J just
0
0
T a" M 5 0
die pnc1am for the. detea · tien ol nature of roots of a quadratic equation a s
ill Bumple 8.1. Design the...._ t.aat caw and WOl'llt teat caaes for this program
6 0
...
.:.Ii 101 50
I 50 50 50
I 50 0 60
I 50 101 50
7 -I 50
50
50
50
50
0
8 50 50 101 Invalid input
9 50 50 50 Equilateral
10 60 60 60 Equilateral
11 50 50 60 Isosceles
12 50 60 50 Isosceles
13 60 50 50 Isosceles
14 100 99 50 Scalene
15 100 50 50 Not a triangle
16 100 50 25 Not a triangle
17 50 100 50 Not a triangle
18 50 100 25 Not a triangle
--------- -
19 50 50 100 Not a triangle
Entry
True
Tr,u Fol,,
Tnl4 Fala, . Faln
X
X X
X
X
".; , I ~ I \. ::,
'!"•·•
-.
-,1
II
~
'I~
! I ::t I;,.
I::.;::.
-,-::II
!u
:All
......JI
":7j
..... .J
-.i.,...
[?war-Testing
~
Year Expected output
1962 Impossible file update is made. If the character in column 1 is incorrect, message :r is 15gued. lf the char-
1964 Impossible acter in column 2 is not a digit, message y is issued"
1962 Impossible The causes are
Impossible ' c : character in columnl is A /1-
1964 1
c2: character in column 1 is B /
1962 Impossible
• FebrUr7
Tec:hniqUe /
· '
e. ac co umn m the table represents a test case.
on ~le are ~onvert.ed into test cases. ,
for the graph 18 shown in Fig. 8.8 .
~
8 ;)
i •= of each node 811 ha . the
represents the present at.ate. The~ . value. O or 1; 0 represents the 'absent sta t~• and 1 Although the graph in Fig. 8 .9 repre.,enb the ;:pecific:ation, 1t doe.s not contain an impo5·
·
NOT function states that if •
c, AND
• functi
c, JB l, e, isl; else e 1 is O. The
_tity function states that if c is 1 e is l · else e 1 1s 0. The
1 e 18 0 else
• · 1 ' 1 '
el 18 1. ~e OR function states that if c 1 or c2 or
siblc combination of cause.,-.- it is impo>'sible for both c-a.u;:e$ c 1 or Ci to be ,,et to 1 :;i.multane-
ously. In most programs. certain combination,- of c-nuse,- a n.- impo~ ible bec-au.-;.e of "')"lltactic or
0. The AND and OR functiona are allow on states that if both c 1 and c are 1, e i_ is 1; else e1 15 environmental c-onsiderations. To ncrount for th ese, the notations m Fig ~. 10 i~ u..-.ed. The E
Myen [MYER79] explained tbia ed ~ have ~ny number of inputs.
2
_ constr_a int stntes thnt it must alway" be true thnt nt m o.:.-t one of c orc can be 1 ~c 1 orct cannot
1 2
column l mwn be an A or B. The ~ ~ e l y with the following example. "The character" he 1 simultaneously). The I constraint state.o< that nt l ea,-t on e of cl' c 3 and c3 m\13t alwa~·:' be
( 1. cl' c2 and <'s cannot be O simultanoously). The O ronstraint state.-,. that one, and only one, of
m column 2 must be a digit. In this situation , th e
-
..,._w...-beL
,.~_-:,._...
I and el 'lbeRcomtraint•tates
to be 0). tbat,forc 1 to be I ' c2 must be I ----=::__ ~. :'"V
i.e., it is itn--.....:_
( i' n ,• • • -
- ~- - Oftware En
Jlosaib~
~ Testing
-~--
~-- ..
1.;ssrnplc 8.12
Consider the triangle problem specified in the example 8.3. Draw the cause~ect gra
....0 B
,<:-.</ ~
identify the test cases.
E<_... ..... ..... .....
~.......... _..... Solution
-0 Inclusive '..._ ..._
..........
- \~
--(::)
The causes are
C1
Cz
c6
Not a triangle
One and only one Scalene triangle
ez
Fig. 8 .10: C'..c,r•.!r.i,nt 'i~"T'Ool Isosceles triangle
e3
Equilateral triangle
There ia frequently a need for a constraint among effects. The M con s traint in Fig. 8. 11 e4
lltatea that if eft"ect r 1 ia 1, effect e 2 is forced to be 0. e Impossible stage
5
The cause effect graph is shown in Fig. 8.13 and decision table is :;hown in tahle
M
0- ' masks
\
\
•
u,sting are harder to achieve than may appear at first glance.
J· ·~ In functional testing, all specifications are being checked against the implementation,
,. I j 90 wb:, do we really require structural testing? It seema to be necesaary becauae then might
be parts of the code. which are not fully exercised by the functional teats. There may aiao be
~ eections of the code, which are surplus to requirements. That is to say, we have c:heckad the
~ _J program against the functional tests and no errors are revealed, then further inspection by
structural tests re,-eals a piece of code that is not even needed by the specifications and hence
·:.; not examined by functional testing. This can be regarded as an error since it is a dniation
from requ1remen~. It may find tho..."le errors, which have been missed by functional teatiq
NORM89
want to look in to t.he program, examine the code and watch it as it rune. Thia
~ dynamu: and i11 n ~ testing a running program; therefore it is called dyp•rni!:
ling. It ~-'-' wont to test the program without running it; meaning thereby ezarn-
and rm,l"~,ng 1l, thl'n it is calll'cl_stntic white box testing.
9tntic white box tcl'ting is the process of ~efu.lly and methodically reviewing
gn. orchit.octure, or c-ode for hugs without executing it. It is sometimes referred
lllnlrl.urnl nnnl_y1n11 IPA1'TOll. .
....
vcn ton group ofle11t. t.ochniques based on judiciously selecting a set
..... •
... ... rugrnm. If the flct <![Path11 is properly chosen, then it means that we
un.• of u-111. thoroughncfls. Fot example, pick enough paths to assure
nt is c;ccut.cd at least. once. It is most applicable to new software for
Ling. It requires complete knowledge of the program's structure and
unit test their own code. The effectiveness of path testing rapidly dete-
r the softwar<J under test increases. It is rarely, if ever, used for system
loper, it is the hasic lest technique [BEIZ90].
Thia type of testing in;,olvcs:
1. generating a set of paths that will cover every branch in the program.
,_-;:-IC- - -
2. finding a set of test cases that will execute every path in this set of program paths.
~mc:nt· As•
The two steps arenot necessarily executed in sequence. Path generation ri.e., step 1)
IP('rsons..
can be performed through the static analysis of the program control flow and can be automated.
~
Aow graph
• -
• • - ti.._ . _ • •
The control flow of a program can be analysed using a graphical representation known as flow
.g raph. The flow graph is a directed graph in which nodes are either entire statements of-
fragments of a statement, and edges represents flow of control. Ifi and j are nodes in the program
graph, there is an edge from node i to nodej if the statement (fragment) corresponding to node
100 - -W (s S lOC))•, then we may tty testing the i can be executed immediately after the statement (fragment) corresponding to node i.
.. -·. - t.'
' T' '
~llre ~ ~
a ..,_...._~ ~ eblly be generated from the code of any problem. Th .~
a ea• ! ... D.:• 8 14
.;~.WafWnm.,. -~. · · e bas1c
eoii,
Our first step is to prepare a flow graph from the code. The flow graph of previous date
pu,gnun (given in Fig. 8.15) is generated and is given in Fig. 8.16. Such a flow graph helps11.1
to understand the flow of control from source to destination. We want to find paths from thii
control flow and may like to execute every path during testing.
/* Program to generate the previous date given a date, assumes da:,
given as dd :tmn yyyy separated by space and performs error checks on ~i:2
validity of the current date entered. */
tinclude <stdio.h>
tinclude <conio.h>
1 int main ()
2 {
(t ii) ABFGHJLMQR
ftliam•7
. ._.._.. . .hlail!&IIIBilili;.,,t ia 7_ ~ there are seven independent paths as given in
::
3
's
•
Wlaena..r .........._..~llllllac.weanint.net.edtofindindependentpaths. The objective 6
• to tnae all . . . .,....._.. ___ once. Path tracing ia not an easy task and is subject to •
.,..._lltheaiaeofan,f-b; ,itbecameeclitliculttodopatbtracingmanua11y. In practice, B
it ia alwa.,a
graph matrix~adTiaaWe . llr taciac tool. To develop such a
ta .llalpmL
be quite tool. a data structure, called
· A graph matriz ia a aq-. matriz with one row and one column for every node in the
paph. 1be size of the matrix (i.e.. the number of rows and collllDDB) ia equal to the number of
DDdaa in the flow graph. So111A eumplee of graphs and 8880Ciated matrices CBEIZ90] are shown
ial'Yc-B-24.
In the graph matriz. there is a place to put every pouible direct CODnection between any
Flow QIIIPh
aode and any other node. A connection from node i to nodej does not imply a connection from
Fig. a.M
Software Engine
en~g I
path ..ad" and three-link path "ahr" av . ,
a1 1ah11, Hence, our ohject,ve 1':I t.c, fi
not de-paths The steps ere g1vcn
operations to obtain th<> set of all paths lwtwl'l•n
A, Ai, A3, ... An-I_ du-paths that are not de-pat.
· nil
to programme and can be used for designing te11ting tools. Draw Ille progr,
llow grapt•
another form of structural testing. It has nothing to do with data now "
u. nere, we -ntrate
....,,,_ on the usage ofvariabl~
~ and the focus point11 arc;
where variables receive values.
Statement where these values are used or referenced.
F1oW graphs are al~ used as a basis for t.hc data flow testing as in the case of path
times, we feel that it may serve as a check on path testing and is treated as
form of path t.t•,rmg [JORG95).
we know, variables are defined and referPnced throughout the program. We may
au.- &. define/reference anomalies:
A Yariable is defined but not used/referenced.
A variable is used but never defined
A variable is defined t'\\icc before it is used.
F,
anomalies can be idenbfied by statjc analysis of code i.e., analysing code without
t. In order to formalise the approach of data now testing, some- definitions are One simple approach
which are discussed below (JORG 951. strategy. In this strategy
docs not guarantee lOOt
ltlons paths that arc not defi
'!be definitions refer to a program P that has a program graph G IP) a11d a set of program Example 8 .20
variables V. The G (P) has a single entry node and a single exit node. The set of all paths in P Consider the program
ia PATHS (P).
input is n triple of pos:1m·
(i) Defining node: Node n e G (PJ is a defining node, of the variable u e V written as intenml 10, 1001 Th{' p
DEF(v, nl, iffthe value of the variable L' is defined at the stat('rnent fragrnc·nt correspondinJ to
node n.
u-..noc1e: Node n E G CP) is a usage node ofthl' variable II c V, written as USE
n), iff'the value of the variable vis used at the' statement fragm,mt c1,r-r1•sponding lo nodl' 11 (111 I 1ml\gt
A usage node USE (v, n) is a predicate use <denoted asp) iff i;tatmn<mt. 11 is a pn!cliC'aln Rlalt'•
(11·1 ,,qual
ment otberwise USE Iv, n) is a computation use ( dPr10ted as <"l . >
(I 1111,.1hd
rw\ Definition U&e: A definition USl~ path with n•sped ton var·iabln 11 ld1111otPd du -path 1
PATHS lPJ such that, for some c• c V, there En-e dl•firw and usage nocli-H DEF Ill, 1111 1-'md all du
IIUCh that m and n are the imtial and final nodes of"the p~tlh. '
tion clear: A definition clear path with reRJJt•et ' to a v11,·iahln '·'
ia a definition use path in PATHS (J> J with initial and finul nodl'B l >EF tu,,,, 1
that no other node in the path 1s a defining node of 11.
and de paths describe the flow of data nc:ross 1,0111'1·11 st.at1i1111•11t.t1 fr 11111
values are defined to points at which tllC' values are 1u;ed The du-puths
~ear are potential 1,xouhle .5R0Js.
.... - ,•
- Software Engineering
11,,l,n•,,c.•,e
:_-=;!nihon
Palla~·
C'rear?
3, 18 no
3,29 no
12, 18 no
12, 29 no ply
16, 18 Yes
16. 29 Ye s
du-paths are 18 out of which four paths are not definition clear. This equation allows usto determm
equate test suite will catch rC'al faultb ba•.{-rl
U.5 llede«ton Testing this scheme does not penalize a test "-UJtf' 1f
Mutation testing is a fault based technique that is simi!!r to fault se~ding, except that mut,..1 _ instance, suppose that test suite A with 100
t.o program statements are ma'cm in order to de~rmine pr_cpert1es ~bout test case~. It is 25 test cases had a score of 49~, _Altho~h A h
buically a fault aimlllation technique. In this technique, multiple copies of a pr_o gram are large as B, and for the small increase m muta
made and each copy is altered; this altered copy is called a mutant. Mutants arc executed with
t.-t data t.o Clet.eniiine whether tt;;°test data arc capable of dct.ecfing the change bctwe£>n the
costs.
oripna] program and the mutated program. A mutant that is detected by a test case is termed
"'killed• and the goal of mutation procedure is to find a set of test cases that are able to kill a.5 LEVELS OF TESTlf,IG
groups of mutant programs [FRIE 95 ). i::- c;.._ -- - c-· i::-----
Our emphasis during testing i~ to e.xamme and mfJCllli. =- ·- _
of testing i.e., individual mod~o thC' ~~~"~ c .• · , ~ ".: -
Mutant.a are produced by applying mutant operators. An operator is essentially a gram-
matical rule that changes a single expression to another expression. The new expression should
modu.le; in r3U possible way:" "o as to detect
be ayntactically legal according to the language. If one or more mutant operators are applied
gates of modules and test their detailed structure
t.o all expressions in a program, the result is a large set of mutants, all of which must be killed
internal £tructure of the software and concentra
by the teat cases or shown to be equivalent to the original expression.
operations that will be reque:-ted by thf' user The...--e
When we mutate code there needs to be a way of measuring the degree to which the to as unit testing, integration testing, .i.nd sy~:
code has been modified. For example, if the original expression is x + I and the mutant for that
Out of the thre.~ tr.adil.ional lf'wl-< oftc--;;
expression is x + 2, that is a lesser change to the original code than a mutant such as (c*22),
methods discussed so fnr in thi~chnptcr ;i~il
where both the operand and the operator are changed. We may have a ranking scheme, where
is understood better than integration tc;:t1
a first order mutant is a single change to an expression, a second order mutant is a mutation to
proach sheds some insight· te:-:t thl' md\\ 1du
a first order mutant, and so on. High order mutants becomes intractable and thus in practice
only low order mutants are used. until the entire s,·sh.•m is tested :3,-stem t
and it oflen bonlcrs on rustomer ~r<'\:•ptanC'l'
One difficulty associated with whether mutants will be killed is the problem of reaching rntlwr than strul't.urnL This is mostlv du
the location; ifa mutant is not executed, it cannot be killed. Special test cases are to be designed cnst's. l n the !l'nditfonnl new. integt.;hon t,'st
to reach a mutant. For example, suppose, we have the code
is not sysh•m lt•st ing. :\tost of the usu.1I disc-us:;
Read (a, b, c);
in whid, units 111·1.• mll'gn\tl'd: top-do\\n. bottom u
lf(a > b) and (b = c) then thn•t• phnst•s, integrnt1t1n is the• least wc-fl und•·
x: • a*b*c; (make mutants; ml' m , m •••.•. J Ernll'S \ocnh•<l dunng testmg nm.Y fall
2 3
be=~
To te th.18 · d · · n•quiro im11wthnt1• nt t1•11llon nn.' usualh of .1 n.1tun' th;:it thcs cr;:i!>\., Lhc -,.::•~~- •
~ , mput omam must contain a value such that a is greater than h and h
Prntion, nnd ll'stn,g rnnnot l'Ontmm• u~bl the~ nn:- rcmc.wed. Scm
lfin~t domain does not contain such a value, then all mutants made at this location hefon, testing ,s rompkll' but rnn tx, 1gnorl'd dunng tht:- 1mmNh.1•- •-•.c•n·• .,,he'd.:.':'
equivalent to the original program, because the statement x: = a*h*c 1s
th e• import1111ce ofremovin~ nn l'i-ror 1-, pr<'Pl't-t10nal to its :,;e"cn
t cannot be reached during execution). If we make the mutant x + y for
..... ~
,......,....., Tbere are errors that may be
-
replace modules that are eubordinate te 'e6il -- =..I
them at the moment; these Will or dummy subprogram uses the eubordinate modaW .....::_,_
••n••L111•w becomea concerned enough to .tion, prints verification of entry, and retuma - ,n
overhead code, called scaffolding repreaenta effort that ii · .._.,
fbr which inaufticient evidence elCi.sts
tion until they become more tractable.
appear in the delivered product ae shown in Fig. 8.29 [JOME ..:i •
~
simple, actual overhead is relatively low. Unfortunately,--,....____,.
with concurrent software.
ly unit tested with simple overhead soft.ware. In such CMell, ~
eel until the integration test step (where driven and . _ an . . - . , A . . . .
is to generate the scaffolding automatically by meam ma i.---. Alllll. . . . . .
--are
~
..-,g other things, allows us to own a single unit in oolation, whilt StLJ ; • . , 11111 . .
system environment by providing appropriate input. oat,-. , -
1
_.
tateraction for the unit. A third and rather ineffective technique ii to llllil . . . . . . . . _ ,
limply to allow incremental addition of modules to a partially integracetl ......,_ I : · ■ . .
the integration testing will also provide sufficient coverage mthe modalr"1 • ...
technique is usually inadequate but nevertheless it is often I M ill 1M
·O
;) The white box testing approaches are normally used for unit
conducted in parallel for multiple modules.
testI:Dg and the - . . - ..
O C) ~
......... lallllng System testing
User "'-
~~
1/
input
Fig. a.a and
~
a-
. . abo carried out alongwith testing. These include test
. . . diac,•eeions with the customer to schedule installation,
matmial et.c. When the product has finally been re•
- . at the end of testing, we want to move immediately into
~~~
dali-tary.
rwming it in isolation from the rest of the
1
Mark's scaffolding
comparing the actual results with the re-
of tbe module. One purpose of testing is to find
. . There are number of reasons in Fig. 8.29 , $-·., •
product [JONE 90) •
8 •5 ·2 Integration Testing
~ "'"'°""'
. . . elllllllp that we can locate an error fairly easily.
we am attempt to test?it in some demonstrably purpo.. of un;t testing i, to d,te,min• that M<h mde........t module ;,
aloo otnented. Tida ,Pvea ULUe ,banre to d,t,nnine that the .,.....,. .,._.. .....,. "
olin- and for t1us reuon ; 0 teg,at~ """"" must he penorwe,l ()oe . ,
tecrati~~is the interface: wht-tht'r parameters match on both sides as, -to ;t.vJW
~
Pll'miuible ranpa, meaning and utilisation [COLL 88).
in isolation. How do we run a - 'l'llonONoeveralclawoal ;nwg,aiwn•u-a-tbat ...U.vhawliul,....,ia•-
, to output intermediate values 08)'. Top down-integration proceeds down the mvocabOn bit-rarchY. addilll one modula
driver routine to call
~.... in it.
- ....
... . .
.,._ .· - - _,4<!! _....~
.-.--"!"·· .,_--_~----...._-
':._.... ..---..a. ....
"' If• l'lt
Ill ► II.I I I ~-
-~--c::-- ,.. >
_,.{~-i - "l
,- . JI
..
•
.. <'.,..,.,..... ~
-=-~
-~i;:--•J>·--....
..-..·.•-~·t...,..:t!
...,.,..
Sollw11ro l-nai, . ]
"'orinu
£...-L-•L•1 NCOnd rulr 11 that. tc-11t.in11 Uw u1mnl i11 rnon• i111port11111. th ,., ~ tJ_phEJ n~1d h::ln ~.:11t1r1_g I.J•chr11 ,~
-IA 1111 1 ,l 1llll{U
Thi• can be accomplt11hed hy 11uhj(•cl.inK th" 1mflw11rc lo tho kind of' 11 11 ,, t 1., 11 , i1t "' 11 · ,.,,.v
cu11 tom1!rt1. L•,mptll.'rfl , ,,rw·rn ti rig
tlltive o( aet.ual UNI, ... de11crihod in lhl' orwrnl1onnl prn~I~ Tiu, 11,i,,,- rnn.v luJ 11h10 I!, ii,'.;· .. ,uch CUHUJmtJrll aro llf,t. ovriilahl!.. tnit. P,1t.1-r;1
-J•L •L•-Jund orw1tina. In fact., 1oflw11rc l'lll{Hll'Crfl m11y 1•xh1h1t. hl1111l Hpot11 lh111 f:IIIIMP 11 II ltl ·t.,ftirll• TheRH poteu_t.wl t:1J,Hl<,mer11 n r!: rnvil(
" · lf·r111
of ..-it.d to Ull(J Lhe H•ift.w~ re. llw fir'K"(;:!fl 111 camed
WIWIWIHI
aottoe exotic problem1: while, they ignorCI prohlim111 t hnt 111111r would 111,ot 11n111,:di 11 tPly. ''
Third, if we are tefllln11 111\(,r modificnt.ion of an t•xist rng pnuluct, wo Hl ,1,1 ,, r-'I only controlled 1Jrw1r1111mont 111 provid1:d TI;
1111
---1.mdN .
raLher Lhan new onc11. Th u rntronn ' 1101 dPJu:iuliiu,1 ,II.1 ,,i,i
. I. Iwt. I. I10· 11111:r re
Io I11•n• 111 ~aniell arc_ going fi,'.· l,et.;1 rel1:ar;1:a of tht•rr pr
-r-u •· . ..,11111.111, ;,iware in their rc11p 1:1}t1v1: _J1n•rn1lles acroas the o1,
a,,w ftmc:Uou ofLhc 10flwaro, and would not lw pnrnlyscd rl t.hmu: Wero 1101 ni.;ht.. 11 1, fiiil ,
11 11
1"'J onmenl, w1t.ho1JI. ,,ny cimtn,I r,f developer
In Lhe old f\anct.ionalit.y could doju11t lhRt-p11roly11c Uw 11111.•r'11 enl.ir,, op•!l'lllion. vi r
en
iuggeet.ions, and nrny m,,, J'1f'Y t h c c1,d{\ whcrec-vcr ~
The rationale for Pt'l8chcnik'11 testing Jlriorit.il'!I i11 thnt exhnw!liv,, l1J11tin1< of' ,- , •.i.·
1111 11111111 gete the fccdlwck of' many r:•,tentrnl c..1.1storn{·rs without
capabiliLle111 inco~plc_w with l.!1c kind <1f11ho1i updnt,; <'yl'lo impo!H!d 011 m11ny sort w 11 n: produits.
The uccopt.urH'•: t.cs tmg 1H r,or,ul nr with cu·,tor-:'>!-:d h~~,-ar.
Juat a1 dependab,ht.y 111 mon.- rmport.nnt IA1 th<i u11er 1.hnn Uw tot.111 l:orref't IH'HII, thn h11Fii,· lltul
to check tho Rof't.wun: as per f!Xpect.at10n8 Th
~n,r functionality al110 weigh much more lwnvily t.h1111 1111111 fi111rtio1111!1ty l•'on•moHI w,
lanned 11yHternalic R1:ries of lrJBUI. The d uratwn of th
1bould avoid disrupting current uimge hy int rnclucinJ< 11 111•w n:l1:11F11: '!f' th,: pl'oduct I hul woul:l
not 1upport. currrnt. functions. :eeks or monthR. The identified buys will be fixed and
the cuHuimer.
During aystc>m tt>sting, we- Bhoulcl <!vnlunl,: n n11111l11•r of' 11t trih11t1°H of' Uw Hoflwnro lhnt
The rn1•:E haH dcvdop1:d a atand::ird 1 1.EEE
are Vital to Lhf' u,1er 11nd nre listccl in Fig. 8.31. Th1:i-e reprosont. I ho op(•r11t ional ror-n:ct , H of software v1:rific11Lio11 and valida tio n" to provid
111 8
the product and mny he purl ofth,i soflwnrl' Sp<'cilirnt.ions [,JONI•: 901.
documenting the taRks r<'quircd by t he st.and:ird
U1able plan !IEEE !l:JI, Validation tes tin g improves thequalr
l11 the produrt convenient, clunr, und predkt~1hlu'l
capabiliti(:R and quality attributes The quality n
These attrihut.es Rcrvu the customer's need for a so!tll·are
Compatible object.ivcs wit.h adequate performance Y.,th n o ~
Will tho produrt work rn1-.-1irtly in ,·onjunctwn with exi11ting dntn, soft -
wnro, 1111d procNlun•s? are accuracy, completcnc:.;s, cons is te ncy, correctness
·-
Do adl•quuhi t111fi!l{U1trdB ngninHI fililurn und mcthncl!I for n•cnvcry oxiHl
-- - -- reliability, tcRtnbility, usability etc Some custom
in the produ<'t'! validation l<'Rting. A systemnlic pl a n m ny rc.,qilt 10to gooa ,;::..:.;. -•
Aro mnnunls rnrnplutl', corre,·t, nnd uncl1•rst11nd11ble'!
_ 8.31; A
-~ -~- -~- ---1--.f'.JbYf»\
v,./W.
~ ART OF DEBUGGING
f,o 'I(
twu.t, t"..AA)J •
As discu1ssC'd earlier .(i_he goal of tc;:t ing 1s to 1dcnufy £M'Cf'
//MA
•
~ IDATION ~
• I
s 111WG\ LI\. / 'J-d ~
\,,.
_ ~
M~i j.c ~:
\ _,,. ·'-'ti
I '
'AJA' of testing generates symptoms , a nd n program'!- fatlure
an error. After getting a symptom , \\ C be-gin to in,~
\_ \'
After idcntilicat ion 11f ph1l't', wc t'.'-!\m111c that po.mien to
It refers to test the software asJl~plel,e_product. This should be done.after unit and integra- proce8H is l'alh•d dcbuggin~.'
tion testing. Here, we want t.o test the software with the perspective of the customers and mny . Qlenn,. dt!hugging i~ tht' activity ,if local
like t.o ensure that the software meets the expectations of the custom~. We may ob,o check fmlun~ hns lwen \ktt•t·tl'd . Unfortunn tl'l,Y . ~Ol: f
all enteric.s of validation criteria section of the S_RS documeni-:- 1'rro,· that is n•sponsibli.', is for from tr i\ inl. lt is one
lt may not be possible t.o predict every usage of the software by the customer. We mny dt-vt'\opnwnt, nnd is pnll'ti,-l'd with tht• lcast ,mlt)\l
plane very systematically and seriously ; but beha,;our of customers may very drastically. lll\ll'h hopt• nnd lit th- plnnning'{GHEZ ~l O
They may try strange inputs, combination of inputs and so on. Some results may be vrry
obvious for developers and may not require any explanation, however, customer may not
andentand correctly and hence may not appriciate it. In order to avoid or minimise such
tiona, the involvement of cu.c;t.omer is required during validation testing. Al phn, beta ar1tl
ecceptance testing are nothing but the various ways of involving customers during testing.
-~----- . .
~
nl techniques for debug:guig_ ~
. llerath
as not an t!-8$) proc-ess. This is Pro'--b •
Tabl9 &I
A printo
lec:hnology. En-or remo,-a.l requires hurn:1. •
code we ha,-e created and requires nn o=n •
"""'
IJ.Jl\' lo nnd relev
locnlions 1
_ does rather than it should do. Commenting "" Dlllld
studied
SHNE 80]. states: should be 'l\·e
ted nnd rl:'
parts of programming. It has element,- of Problein
possible Uf.e on
.th the annoying recognition that we haw made a m1:<take sequpnt problem
_. tbe unwillingness to accept the po..'X-ibility of errors, mcreases the
there is a great sigh of relief and a les,:ening of ten:,1on when the
maa:ter.
• • Pl ➔ [PRES 97] explained few characteristics of bugs that pro,ide some clues .
""llie-, 1 • , and the cause may be geographically remote. That is. the ,-:ymptom
a.r appear in one part of a program, while the cause may actually be located in
. . _ ,-rt. lligb1y 00Upled program strnctures may complicate this ,;ituatiori.
2. ,.._ -,mptom may disappear (temporarily) when another error is corrected. 2. Traces
'Ille aymptom may actually be caused by nonerrors ce.g. round-off inaccuracies). memory and regts
occurringe. Typical co
4. '!'lie aymptam may be caused by a human error that is not easily traced. subroutine. statcm
I. 'l'he a,mpt.om may be a result of timing problems rather than processing problem". printer. disk. or oth
6. h may be difficult to accurately reproduce input conditions (e.g. a real time applica- (4 l timed actuatiDD,
1:ilm in which input ordering is indeterminate) . problem with trace p
language and any c
7. Tbe symptom may be intermittent. This is particularly common in embedded sys- The standard pnnt ,-tate-
3. Print statements
tans that cou~le hardware with software inextricably. ment in the lan~oe be-
8. Tbe aymptom may be due to causes that are distributed across a number of tasks i ng used 1s sprinkled
nmning on clilrerent processors". throughout the program
to output values of key
. A namber ol popular techniques are given in table 8.8.
variable-"
ln.-neraJ. noaeoftheae techniques should be used without a thorough prior analysis of
aympt,maa the error resulting in a hypothesis concerning the cause of the errors. For instance,
if two modules behaff properly when operated separately, and a failure occurs when they are
iDt.elrat.eei, their interface should be checked for consistency. 4. Debugging A program wh1c-h ruru-
Programs l'Oncurrently ,nth th~
1.7.2 ~ AppcWhN pnlgnun under t.-st and
prcwidl'S ,:-ommands t
• 11emt al debugging Proceae is not the debugging tools, but the underlying approaches us('(! ( l) ex:,nnne mem~· and
to dedace t.be cause of the error.
regi.><ters; (21 :;top ,.,,ec
tion (lf tht' pnlgl-am at a
pnrtirulnr pl>int
SN\l'('h for rd\•re
port,c-ulnr const
vnrinbles, rcctst