SlideShare a Scribd company logo
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 1
Chapter 14Chapter 14
Software Testing TechniquesSoftware Testing Techniques
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 2
Testability:Testability: how easily a software can behow easily a software can be
testedtested
•• OperabilityOperability—— the better it works, the more efficiently it can be tested.the better it works, the more efficiently it can be tested. -- ItIt
operates cleanlyoperates cleanly
•• ObservabilityObservability——What you see is what you test. The results of each testWhat you see is what you test. The results of each test
case are readily observed (clear and visible variables and statecase are readily observed (clear and visible variables and states, incorrects, incorrect
output,output, ……))
•• ControllabilityControllability——the degree to which testing can be automated andthe degree to which testing can be automated and
optimizedoptimized
•• DecomposabilityDecomposability——testing can be targeted to independent modulestesting can be targeted to independent modules
•• SimplicitySimplicity——reduce complex architecture and logic to simplify testsreduce complex architecture and logic to simplify tests
•• StabilityStability——few changes are requested during testingfew changes are requested during testing
•• UnderstandabilityUnderstandability——of the designof the design
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 3
What is aWhat is a ““GoodGood”” Test?Test?
•• A good test has a high probability of finding anA good test has a high probability of finding an
errorerror
•• A good test is not redundant.A good test is not redundant.
•• A good test should beA good test should be ““best of breedbest of breed”” (best(best
between those with similar intent)between those with similar intent)
•• A good test should be neither too simple norA good test should be neither too simple nor
too complextoo complex
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 4
Test Case DesignTest Case Design
"Bugs lurk in corners"Bugs lurk in corners
and congregate atand congregate at
boundaries ..."boundaries ..."
BorisBoris BeizerBeizer
OBJECTIVEOBJECTIVE
CRITERIACRITERIA
CONSTRAINTCONSTRAINT
to uncover errorsto uncover errors
in a complete mannerin a complete manner
with a minimum of effort and timewith a minimum of effort and time
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 5
Exhaustive TestingExhaustive Testing
loop < 20 Xloop < 20 X
There are 10 possible paths! If we execute oneThere are 10 possible paths! If we execute one
test per millisecond, it would take 3,170 years totest per millisecond, it would take 3,170 years to
test this program!!test this program!!
1414
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 6
Selective TestingSelective Testing
loop < 20 Xloop < 20 X
Selected pathSelected path
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 7
Software TestingSoftware Testing
Methods
Strategies
white-box
methods
black-box
methods
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 8
WhiteWhite--Box TestingBox Testing
... our goal is to ensure that all... our goal is to ensure that all
statements and conditions havestatements and conditions have
been executed at least once ...been executed at least once ...
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 9
Why Cover?Why Cover?
logic errors and incorrect assumptionslogic errors and incorrect assumptions
are inversely proportional to a path'sare inversely proportional to a path's
execution probabilityexecution probability
we oftenwe often believebelieve that a path is notthat a path is not
likely to be executed; in fact, reality islikely to be executed; in fact, reality is
often counter intuitiveoften counter intuitive
typographical errors are random; it'stypographical errors are random; it's
likely that untested paths will containlikely that untested paths will contain
somesome
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
Basic Path TestingBasic Path Testing
•• Define a basic set of execution pathsDefine a basic set of execution paths
•• Guarantee that every statement isGuarantee that every statement is
executed at least onceexecuted at least once
•• Using a logical complexity measure of aUsing a logical complexity measure of a
procedural design and use it as a guide forprocedural design and use it as a guide for
defining a basic set of execution pathdefining a basic set of execution path
10
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
Flow Graph NotationFlow Graph Notation
•• A representation for control flow ofA representation for control flow of
programprogram
•• Each structured constructEach structured construct --> a flow graph> a flow graph
symbolsymbol
11
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
Independent program pathIndependent program path
•• Any path through the program that introduces atAny path through the program that introduces at
least one new set of processing statements or aleast one new set of processing statements or a
new condition.new condition.
•• An independent path must move along at leastAn independent path must move along at least
one edge that has not been traversed before theone edge that has not been traversed before the
path is defined.path is defined.
•• The basic set is not unique.The basic set is not unique.
•• How do we know how many paths to look for?How do we know how many paths to look for?
–– CyclomaticCyclomatic complexitycomplexity
12
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 13
Basis Path Testing:Basis Path Testing: CyclomaticCyclomatic
ComplexityComplexity
First, we compute the cyclomatic
complexity:
number of simple decisions + 1
(simple decisions: predicate node)
or
number of enclosed areas + 1
or
E-N+2 (E number of edges, N number of nodes)
In this case, V(G) = 4
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 14
CyclomaticCyclomatic ComplexityComplexity
A number of industry studies have indicatedA number of industry studies have indicated
that the higher V(G), the higher the probabilitythat the higher V(G), the higher the probability
or errors.or errors.
V(G)V(G)
modulesmodules
modules in this range aremodules in this range are
more error pronemore error prone
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 15
Basis Path TestingBasis Path Testing
Next, we derive theNext, we derive the
independent paths:independent paths:
Since V(G) = 4,Since V(G) = 4,
there are four pathsthere are four paths
Path 1: 1,2,3,6,7,8Path 1: 1,2,3,6,7,8
Path 2: 1,2,3,5,7,8Path 2: 1,2,3,5,7,8
Path 3: 1,2,4,7,8Path 3: 1,2,4,7,8
Path 4: 1,2,4,7,2,4,...7,8Path 4: 1,2,4,7,2,4,...7,8
Finally, we derive testFinally, we derive test
cases to exercise thesecases to exercise these
paths.paths.
11
22
33
44
55 66
77
88
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 16
Basis Path Testing NotesBasis Path Testing Notes
you don't need a flow chart,you don't need a flow chart,
but the picture will help whenbut the picture will help when
you trace program pathsyou trace program paths
count each simple logical test,count each simple logical test,
compound tests count as 2 orcompound tests count as 2 or
moremore
basis path testing should bebasis path testing should be
applied to critical modulesapplied to critical modules
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
Deriving test casesDeriving test cases
•• Using the design or code, draw a flowUsing the design or code, draw a flow
diagramdiagram
•• Determine theDetermine the cyclomaticcyclomatic complexity ofcomplexity of
the flow graphthe flow graph
•• Determine a basis set of independentDetermine a basis set of independent
pathspaths
•• Prepare test cases to force the executionPrepare test cases to force the execution
of each pathof each path 17
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 18
Graph MatricesGraph Matrices
•• A tabular representation of a flow graphA tabular representation of a flow graph
•• A graph matrix is a square matrix whose sizeA graph matrix is a square matrix whose size
(i.e., number of rows and columns) is equal to(i.e., number of rows and columns) is equal to
the number of nodes on a flow graphthe number of nodes on a flow graph
–– Each row and column corresponds to an identifiedEach row and column corresponds to an identified
node, andnode, and
–– matrix entries correspond to connections (an edge)matrix entries correspond to connections (an edge)
between nodes.between nodes.
•• By adding aBy adding a link weightlink weight to each matrix entry,to each matrix entry,
the graph matrix can become a powerful toolthe graph matrix can become a powerful tool
for evaluating program control structure duringfor evaluating program control structure during
testingtesting
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
•• Link weights can beLink weights can be
–– The probability of execution of that edgeThe probability of execution of that edge
–– The processing time for execution that edgeThe processing time for execution that edge
–– The memory requiredThe memory required
–– The resource requiredThe resource required
•• Help to design test casesHelp to design test cases
19
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 20
Other Control Structure TestingOther Control Structure Testing
•• Condition testingCondition testing —— a test case design methoda test case design method
that exercises the logical conditions containedthat exercises the logical conditions contained
in a program modulein a program module
•• Data flow testingData flow testing —— selects test paths of aselects test paths of a
program according to the locations ofprogram according to the locations of
definitions (D) and uses (U) of variables in thedefinitions (D) and uses (U) of variables in the
program (every DU chain be covered at leastprogram (every DU chain be covered at least
once)once)
•• Loop testingLoop testing –– focus on validity of loopfocus on validity of loop
constructsconstructs
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 21
Loop TestingLoop Testing
four different classes of loopfour different classes of loop
NestedNested
LoopsLoops
ConcatenatedConcatenated
LoopsLoops UnstructuredUnstructured
LoopsLoops
SimpleSimple
looploop
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 22
Loop Testing: SimpleLoop Testing: Simple
LoopsLoops
Minimum conditionsMinimum conditions——Simple LoopsSimple Loops
1. skip the loop entirely1. skip the loop entirely
2. only one pass through the loop2. only one pass through the loop
3. two passes through the loop3. two passes through the loop
4. m passes through the loop m < n4. m passes through the loop m < n
5. (n5. (n--1), n, and (n+1) passes through1), n, and (n+1) passes through
the loopthe loop
where n is the maximum numberwhere n is the maximum number
of allowable passesof allowable passes
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 23
Loop Testing: Nested LoopsLoop Testing: Nested Loops
Start at the innermost loop. Set all outer loops to theirStart at the innermost loop. Set all outer loops to their
minimum iteration parameter values.minimum iteration parameter values.
Test the min+1, typical, maxTest the min+1, typical, max--1 and max for the1 and max for the
innermost loop, while holding the outer loops at theirinnermost loop, while holding the outer loops at their
minimum values.minimum values.
Move out one loop and set it up as in step 2, holding allMove out one loop and set it up as in step 2, holding all
other loops at typical values. Continue this step untilother loops at typical values. Continue this step until
the outermost loop has been tested.the outermost loop has been tested.
NestedNested LoopsLoops
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 24
Loop Testing: ConcatenatedLoop Testing: Concatenated
LoopsLoops
If the loops are independent of one anotherIf the loops are independent of one another
then treat each as a simple loopthen treat each as a simple loop
else* treat as nested loopselse* treat as nested loops
endifendif**
for example, the final loop counter value of loop 1 isfor example, the final loop counter value of loop 1 is
used to initialize loop 2.used to initialize loop 2.
Concatenated LoopsConcatenated Loops
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 25
BlackBlack--Box TestingBox Testing
requirementsrequirements
eventseventsinputinput
outputoutput
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
•• Incorrect or missing functionsIncorrect or missing functions
•• Interface errorsInterface errors
•• Errors in Data structures or external dataErrors in Data structures or external data
base accessbase access
•• Behavior or performance errorsBehavior or performance errors
•• initialization and termination errorsinitialization and termination errors
26
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 27
BlackBlack--Box TestingBox Testing
•• How is functional validity tested?How is functional validity tested?
•• How is system behavior and performance tested?How is system behavior and performance tested?
•• What classes of input will make good test cases?What classes of input will make good test cases?
•• Is the system particularly sensitive to certain inputIs the system particularly sensitive to certain input
values?values?
•• How are the boundaries of a data class isolated?How are the boundaries of a data class isolated?
•• What data rates and data volume can the systemWhat data rates and data volume can the system
tolerate?tolerate?
•• What effect will specific combinations of data have onWhat effect will specific combinations of data have on
system operation?system operation?
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 28
GraphGraph--Based MethodsBased Methods
new
file
menu select generates
(generation time < 1.0 sec)
document
window
document
tex
t
is represented as
contains
Attributes:
background color: white
text color: default color
or preferences
(b)
object
#1
Directed link
(link weight)
object
#2
object
#
3
Undirected link
Parallel links
Node weight
(value
)
(a)
allows editing
of
To understand theTo understand the
objects that areobjects that are
modeled inmodeled in
software and thesoftware and the
relationships thatrelationships that
connect theseconnect these
objectsobjects
In this context, weIn this context, we
consider the termconsider the term
““objectsobjects”” in the broadestin the broadest
possible context. Itpossible context. It
encompasses dataencompasses data
objects, traditionalobjects, traditional
components (modules),components (modules),
and objectand object--orientedoriented
elements of computerelements of computer
software.software.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
Graph based testingGraph based testing
•• Transaction flow modelingTransaction flow modeling
•• Finite state modelingFinite state modeling
•• Data flow modelingData flow modeling
•• Timing modeling (sequence of executionTiming modeling (sequence of execution
and its time)and its time)
29
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
Equivalence PartitioningEquivalence Partitioning
•• Divides the input domain of a programDivides the input domain of a program
into classes of data from which test casesinto classes of data from which test cases
can be derived.can be derived.
•• Define test cases that uncovers classes ofDefine test cases that uncovers classes of
errorserrors
30
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
•• If an Input condition isIf an Input condition is
–– A rangeA range
•• One valid and two invalid equivalence classesOne valid and two invalid equivalence classes
–– A specific valueA specific value
•• One valid and two invalid equivalence classesOne valid and two invalid equivalence classes
–– A member of a setA member of a set
•• One valid and one invalid equivalence classesOne valid and one invalid equivalence classes
–– BooleanBoolean
•• One valid and one invalid equivalence classesOne valid and one invalid equivalence classes 31
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao
Boundary value checkingBoundary value checking
•• A greater number of errors occurs at theA greater number of errors occurs at the
boundaries of the input domainboundaries of the input domain
32
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 33
Comparison Testing (NComparison Testing (N--versioning)versioning)
•• Used only in situations in which the reliability ofUsed only in situations in which the reliability of
software is absolutely critical (e.g., humansoftware is absolutely critical (e.g., human--
rated systems)rated systems)
–– Separate software engineering teams developSeparate software engineering teams develop
independent versions of an application using theindependent versions of an application using the
same specificationsame specification
–– Each version can be tested with the same test dataEach version can be tested with the same test data
to ensure that all provide identical outputto ensure that all provide identical output
–– Then all versions are executed in parallel with realThen all versions are executed in parallel with real--
time comparison of results to ensure consistencytime comparison of results to ensure consistency
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 34
Orthogonal Array TestingOrthogonal Array Testing
•• Used when the number of input parameters isUsed when the number of input parameters is
small and the values that each of thesmall and the values that each of the
parameters may take are clearly boundedparameters may take are clearly bounded
•• Dispersed uniformly throughout the test domainDispersed uniformly throughout the test domain
(balancing property)(balancing property)
One input item at a time L9 orthogonal array
XY
Z
X
Y
Z
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 35
OOTOOT——Test Case DesignTest Case Design
BerardBerard [BER93] proposes the following approach:[BER93] proposes the following approach:
11.. Each test case should be uniquely identified and should be expliEach test case should be uniquely identified and should be explicitlycitly
associated with the class to be tested,associated with the class to be tested,
2.2. The purpose of the test should be stated,The purpose of the test should be stated,
3.3. A list of testing steps should be developed for each test and shA list of testing steps should be developed for each test and shouldould
contain [BER94]:contain [BER94]:
a.a. a list of specified states for the object that is to be testeda list of specified states for the object that is to be tested
b.b. a list of messages and operations that will be exercised asa list of messages and operations that will be exercised as
a consequence of the testa consequence of the test
c.c. a list of exceptions that may occur as the object is testeda list of exceptions that may occur as the object is tested
d.d. a list of external conditions (i.e., changes in the environmenta list of external conditions (i.e., changes in the environment
external to the software that must exist in order to properly coexternal to the software that must exist in order to properly conductnduct
the test)the test)
e.e. supplementary information that will aid in understanding orsupplementary information that will aid in understanding or
implementing the test.implementing the test.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 36
Testing MethodsTesting Methods
•• FaultFault--based testing (same for conventional)based testing (same for conventional)
–– The tester looks for plausible faultsThe tester looks for plausible faults
•• aspects of the implementation of the system that may resultaspects of the implementation of the system that may result
in defects.in defects.
–– To determine whether these faults exist, test cases are designedTo determine whether these faults exist, test cases are designed
to exercise the design or code.to exercise the design or code.
•• Class Testing and the Class HierarchyClass Testing and the Class Hierarchy
–– Inheritance does not obviate the need for thorough testing of alInheritance does not obviate the need for thorough testing of alll
derived classes.derived classes.
–– In fact, it can actually complicate the testing process.In fact, it can actually complicate the testing process.
•• ScenarioScenario--Based Test DesignBased Test Design
–– ScenarioScenario--based testing concentrates on what the user does, notbased testing concentrates on what the user does, not
what the product does.what the product does.
–– This means capturing the tasks (via useThis means capturing the tasks (via use--cases) that the user hascases) that the user has
to perform, then applying them and their variants as tests.to perform, then applying them and their variants as tests.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 37
OOT Methods: Random Testing class basedOOT Methods: Random Testing class based
•• Random testing:Random testing: check class instance life historiescheck class instance life histories
–– identify operations applicable to a classidentify operations applicable to a class
–– define constraints on their usedefine constraints on their use
–– identify a minimum test sequenceidentify a minimum test sequence
•• an operation sequence that defines the minimum life history of tan operation sequence that defines the minimum life history of the class (object)he class (object)
–– generate a variety of random (but valid) testgenerate a variety of random (but valid) test
sequencessequences
•• exercise other (more complex) class instance life historiesexercise other (more complex) class instance life histories
Like for an instance of Account class: open, setup, depositLike for an instance of Account class: open, setup, deposit,,
withdraw, close And open, setup, deposit, [deposit, withdraw,withdraw, close And open, setup, deposit, [deposit, withdraw,
balance,balance, creditlimitcreditlimit], withdraw, close], withdraw, close
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 38
OOT Methods: PartitionOOT Methods: Partition TestingclassTestingclass basedbased
•• Partition TestingPartition Testing
–– reduces the number of test cases required to test a class inreduces the number of test cases required to test a class in
much the same way as equivalence partitioning formuch the same way as equivalence partitioning for
conventional softwareconventional software
–– statestate--based partitioningbased partitioning
•• categorize and test operations based on their ability to changecategorize and test operations based on their ability to change the state of a classthe state of a class
–– attributeattribute--based partitioningbased partitioning
•• categorize and test operations based on the attributes that theycategorize and test operations based on the attributes that they useuse
•• For example: partition the operations according to their use/modFor example: partition the operations according to their use/modify/donify/don’’t use ort use or
modify an attributemodify an attribute
–– categorycategory--based partitioningbased partitioning
•• categorize and test operations based on the generic function eaccategorize and test operations based on the generic function each performsh performs
•• For example: operations can be categorized asFor example: operations can be categorized as
initialization/computation/queries/terminationinitialization/computation/queries/termination
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 39
OOT Methods: InterOOT Methods: Inter--Class TestingClass Testing
(During integration)(During integration)
•• RandomRandom
–– Like in class testingLike in class testing
•• PartitioningPartitioning
–– In (intraIn (intra--)class testing: state)class testing: state--based, attributebased, attribute--based,based,
categorycategory--basedbased
Here:Here:
–– Partition according to messages which serve differentPartition according to messages which serve different
classesclasses
–– StateState--basedbased
•• BehavioralBehavioral
–– StateState--basedbased
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 40
OOT Methods: InterOOT Methods: Inter--Class TestingClass Testing
(During integration)(During integration)
•• RandomRandom
–– For each client class, use the list of class operators toFor each client class, use the list of class operators to
generate a series of random test sequences. The operatorsgenerate a series of random test sequences. The operators
will send messages to other server classes.will send messages to other server classes.
–– For each message that is generated, determine theFor each message that is generated, determine the
collaborator class and the corresponding operator in thecollaborator class and the corresponding operator in the
server object.server object.
–– For each operator in the server object (that has beenFor each operator in the server object (that has been
invoked by messages sent from the client object), determineinvoked by messages sent from the client object), determine
the messages that it transmits.the messages that it transmits.
–– For each of the messages, determine the next level ofFor each of the messages, determine the next level of
operators that are invoked and incorporate these into theoperators that are invoked and incorporate these into the
test sequencetest sequence
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 41
OOT Methods: Behavior TestingOOT Methods: Behavior Testing
empty
acctopen setupAccnt
set up
acct
deposit
(initial)
working
acct
withdrawal
(final)
dead
acct close
nonworking
acct
deposit
withdraw
balance
credit
accntInfo
Figure 14.3 St at e diagram f or Account class (adapt ed f rom [ KIR94] )
The tests to beThe tests to be
designed shoulddesigned should
achieve all stateachieve all state
coverage [KIR94].coverage [KIR94].
That is, theThat is, the
operationoperation
sequences shouldsequences should
cause thecause the
Account class toAccount class to
make transitionmake transition
through allthrough all
allowable statesallowable states
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net

