Professional Documents
Culture Documents
KCC2013
KCC2013
KCC2013
net/publication/255173345
CITATIONS READS
0 4,271
4 authors, including:
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Muhammad Iqbal Hossain on 06 June 2014.
Abstract
Object-oriented paradigm has rapidly become the preferred model for system design by its
structuring mechanism. But Object oriented program causes dependency among the classes which
makes the testing procedure difficult. Although traditional testing techniques, based on UML diagram,
are used widely to test Object oriented program in isolation but the interaction between instances of
different classes has more importance. In this paper we propose different object interaction pattern
and generate test cases for each of the pattern using data flow among classes.
reference is created and shared among other objects. member function of Utility class. To sort the student,
Let’s consider the producer/consumer problem reference of Student class object passed to Utility
represented in Figure 1. class. After sorting Utility class return sorted Student
object to Lecture class. Through this interaction the
Class Producer Class Buffer data of Student class is also sorted.
Class Consumer
- buffer: Buffer - buf: LinkList
- semaphore - items, size + ID
- mutex - bufferSize - buffer: Buffer Student LectureClass Utility
- full, empty
+ Buffer() - Consumer()
+ regNo + title
- Producer() + remove() + run()
+ name + credit
+ run() + add() - sort(student)
- modify() - grading() - calc()
Figure 1. Object reference sharing
Figure 3. Object passing by parameter or return type
In this example, producer and consumer class share
a fixed-size Buffer class. One object produces item 4. Data flow Driven Test Strategy
and puts it in the buffer, while the other object
consumes item from the buffer. These objects do not In this section we present the test strategy for each
take turns accessing the buffer, they both work of the pattern described in section 3. Our main focus
concurrently. To interact with same Buffer object by is on the data flow information between the classes.
producer and consumer class, the reference of Buffer Usually Dataflow testing is based on definition-use of
object is used. object variables[4]. Therefore data flow testing can be
3.2 Object reference exchange used to find object behavior fault.
In dataflow testing an assignment to a variable of a
The reference of object can be exchanged between class is tested by executing sub paths from the
two classes. The references of objects are sending as definition to points where the variable is used[5]. But
a parameter between themselves. The object states for the interaction between classes, variables can be
are always updated and exchange current state of used or defined in public method of another class. So
data. Here the data flow between the classes is the data flow path should contain a inter class data
bidirectional. flow information. Usually class call graph, class
Class Hand
interaction diagram are generated to find the
Class Table sequence. We illustrate object interaction sequence
+ m_card: double
+ m_hands: list<hand>
- Hand(Table &t) for each of the pattern in Table 1.
- getCard() - addHand(Hand &h)
- setCard() - showHands() Table 1. Data flow and interaction sequence of object
- show()
6. Conclusion
In this paper, we have presented different object
interaction patterns and test strategies for the patterns.
We have shown three kinds of interaction pattern
between classes and generate data flow interaction
between classes according to the interaction pattern.
Finally data flow testing technique is used to generate
test cases. Interaction between classes is an important
issue while adding some new class in our system. By
acquiring the interaction pattern with other classes, it
is easily perform regression testing of the system. We
are investigating other object interaction patterns
between classes and reorganizing data flow testing
technique.