You are on page 1of 8

International Journal of Engineering Research and Applied Science (IJERAS)

ISSN : 2349-4522
Vol. 1, Issue 1, 2014
All rights reserved by www.ijeras.org 24

Conditioned Slicing of UML Activity Diagram
Chandrakant Kumar Niraj
Department of Computer Science and Engineeering, KIIT University, Bhubaneswar, India.
email id: ckniraj@gmail.com

ABSTRACT: Activity Diagrams describe the flow of action and internal processing. The activity diagrams are
used to stable the gap between use-case diagrams and class diagrams. In this paper, we propose a conditioned
slicing algorithm of activity diagram. First, we propose an intermediate representation called conditioned slicing of
activity dependence graph (CSADG) to represent the UML activity diagram. The construction of CSADG is based
on the pre condition rule of activity diagram for conditioned slicing. Then, we propose an algorithm for
conditioned slicing of activity diagram using intermediate representation, which is useful in smooth business
processes and improving the efficiency of software.
Keyword: UML Activity diagram, Conditioned slicing, precondition rule.
1. INTRODUCTION
Program slicing was first introduced by Weiser [12, 13, 14], which was based on program observation and helpful in
program debugging. The computation of slicing of a program is based on slicing criterion <s,v>, where s is a
statement number and v is a variable used at s. Later, Object-Oriented (OO) programming language came in picture
with advantage over procedural programming such as data abstraction, encapsulation, inheritance, polymorphism.
Korel and Laski [18] was first to bring out the concept of dynamic program slicing. Various other slicing techniques
were described in the literature. One of the slicing technique was introduced by Canfora et al., [1] named
conditioned slicing. The conditioned slicing [3, 11] forms a bridge between static and dynamic slicing, which is
utilized for identifying those statements and predicates on some slicing criterion. Simply, with the time software
complexity increases, which creates a problem for managing the software. To understand the big-data, developers
needed more time, still complexity was present in the software.
In 1997, as the complexity still presents in software, the Object Management Group (OMG) was accepted the
Unified Modelling Language (UML) [16] as a visual modelling language, and widely being used for representing
and constructing the architectural models of software systems. UML 2.0 has two types of diagrams, one is static
diagrams and other is dynamic diagrams. One of the dynamic diagram is a state machine diagram, which has two
diagrams one is a state chart diagram and other is activity diagram. Very few literatures are reported on slicing of
activity diagram. The activity diagram of the UML architectural model represents the flow of control from one
activity to another such like as a flow chart. It is useful to interpret the business process flow more easily rather than
class diagram or other UML 2.0 diagrams.
2. REVIEW OF RELATED WORKS
In this section, we present the review of related work on conditioned slicing as well as architectural slicing.
First, Canfora et al., [1] have introduced a framework for conditioned slicing, which was based on program
statement deletion. The framework was based on the subsame relation, which forms a lattice of the slicing models.
Fox et al., [2] have introduced ConSIT (a conditioned slicing system) tool, which is based upon Conventional static
slicing. Symbolic Execution and Theorem proving. ConSIT architecture took program C for conditional slicing. It
was first fully automated implementation of conditioned slicing. Harman et al., [19] have proposed a technique
International Journal of Engineering Research and Applied Science (IJERAS)
ISSN : 2349-4522
Vol. 1, Issue 1, 2014
All rights reserved by www.ijeras.org 25