More Related Content

Viewers also liked

Технология проблемного диалога как средство реализации ФГОС
Технология проблемного диалога как средство реализации ФГОСТехнология проблемного диалога как средство реализации ФГОС
Технология проблемного диалога как средство реализации ФГОС
El Mel
 
Cartilla investigacion de incidentes y accidentes de trabajo
Cartilla investigacion de incidentes y accidentes de trabajo Cartilla investigacion de incidentes y accidentes de trabajo
Cartilla investigacion de incidentes y accidentes de trabajo
andrea morales
 
Winter
WinterWinter
Winter
SEwelina
 
Pfc marketing
Pfc marketingPfc marketing
Pfc marketing
gianella81995
 
Alejandra castro lorena gonzalez
Alejandra castro lorena gonzalezAlejandra castro lorena gonzalez
Alejandra castro lorena gonzalez
Gloria Maritza Agudelo Mapayo
 
internet
internetinternet
Unit 2 analysis and software requirements
Unit 2 analysis and software requirementsUnit 2 analysis and software requirements
Unit 2 analysis and software requirements
Azhar Shaik
 
acciones preventivas para el control de derrames
 acciones preventivas para el control de derrames acciones preventivas para el control de derrames
acciones preventivas para el control de derrames
Heber Elio
 
Mesa redonda
Mesa redondaMesa redonda
Social CRM HAVAS
Social CRM HAVASSocial CRM HAVAS
Social CRM HAVAS
Jose Javier Diaz Garcia
 