Pre/Post conditioned Slicing to analysis a program. This approach has an important use in software maintenance and
evolution. Stafford et. al., [5] reported a tool named Aladdin, which was based on static dependence analysis
technique. Stafford et.al. [6] report application of dependence analysis to software architecture descriptions. Zhao
[4] introduced a new dependence analysis technique, called architecture dependence analysis to support software
architecture development. Zhao has also presented a static architecture slicing technique [7]. Lallchandani and Mall
[9] have proposed technique for static slicing of an architectural model. Lallchandani and Mall [10] proposed a
dynamic slicing algorithm called Dynamic Slicing of UML Architectural Model (DSUAM) for the dynamic slicing
of UML architectural models. Ray et al., [8] have proposed Architectural Aspect-Oriented Dynamic Slicing
(AAODS) algorithm for computing dynamic slice of aspect-oriented based UML 2.0 sequence diagrams. Ray et al.,
[11] have used conditioned slicing for test case design through activity diagram. First, they have built a flow
dependence graph. And so, they have applied conditioned slicing on activity diagram for test case design.
The rest of this paper is organized as follows, Section 2 describes the related works on conditioned slicing as well as
a UML model slicing. Section 3 describes basic concepts of conditioned slicing and some definition which is used in
the entire work. Section 4 presents the construction of intermediate representations. Section 5 describes an algorithm
for conditioned slicing of UML activity diagram and then shows their working. Section 6 presents the comparison
with related works. Finally, Section 7 concludes this paper.
3. BASIC CONCEPTS AND DEFINITIONS
This section, we first present some basic concept and then definitions.
3.1 Conditioned Slicing
First, Canfora et al.,[1] have introduced the concept of conditioned slicing, which was based on statement deletion
and subsame relation. Later, many works are reported on conditioned slice. But , one reported work was on
conditioned slicing of activity diagram. In which, they have used flow dependence graph of activity diagram to
compute the conditioned slicing. In this approach, we have computed conditioned slicing of activity diagram on
some pre-condition rule. From Fig. 2, activity state node S1 to node S2 has to pre-condition rule: search by item
name on more than 500 items, node S2 to node S4 has pre-conditioned: only 70% discount items are available.
International Journal of Engineering Research and Applied Science (IJERAS)
ISSN : 2349-4522
Vol. 1, Issue 1, 2014
All rights reserved by www.ijeras.org 26


Figure 1: UML Activity Diagram of Online Shopping System
3.2 Control Flow Dependence Graph (CFDG)
The graph G(N,E) is a directed graph, n represents the activity state node, which shows the flow of control from one
node N to another. The edge E is used for joining the node N to node M. In Fig. 2 activity state node S1 is
connected with node S2 corresponding to Fig. 1. We have considered control dependence.
3.3 Conditioned Edge (Ce)
In a directed graph G (N, E), a condition edge represents the condition present in one activity state to another. In Fig.
2, the node S1 to node S2 is connected through an edge 1, which shows the dependence between nodes.
3.4 Conditioned Path (Cp)
It is used for representing the path from node N to node M in a directed graph G. In Fig. 2, one condition path is
starting from node S1 to node S20 as given below S1:S9:S10:S11:S12:S13:S14:S15:S16:S19:S20.
3.5 Slicing Criterion
Slicing criterion is triplet <S,V,Pc>, where S represents the activity state node and V represents the value or
message transfer from node one to another with a pre-condition rule Pc.

International Journal of Engineering Research and Applied Science (IJERAS)
ISSN : 2349-4522
Vol. 1, Issue 1, 2014
All rights reserved by www.ijeras.org 27


4. INTERMEDIATE REPRESENTATION
In this section,first, we describe the procedure for Node Creation and searching Conditioned Node. Then, we
describe the construction of Conditioned Slicing of Activity Dependence Graph (CSADG). In this approach, we
have considered an activity diagram of Online-Shopping system as an example, which is given in Fig. 1. In Fig. 1,
the online shopping system provides two activities, one is Search item by name and second is Browse. Browse has
again two methods, one is Browse by categories and the second is Offering Zone, which is added with a decision.
The following purposes of considering this module as an example,
1. Like a shot a day, Online shopping is more popular than Shopping in MALL.
2. This is usually less time consuming.
3. More options are available on one screen.
But, to accomplish these objectives, we cause a need to manage the system regularly that can be easily executed by
slicing. For a slicing, we have considered conditioned slicing approach, which forges a bridge between the two
extremes [11] of static and dynamic slicing rather than considering either static or dynamic slicing. From Fig. 1,
first, we have called Node creation procedure to construct the intermediate representation and then we added the
nodes through a control dependence edges. Finally, constructed intermediate representation is given in Fig.2.
4.1 Procedure for Node Creation
The node creation is based on the number of decision present in the UML activity diagram.
Node S.... Sn = Number of Decision
In Fig. 2, S represents the activity state node, which is added to node S1 through control flow edge. We have
considered only control dependence edge. Likewise, we have constructed the other nodes and stabled their
dependence through control flow edge.
International Journal of Engineering Research and Applied Science (IJERAS)
ISSN : 2349-4522
Vol. 1, Issue 1, 2014
All rights reserved by www.ijeras.org 28


Figure 2: The CSADG of the Figure 1.
4.2 Procedure for Searching Conditioned Node
The conditioned node selection is performed after the construction of intermediate representation CSADG.
1. Initialize S is a start node and Sn is a last node.
2. Cn must satisfy the pre-condition rule.
2. for (S Sn)
3. if S= Cn then,
4. Mark this node
5. Else, go to the next node (S1 Sn)
6. exit

International Journal of Engineering Research and Applied Science (IJERAS)
ISSN : 2349-4522
Vol. 1, Issue 1, 2014
All rights reserved by www.ijeras.org 29

In this approach, we have considered an activity diagram of Online-Shopping system as an example, which is given
in Fig. 1. In Fig. 1, the online shopping system provides second activities, one is Search item by name and second is
Browse. Browse has two parts, one is Browse by categories and the second is Offering Zone, which is added with a
decision.
5. CONDITIONED SLICING OF UML ACTIVITY DIAGRAM
This section describes the Conditioned Slicing of UML Activity Diagram (CSUAD) algorithm. Next, we present the
working of CSUAD algorithm.
5.1 Algorithm: Conditioned Slicing of UML Activity Diagram (CSUAD) algorithm
Phase 1: Initialization
a. Create node from S to Sn corresponding to Activity state.
Phase 2: Constuct CSADG statically once
a. Add control flow edges between Nodes (S.. Sn).
b. Call Node creation procedure
Phase 3: Runtime Updation
a. Call Search Conditioned Node procedure
b. Conditioned Slice= Slice with respect to Slicing criterion<S,V,Pc>
c. Display (Conditioned Slicing)

5.2. Working of CSUAD algorithm
We have considered a UML activity model of Online Shopping system as an example. Our proposed algorithm
CSUAD is divided in 3-Phases. Phase-1 represents the minimum requirement for conditioned slicing of the UML
activity diagram. Phase-2 describes the construction of intermediate representation and Phase-3 shows the runtime
updating. Fig. 2 represents intermediate representation for conditioned slicing. First, we have defined pre-condition
rule, in which slicing criterion consists triplet (S, V, Pc).
We state that,
Pc = Item Search by name
International Journal of Engineering Research and Applied Science (IJERAS)
ISSN : 2349-4522
Vol. 1, Issue 1, 2014
All rights reserved by www.ijeras.org 30


Figure 3: Conditioned Slicing of UML activity diagram w.r.t slicing criterion <S20, Item, Search by name>
Now, let us suppose that, we have to compute the conditioned slicing for slicing criterion <S20, Item, Search by
name>. In Fig. 2, for node S20, the affacted nodes are S2: S9: S10: S11: S12: S13: S14: S15: S16: S19: S20. The
conditioned slicing of UML activity diagram is present in Fig.3. In phase-2 of algorithm, we have constructed the
intermediate representation, which is represented in Fig.2. In Phase-3 of algorithm, first we have selected a
Conditioned node through Conditioned Node Searching procedure and then slice with respect to slicing criterion.
6. COMPARISON WITH RELATED WORKS
In this section, we present the comparison with related works. Ray et al., [11] have used conditioned slicing for test
case design through activity diagram. First, they have built a flow dependence graph. Then, they have applied
conditioned slicing on activity diagram for test case design. In this approach, they [11] have used flow dependence
for test case generation, but we have used our approach for other application area of software engineering. None of
other works are directly reported conditioned slicing of activity diagram, in the absence of direct works, we compare
our proposed algorithm with other algorithms for computing dynamic slicing of UML models [9,10,15]. Stafford
et.al., [6] were introduced the application of dependence analysis to software architecture, then Zhao [4] introduced
architecture dependence analysis to support software architecture development. Zhao has also introduced a static
architecture slicing technique [7]. Afterwards, Kim [17] presented an architectural slicing technique called dynamic
software architecture slicing (DSAS). Lallchandani and Mall [9,10] have proposed technique for static and dynamic
International Journal of Engineering Research and Applied Science (IJERAS)
ISSN : 2349-4522
Vol. 1, Issue 1, 2014
All rights reserved by www.ijeras.org 31