Digestion and absorption of carbohydrates and proteins
Digestion and absorption of carbohydrates and proteinsDigestion and absorption of carbohydrates and proteins
Digestion and absorption of carbohydrates and proteins
enamifat
 
Comedor
ComedorComedor
Medio Ambiente
Medio AmbienteMedio Ambiente
Medio Ambiente
Mariad105
 

Viewers also liked (14)

Технология проблемного диалога как средство реализации ФГОС
Технология проблемного диалога как средство реализации ФГОСТехнология проблемного диалога как средство реализации ФГОС
Технология проблемного диалога как средство реализации ФГОС
 
Cartilla investigacion de incidentes y accidentes de trabajo
Cartilla investigacion de incidentes y accidentes de trabajo Cartilla investigacion de incidentes y accidentes de trabajo
Cartilla investigacion de incidentes y accidentes de trabajo
 
Winter
WinterWinter
Winter
 
Pfc marketing
Pfc marketingPfc marketing
Pfc marketing
 
Alejandra castro lorena gonzalez
Alejandra castro lorena gonzalezAlejandra castro lorena gonzalez
Alejandra castro lorena gonzalez
 
Meen a7an menak (2)
Meen a7an menak (2)Meen a7an menak (2)
Meen a7an menak (2)
 
internet
internetinternet
internet
 
Unit 2 analysis and software requirements
Unit 2 analysis and software requirementsUnit 2 analysis and software requirements
Unit 2 analysis and software requirements
 
acciones preventivas para el control de derrames
 acciones preventivas para el control de derrames acciones preventivas para el control de derrames
acciones preventivas para el control de derrames
 
Mesa redonda
Mesa redondaMesa redonda
Mesa redonda
 
Social CRM HAVAS
Social CRM HAVASSocial CRM HAVAS
Social CRM HAVAS
 
Digestion and absorption of carbohydrates and proteins
Digestion and absorption of carbohydrates and proteinsDigestion and absorption of carbohydrates and proteins
Digestion and absorption of carbohydrates and proteins
 
Comedor
ComedorComedor
Comedor
 
Medio Ambiente
Medio AmbienteMedio Ambiente
Medio Ambiente
 

Similar to SOFTWARE ENGINEERING UNIT 6 Ch14

Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
ShudipPal
 
Black box & white-box testing technique
Black box & white-box testing techniqueBlack box & white-box testing technique
Black box & white-box testing technique
SivaprasanthRentala1975
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
asifusman1998
 
Qm
QmQm
Software Testing
Software TestingSoftware Testing
Software Testing
Dr. ARUP ABHINNA ACHARYA
 
Quality Assurance
Quality AssuranceQuality Assurance
Quality Assurance
Kiran Kumar
 
SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13
Azhar Shaik
 
White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR Chandigarh
Pankaj Thakur
 
Testing
TestingTesting
Mining Assumptions for Software Components using Machine Learning
Mining Assumptions for Software Components using Machine LearningMining Assumptions for Software Components using Machine Learning
Mining Assumptions for Software Components using Machine Learning
Lionel Briand
 
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Lionel Briand
 
The Power of Probabilistic Thinking (keynote talk at ASE 2016)
The Power of Probabilistic Thinking (keynote talk at ASE 2016)The Power of Probabilistic Thinking (keynote talk at ASE 2016)
The Power of Probabilistic Thinking (keynote talk at ASE 2016)
David Rosenblum
 
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
NAVER Engineering
 
Testing of Cyber-Physical Systems: Diversity-driven Strategies
Testing of Cyber-Physical Systems: Diversity-driven StrategiesTesting of Cyber-Physical Systems: Diversity-driven Strategies
Testing of Cyber-Physical Systems: Diversity-driven Strategies
Lionel Briand
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
Kiran Kumar
 
Test Techniques
Test TechniquesTest Techniques
Test Techniques
nazeer pasha
 
Tool wear monitoring and alarm system based on pattern recognition with logic...
Tool wear monitoring and alarm system based on pattern recognition with logic...Tool wear monitoring and alarm system based on pattern recognition with logic...
Tool wear monitoring and alarm system based on pattern recognition with logic...
Nehem Tudu
 