slicing of an architectural model. Ray et al., [8] have proposed Architectural Aspect-Oriented Dynamic Slicing
(AAODS) algorithm for computing dynamic slice of aspect-oriented based UML 2.0 sequence diagrams. All the
above reported works are on the slicing of UML model, but they have not considered the conditioned slicing
approach.
7. CONCLUSION
We have proposed a conditioned slicing technique of the UML activity diagram. First, we construct an intermediate
representation named it CSADG. The pre-conditioned is defined in the UML activity diagram. Then, we propose an
algorithm for conditioned slicing of the UML activity diagram. Our approach is applicable for software
management.
REFERENCE
[1] G. Canfora, A. Cimitile, and A. Lucia. Conditioned program slicing. Information and Software Technology, 40: pp. 595-607, 1998
[2] C.Fox, M.Harman, and R.M.Hierons. ConSIT: A Conditioned Program Slicer. In International Conference on Software Maintenance (ICSM),
pp. 216-226, 2000.
[3] S. Danicic, D. A. Lucia, and M. Harman. Building Executable Union Slices using Conditioned Slicing, 2004.
[4] J. Zhao. Using dependence analysis to support software architecture understanding, CoRR, vol. cs.SE/0105009, 2001.
[5] J. Stafford, D. Richardson, and A. Wolf, Aladdin: A tool for architecture-level dependence analysis of software systems, University of
Colorado, Dept. of Computer Science, Tech. Rep. CU-CS-858-98, April 1998.
[6] J. Stafford, A. Wolf, and M. Caporuscio, The application of dependence analysis to software architecture descriptions, In Lecture Notes in
Computer Science, vol. 2804, 2003, pp. 5262.
[7] J. Zhao, Slicing software architectures, Information Processing Society of Japan (IPSJ), Tech. Rep. 97-SE-137, November 1997.
[8] A. Ray, S. Mishra, and D.P.Mohapatra. Architectural Aspect-Oriented Dynamic Slicing. In Infosys Labs Briengs, volume 11, 2013.
[9] J. T. Lallchandani and R. Mall. Static Slicing of UML Architectural Models. Journal of Object Technology,8(1) pp.159-188, 2009.
[10] J. T. Lallchandani and R. Mall. A Dynamic Slicing Technique for UML Architectural Models. IEEE Transactions on Software Engineering,
37(6), December 2011.
[11] M. Ray, S. Barpanda, and D. Mohapatra. Test Case Design using Conditioned Slicing of Activity Diagram. International Journal of Recent
Trends in Engineering, Vol-1, No-2, 2009
[12] Weiser, M. Program slicing. In Proceedings of the 5th International Conference on Software Engineering (ICSE) (Piscataway, NJ, USA,
1981), IEEE Press, pp. 439-449. 1981
[13] Weiser, M. Programmers Use Slices with Debugging. Communications of the ACM, pp. 446-452. 1982
[14] Weiser, M. Program slices: formal, psychological, and practical investigations of an automatic program abstraction method. PhD thesis,
University of Michigan, Ann Arbor, MI.
[15] Larsen, L., and Harrold, M. J. Slicing object-oriented software. In Proceedings of 18th International Conference on Software Engineering,
pp. 495-505. 1996
[16] Rumbaugh, J., Jacobson, I., and Booch, G. The Unified Modeling Language Reference Manual. ADDISON-WESLEY, 1998.
[17] Kim, T., Song, Y., Chung, L., and Huynh, D. T. Software architecture analysis: a dynamic slicing approach. ACIS Int. J Comp. Inf. Sci. 1,
91-103. 2000.
[18] Korel, B., and Laski, J. Dynamic Program Slicing. Information Processing Letters 29, 9 ,pp. 155-163. 1988
[19] M.Harman, R.M.Hierons, C.Fox, and J.Howroyd. Pre/Post conditioned Slicing. In International Conference on Software Maintenance
(ICSM), pp. 138-147, 2001.