Online and Offline Testing Of C-Bist Using Sram
Online and Offline Testing Of C-Bist Using SramOnline and Offline Testing Of C-Bist Using Sram
Online and Offline Testing Of C-Bist Using Sram
iosrjce
 
Using Diversity for Automated Boundary Value Testing
Using Diversity for Automated Boundary Value TestingUsing Diversity for Automated Boundary Value Testing
Using Diversity for Automated Boundary Value Testing
Felix Dobslaw
 

Similar to SOFTWARE ENGINEERING UNIT 6 Ch14 (20)

Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
 
Black box & white-box testing technique
Black box & white-box testing techniqueBlack box & white-box testing technique
Black box & white-box testing technique
 
11 whiteboxtesting
11 whiteboxtesting11 whiteboxtesting
11 whiteboxtesting
 
Qm
QmQm
Qm
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Quality Assurance
Quality AssuranceQuality Assurance
Quality Assurance
 
SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13
 
White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR Chandigarh
 
Testing
TestingTesting
Testing
 
Mining Assumptions for Software Components using Machine Learning
Mining Assumptions for Software Components using Machine LearningMining Assumptions for Software Components using Machine Learning
Mining Assumptions for Software Components using Machine Learning
 
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
 
The Power of Probabilistic Thinking (keynote talk at ASE 2016)
The Power of Probabilistic Thinking (keynote talk at ASE 2016)The Power of Probabilistic Thinking (keynote talk at ASE 2016)
The Power of Probabilistic Thinking (keynote talk at ASE 2016)
 
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
기계학습을 이용하여 정적 분석기의 안전성을 선별적으로 조절하는 방법
 
Testing of Cyber-Physical Systems: Diversity-driven Strategies
Testing of Cyber-Physical Systems: Diversity-driven StrategiesTesting of Cyber-Physical Systems: Diversity-driven Strategies
Testing of Cyber-Physical Systems: Diversity-driven Strategies
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
 
Test Techniques
Test TechniquesTest Techniques
Test Techniques
 
Tool wear monitoring and alarm system based on pattern recognition with logic...
Tool wear monitoring and alarm system based on pattern recognition with logic...Tool wear monitoring and alarm system based on pattern recognition with logic...
Tool wear monitoring and alarm system based on pattern recognition with logic...
 
Online and Offline Testing Of C-Bist Using Sram
Online and Offline Testing Of C-Bist Using SramOnline and Offline Testing Of C-Bist Using Sram
Online and Offline Testing Of C-Bist Using Sram
 
Using Diversity for Automated Boundary Value Testing
Using Diversity for Automated Boundary Value TestingUsing Diversity for Automated Boundary Value Testing
Using Diversity for Automated Boundary Value Testing
 

More from Azhar Shaik

Software engineering jwfiles 3
Software engineering jwfiles 3Software engineering jwfiles 3
Software engineering jwfiles 3
Azhar Shaik
 
Unit 7 risk
Unit 7 riskUnit 7 risk
Unit 7 risk
Azhar Shaik
 
Unit 6
Unit 6Unit 6
Unit 6
Azhar Shaik
 
SOFTWARE ENGINEERING UNIT 6 Ch22
SOFTWARE ENGINEERING UNIT 6 Ch22SOFTWARE ENGINEERING UNIT 6 Ch22
SOFTWARE ENGINEERING UNIT 6 Ch22
Azhar Shaik
 
Object oriented design-UNIT V
Object oriented design-UNIT VObject oriented design-UNIT V
Object oriented design-UNIT V
Azhar Shaik
 
Performing user interface design v
Performing user interface design vPerforming user interface design v
Performing user interface design v
Azhar Shaik
 
S.e material2 DESIGN ENGINEERING
S.e material2 DESIGN ENGINEERINGS.e material2 DESIGN ENGINEERING
S.e material2 DESIGN ENGINEERING
Azhar Shaik
 
Unit 4
Unit 4Unit 4
Unit 4
Azhar Shaik
 
Unit 3 requirements engineering processes
Unit 3 requirements engineering processesUnit 3 requirements engineering processes
Unit 3 requirements engineering processes
Azhar Shaik
 
Unit 3 system models
Unit 3 system modelsUnit 3 system models
Unit 3 system models
Azhar Shaik
 
Unit 2
Unit 2Unit 2
Unit 2
Azhar Shaik
 
S.e material
S.e materialS.e material
S.e material
Azhar Shaik
 
Unit 1 se
Unit 1 seUnit 1 se
Unit 1 se
Azhar Shaik
 

More from Azhar Shaik (13)

Software engineering jwfiles 3
Software engineering jwfiles 3Software engineering jwfiles 3
Software engineering jwfiles 3
 
Unit 7 risk
Unit 7 riskUnit 7 risk
Unit 7 risk
 
Unit 6
Unit 6Unit 6
Unit 6
 
SOFTWARE ENGINEERING UNIT 6 Ch22
SOFTWARE ENGINEERING UNIT 6 Ch22SOFTWARE ENGINEERING UNIT 6 Ch22
SOFTWARE ENGINEERING UNIT 6 Ch22
 
Object oriented design-UNIT V
Object oriented design-UNIT VObject oriented design-UNIT V
Object oriented design-UNIT V
 
Performing user interface design v
Performing user interface design vPerforming user interface design v
Performing user interface design v
 
S.e material2 DESIGN ENGINEERING
S.e material2 DESIGN ENGINEERINGS.e material2 DESIGN ENGINEERING
S.e material2 DESIGN ENGINEERING
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 3 requirements engineering processes
Unit 3 requirements engineering processesUnit 3 requirements engineering processes
Unit 3 requirements engineering processes
 
Unit 3 system models
Unit 3 system modelsUnit 3 system models
Unit 3 system models
 
Unit 2
Unit 2Unit 2
Unit 2
 
S.e material
S.e materialS.e material
S.e material
 
Unit 1 se
Unit 1 seUnit 1 se
Unit 1 se
 

Recently uploaded

Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 

Recently uploaded (20)

Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 

SOFTWARE ENGINEERING UNIT 6 Ch14

  • 1. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 1 Chapter 14Chapter 14 Software Testing TechniquesSoftware Testing Techniques www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 2. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 2 Testability:Testability: how easily a software can behow easily a software can be testedtested •• OperabilityOperability—— the better it works, the more efficiently it can be tested.the better it works, the more efficiently it can be tested. -- ItIt operates cleanlyoperates cleanly •• ObservabilityObservability——What you see is what you test. The results of each testWhat you see is what you test. The results of each test case are readily observed (clear and visible variables and statecase are readily observed (clear and visible variables and states, incorrects, incorrect output,output, ……)) •• ControllabilityControllability——the degree to which testing can be automated andthe degree to which testing can be automated and optimizedoptimized •• DecomposabilityDecomposability——testing can be targeted to independent modulestesting can be targeted to independent modules •• SimplicitySimplicity——reduce complex architecture and logic to simplify testsreduce complex architecture and logic to simplify tests •• StabilityStability——few changes are requested during testingfew changes are requested during testing •• UnderstandabilityUnderstandability——of the designof the design www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 3. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 3 What is aWhat is a ““GoodGood”” Test?Test? •• A good test has a high probability of finding anA good test has a high probability of finding an errorerror •• A good test is not redundant.A good test is not redundant. •• A good test should beA good test should be ““best of breedbest of breed”” (best(best between those with similar intent)between those with similar intent) •• A good test should be neither too simple norA good test should be neither too simple nor too complextoo complex www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 4. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 4 Test Case DesignTest Case Design "Bugs lurk in corners"Bugs lurk in corners and congregate atand congregate at boundaries ..."boundaries ..." BorisBoris BeizerBeizer OBJECTIVEOBJECTIVE CRITERIACRITERIA CONSTRAINTCONSTRAINT to uncover errorsto uncover errors in a complete mannerin a complete manner with a minimum of effort and timewith a minimum of effort and time www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 5. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 5 Exhaustive TestingExhaustive Testing loop < 20 Xloop < 20 X There are 10 possible paths! If we execute oneThere are 10 possible paths! If we execute one test per millisecond, it would take 3,170 years totest per millisecond, it would take 3,170 years to test this program!!test this program!! 1414 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 6. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 6 Selective TestingSelective Testing loop < 20 Xloop < 20 X Selected pathSelected path www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 7. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 7 Software TestingSoftware Testing Methods Strategies white-box methods black-box methods www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 8. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 8 WhiteWhite--Box TestingBox Testing ... our goal is to ensure that all... our goal is to ensure that all statements and conditions havestatements and conditions have been executed at least once ...been executed at least once ... www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 9. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 9 Why Cover?Why Cover? logic errors and incorrect assumptionslogic errors and incorrect assumptions are inversely proportional to a path'sare inversely proportional to a path's execution probabilityexecution probability we oftenwe often believebelieve that a path is notthat a path is not likely to be executed; in fact, reality islikely to be executed; in fact, reality is often counter intuitiveoften counter intuitive typographical errors are random; it'stypographical errors are random; it's likely that untested paths will containlikely that untested paths will contain somesome www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 10. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao Basic Path TestingBasic Path Testing •• Define a basic set of execution pathsDefine a basic set of execution paths •• Guarantee that every statement isGuarantee that every statement is executed at least onceexecuted at least once •• Using a logical complexity measure of aUsing a logical complexity measure of a procedural design and use it as a guide forprocedural design and use it as a guide for defining a basic set of execution pathdefining a basic set of execution path 10 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 11. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao Flow Graph NotationFlow Graph Notation •• A representation for control flow ofA representation for control flow of programprogram •• Each structured constructEach structured construct --> a flow graph> a flow graph symbolsymbol 11 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 12. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao Independent program pathIndependent program path •• Any path through the program that introduces atAny path through the program that introduces at least one new set of processing statements or aleast one new set of processing statements or a new condition.new condition. •• An independent path must move along at leastAn independent path must move along at least one edge that has not been traversed before theone edge that has not been traversed before the path is defined.path is defined. •• The basic set is not unique.The basic set is not unique. •• How do we know how many paths to look for?How do we know how many paths to look for? –– CyclomaticCyclomatic complexitycomplexity 12 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 13. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 13 Basis Path Testing:Basis Path Testing: CyclomaticCyclomatic ComplexityComplexity First, we compute the cyclomatic complexity: number of simple decisions + 1 (simple decisions: predicate node) or number of enclosed areas + 1 or E-N+2 (E number of edges, N number of nodes) In this case, V(G) = 4 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 14. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 14 CyclomaticCyclomatic ComplexityComplexity A number of industry studies have indicatedA number of industry studies have indicated that the higher V(G), the higher the probabilitythat the higher V(G), the higher the probability or errors.or errors. V(G)V(G) modulesmodules modules in this range aremodules in this range are more error pronemore error prone www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 15. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 15 Basis Path TestingBasis Path Testing Next, we derive theNext, we derive the independent paths:independent paths: Since V(G) = 4,Since V(G) = 4, there are four pathsthere are four paths Path 1: 1,2,3,6,7,8Path 1: 1,2,3,6,7,8 Path 2: 1,2,3,5,7,8Path 2: 1,2,3,5,7,8 Path 3: 1,2,4,7,8Path 3: 1,2,4,7,8 Path 4: 1,2,4,7,2,4,...7,8Path 4: 1,2,4,7,2,4,...7,8 Finally, we derive testFinally, we derive test cases to exercise thesecases to exercise these paths.paths. 11 22 33 44 55 66 77 88 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 16. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 16 Basis Path Testing NotesBasis Path Testing Notes you don't need a flow chart,you don't need a flow chart, but the picture will help whenbut the picture will help when you trace program pathsyou trace program paths count each simple logical test,count each simple logical test, compound tests count as 2 orcompound tests count as 2 or moremore basis path testing should bebasis path testing should be applied to critical modulesapplied to critical modules www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 17. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao Deriving test casesDeriving test cases •• Using the design or code, draw a flowUsing the design or code, draw a flow diagramdiagram •• Determine theDetermine the cyclomaticcyclomatic complexity ofcomplexity of the flow graphthe flow graph •• Determine a basis set of independentDetermine a basis set of independent pathspaths •• Prepare test cases to force the executionPrepare test cases to force the execution of each pathof each path 17 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 18. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 18 Graph MatricesGraph Matrices •• A tabular representation of a flow graphA tabular representation of a flow graph •• A graph matrix is a square matrix whose sizeA graph matrix is a square matrix whose size (i.e., number of rows and columns) is equal to(i.e., number of rows and columns) is equal to the number of nodes on a flow graphthe number of nodes on a flow graph –– Each row and column corresponds to an identifiedEach row and column corresponds to an identified node, andnode, and –– matrix entries correspond to connections (an edge)matrix entries correspond to connections (an edge) between nodes.between nodes. •• By adding aBy adding a link weightlink weight to each matrix entry,to each matrix entry, the graph matrix can become a powerful toolthe graph matrix can become a powerful tool for evaluating program control structure duringfor evaluating program control structure during testingtesting www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 19. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao •• Link weights can beLink weights can be –– The probability of execution of that edgeThe probability of execution of that edge –– The processing time for execution that edgeThe processing time for execution that edge –– The memory requiredThe memory required –– The resource requiredThe resource required •• Help to design test casesHelp to design test cases 19 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 20. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 20 Other Control Structure TestingOther Control Structure Testing •• Condition testingCondition testing —— a test case design methoda test case design method that exercises the logical conditions containedthat exercises the logical conditions contained in a program modulein a program module •• Data flow testingData flow testing —— selects test paths of aselects test paths of a program according to the locations ofprogram according to the locations of definitions (D) and uses (U) of variables in thedefinitions (D) and uses (U) of variables in the program (every DU chain be covered at leastprogram (every DU chain be covered at least once)once) •• Loop testingLoop testing –– focus on validity of loopfocus on validity of loop constructsconstructs www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 21. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 21 Loop TestingLoop Testing four different classes of loopfour different classes of loop NestedNested LoopsLoops ConcatenatedConcatenated LoopsLoops UnstructuredUnstructured LoopsLoops SimpleSimple looploop www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 22. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 22 Loop Testing: SimpleLoop Testing: Simple LoopsLoops Minimum conditionsMinimum conditions——Simple LoopsSimple Loops 1. skip the loop entirely1. skip the loop entirely 2. only one pass through the loop2. only one pass through the loop 3. two passes through the loop3. two passes through the loop 4. m passes through the loop m < n4. m passes through the loop m < n 5. (n5. (n--1), n, and (n+1) passes through1), n, and (n+1) passes through the loopthe loop where n is the maximum numberwhere n is the maximum number of allowable passesof allowable passes www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 23. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 23 Loop Testing: Nested LoopsLoop Testing: Nested Loops Start at the innermost loop. Set all outer loops to theirStart at the innermost loop. Set all outer loops to their minimum iteration parameter values.minimum iteration parameter values. Test the min+1, typical, maxTest the min+1, typical, max--1 and max for the1 and max for the innermost loop, while holding the outer loops at theirinnermost loop, while holding the outer loops at their minimum values.minimum values. Move out one loop and set it up as in step 2, holding allMove out one loop and set it up as in step 2, holding all other loops at typical values. Continue this step untilother loops at typical values. Continue this step until the outermost loop has been tested.the outermost loop has been tested. NestedNested LoopsLoops www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 24. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 24 Loop Testing: ConcatenatedLoop Testing: Concatenated LoopsLoops If the loops are independent of one anotherIf the loops are independent of one another then treat each as a simple loopthen treat each as a simple loop else* treat as nested loopselse* treat as nested loops endifendif** for example, the final loop counter value of loop 1 isfor example, the final loop counter value of loop 1 is used to initialize loop 2.used to initialize loop 2. Concatenated LoopsConcatenated Loops www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 25. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 25 BlackBlack--Box TestingBox Testing requirementsrequirements eventseventsinputinput outputoutput www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 26. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao •• Incorrect or missing functionsIncorrect or missing functions •• Interface errorsInterface errors •• Errors in Data structures or external dataErrors in Data structures or external data base accessbase access •• Behavior or performance errorsBehavior or performance errors •• initialization and termination errorsinitialization and termination errors 26 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 27. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 27 BlackBlack--Box TestingBox Testing •• How is functional validity tested?How is functional validity tested? •• How is system behavior and performance tested?How is system behavior and performance tested? •• What classes of input will make good test cases?What classes of input will make good test cases? •• Is the system particularly sensitive to certain inputIs the system particularly sensitive to certain input values?values? •• How are the boundaries of a data class isolated?How are the boundaries of a data class isolated? •• What data rates and data volume can the systemWhat data rates and data volume can the system tolerate?tolerate? •• What effect will specific combinations of data have onWhat effect will specific combinations of data have on system operation?system operation? www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 28. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 28 GraphGraph--Based MethodsBased Methods new file menu select generates (generation time < 1.0 sec) document window document tex t is represented as contains Attributes: background color: white text color: default color or preferences (b) object #1 Directed link (link weight) object #2 object # 3 Undirected link Parallel links Node weight (value ) (a) allows editing of To understand theTo understand the objects that areobjects that are modeled inmodeled in software and thesoftware and the relationships thatrelationships that connect theseconnect these objectsobjects In this context, weIn this context, we consider the termconsider the term ““objectsobjects”” in the broadestin the broadest possible context. Itpossible context. It encompasses dataencompasses data objects, traditionalobjects, traditional components (modules),components (modules), and objectand object--orientedoriented elements of computerelements of computer software.software. www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 29. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao Graph based testingGraph based testing •• Transaction flow modelingTransaction flow modeling •• Finite state modelingFinite state modeling •• Data flow modelingData flow modeling •• Timing modeling (sequence of executionTiming modeling (sequence of execution and its time)and its time) 29 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 30. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao Equivalence PartitioningEquivalence Partitioning •• Divides the input domain of a programDivides the input domain of a program into classes of data from which test casesinto classes of data from which test cases can be derived.can be derived. •• Define test cases that uncovers classes ofDefine test cases that uncovers classes of errorserrors 30 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 31. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao •• If an Input condition isIf an Input condition is –– A rangeA range •• One valid and two invalid equivalence classesOne valid and two invalid equivalence classes –– A specific valueA specific value •• One valid and two invalid equivalence classesOne valid and two invalid equivalence classes –– A member of a setA member of a set •• One valid and one invalid equivalence classesOne valid and one invalid equivalence classes –– BooleanBoolean •• One valid and one invalid equivalence classesOne valid and one invalid equivalence classes 31 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 32. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao Boundary value checkingBoundary value checking •• A greater number of errors occurs at theA greater number of errors occurs at the boundaries of the input domainboundaries of the input domain 32 www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 33. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 33 Comparison Testing (NComparison Testing (N--versioning)versioning) •• Used only in situations in which the reliability ofUsed only in situations in which the reliability of software is absolutely critical (e.g., humansoftware is absolutely critical (e.g., human-- rated systems)rated systems) –– Separate software engineering teams developSeparate software engineering teams develop independent versions of an application using theindependent versions of an application using the same specificationsame specification –– Each version can be tested with the same test dataEach version can be tested with the same test data to ensure that all provide identical outputto ensure that all provide identical output –– Then all versions are executed in parallel with realThen all versions are executed in parallel with real-- time comparison of results to ensure consistencytime comparison of results to ensure consistency www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 34. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 34 Orthogonal Array TestingOrthogonal Array Testing •• Used when the number of input parameters isUsed when the number of input parameters is small and the values that each of thesmall and the values that each of the parameters may take are clearly boundedparameters may take are clearly bounded •• Dispersed uniformly throughout the test domainDispersed uniformly throughout the test domain (balancing property)(balancing property) One input item at a time L9 orthogonal array XY Z X Y Z www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 35. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 35 OOTOOT——Test Case DesignTest Case Design BerardBerard [BER93] proposes the following approach:[BER93] proposes the following approach: 11.. Each test case should be uniquely identified and should be expliEach test case should be uniquely identified and should be explicitlycitly associated with the class to be tested,associated with the class to be tested, 2.2. The purpose of the test should be stated,The purpose of the test should be stated, 3.3. A list of testing steps should be developed for each test and shA list of testing steps should be developed for each test and shouldould contain [BER94]:contain [BER94]: a.a. a list of specified states for the object that is to be testeda list of specified states for the object that is to be tested b.b. a list of messages and operations that will be exercised asa list of messages and operations that will be exercised as a consequence of the testa consequence of the test c.c. a list of exceptions that may occur as the object is testeda list of exceptions that may occur as the object is tested d.d. a list of external conditions (i.e., changes in the environmenta list of external conditions (i.e., changes in the environment external to the software that must exist in order to properly coexternal to the software that must exist in order to properly conductnduct the test)the test) e.e. supplementary information that will aid in understanding orsupplementary information that will aid in understanding or implementing the test.implementing the test. www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 36. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 36 Testing MethodsTesting Methods •• FaultFault--based testing (same for conventional)based testing (same for conventional) –– The tester looks for plausible faultsThe tester looks for plausible faults •• aspects of the implementation of the system that may resultaspects of the implementation of the system that may result in defects.in defects. –– To determine whether these faults exist, test cases are designedTo determine whether these faults exist, test cases are designed to exercise the design or code.to exercise the design or code. •• Class Testing and the Class HierarchyClass Testing and the Class Hierarchy –– Inheritance does not obviate the need for thorough testing of alInheritance does not obviate the need for thorough testing of alll derived classes.derived classes. –– In fact, it can actually complicate the testing process.In fact, it can actually complicate the testing process. •• ScenarioScenario--Based Test DesignBased Test Design –– ScenarioScenario--based testing concentrates on what the user does, notbased testing concentrates on what the user does, not what the product does.what the product does. –– This means capturing the tasks (via useThis means capturing the tasks (via use--cases) that the user hascases) that the user has to perform, then applying them and their variants as tests.to perform, then applying them and their variants as tests. www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 37. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 37 OOT Methods: Random Testing class basedOOT Methods: Random Testing class based •• Random testing:Random testing: check class instance life historiescheck class instance life histories –– identify operations applicable to a classidentify operations applicable to a class –– define constraints on their usedefine constraints on their use –– identify a minimum test sequenceidentify a minimum test sequence •• an operation sequence that defines the minimum life history of tan operation sequence that defines the minimum life history of the class (object)he class (object) –– generate a variety of random (but valid) testgenerate a variety of random (but valid) test sequencessequences •• exercise other (more complex) class instance life historiesexercise other (more complex) class instance life histories Like for an instance of Account class: open, setup, depositLike for an instance of Account class: open, setup, deposit,, withdraw, close And open, setup, deposit, [deposit, withdraw,withdraw, close And open, setup, deposit, [deposit, withdraw, balance,balance, creditlimitcreditlimit], withdraw, close], withdraw, close www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 38. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 38 OOT Methods: PartitionOOT Methods: Partition TestingclassTestingclass basedbased •• Partition TestingPartition Testing –– reduces the number of test cases required to test a class inreduces the number of test cases required to test a class in much the same way as equivalence partitioning formuch the same way as equivalence partitioning for conventional softwareconventional software –– statestate--based partitioningbased partitioning •• categorize and test operations based on their ability to changecategorize and test operations based on their ability to change the state of a classthe state of a class –– attributeattribute--based partitioningbased partitioning •• categorize and test operations based on the attributes that theycategorize and test operations based on the attributes that they useuse •• For example: partition the operations according to their use/modFor example: partition the operations according to their use/modify/donify/don’’t use ort use or modify an attributemodify an attribute –– categorycategory--based partitioningbased partitioning •• categorize and test operations based on the generic function eaccategorize and test operations based on the generic function each performsh performs •• For example: operations can be categorized asFor example: operations can be categorized as initialization/computation/queries/terminationinitialization/computation/queries/termination www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 39. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 39 OOT Methods: InterOOT Methods: Inter--Class TestingClass Testing (During integration)(During integration) •• RandomRandom –– Like in class testingLike in class testing •• PartitioningPartitioning –– In (intraIn (intra--)class testing: state)class testing: state--based, attributebased, attribute--based,based, categorycategory--basedbased Here:Here: –– Partition according to messages which serve differentPartition according to messages which serve different classesclasses –– StateState--basedbased •• BehavioralBehavioral –– StateState--basedbased www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 40. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 40 OOT Methods: InterOOT Methods: Inter--Class TestingClass Testing (During integration)(During integration) •• RandomRandom –– For each client class, use the list of class operators toFor each client class, use the list of class operators to generate a series of random test sequences. The operatorsgenerate a series of random test sequences. The operators will send messages to other server classes.will send messages to other server classes. –– For each message that is generated, determine theFor each message that is generated, determine the collaborator class and the corresponding operator in thecollaborator class and the corresponding operator in the server object.server object. –– For each operator in the server object (that has beenFor each operator in the server object (that has been invoked by messages sent from the client object), determineinvoked by messages sent from the client object), determine the messages that it transmits.the messages that it transmits. –– For each of the messages, determine the next level ofFor each of the messages, determine the next level of operators that are invoked and incorporate these into theoperators that are invoked and incorporate these into the test sequencetest sequence www.jntuworld.com www.jntuworld.com www.jwjobs.net
  • 41. 3/18/20093/18/2009 S.Sreenivasa RaoS.Sreenivasa Rao 41 OOT Methods: Behavior TestingOOT Methods: Behavior Testing empty acctopen setupAccnt set up acct deposit (initial) working acct withdrawal (final) dead acct close nonworking acct deposit withdraw balance credit accntInfo Figure 14.3 St at e diagram f or Account class (adapt ed f rom [ KIR94] ) The tests to beThe tests to be designed shoulddesigned should achieve all stateachieve all state coverage [KIR94].coverage [KIR94]. That is, theThat is, the operationoperation sequences shouldsequences should cause thecause the Account class toAccount class to make transitionmake transition through allthrough all allowable statesallowable states www.jntuworld.com www.jntuworld.com www.jwjobs.net