A Practical Approach For Model Based Slicing: Rupinder Singh, Vinay Arora
A Practical Approach For Model Based Slicing: Rupinder Singh, Vinay Arora
A Practical Approach For Model Based Slicing: Rupinder Singh, Vinay Arora
(CSED, Thapar University, Patiala, India) (CSED, Thapar University, Patiala, India)
Abstract : Software testing is an activity that will aim at evaluating an attribute or capability of system and
determine that whether it meets required expectations. Test cases can be designed at model level of software development. But to visualize the software model or architecture is difficult due to its large and complex structure. We have presented a novel methodology to extract the sub-model from model diagrams correspond to point of interest to ease the software visualization. The proposed methodology use the concept of model based slicing to slice the sequence diagram to extract the desired chunk. Keywords Software Testing, Sequence diagram, Model based slicing.
Software testing is an evaluation process to determine the presence of errors in code snippet. Software testing cannot completely test software because exhaustive testing is not possible due to time and resource constraints. According to ANSI/IEEE 1059 standard [1, 2], Testing can be defined as A process of analyzing a software item to detect the differences between existing and required conditions (that is defects/errors/bugs) and to evaluate the features of the software item. The prime objective of testing is to discover faults that are preventing the software in meeting customer requirements. Moreover, testing requires planning and designing of test cases. The testing process progresses from component level to system level in an incremental way. The most intellectually challenging part of testing is the design of test cases. Test case generation from design specifications has the added advantage of allowing test cases to be available early in the software development cycle. Now days, UML has been widely used for object oriented modeling and design. This is due to the fact that a UML metamodel extends support to describe structural and behavioral aspects of an architecture. For instance, the structural models (e.g. class diagrams) are used to describe various relations among classes, such as aggregation, association, composition, and generalization/specialization. On the other hand, the behavioral models (e.g., communication and sequence diagrams) are used to depict a sequence of actions in an interaction that describe how the objects are interacting to perform their respective action [3]. But due to large and complex architecture of software products its hard to visualize and test the software. To overcome this problem of visualization large models, Model based slicing technique came into existence. Model Based slicing is a decomposition technique to extract and identify relevant model parts (or fragments) or related elements across diverse model views. Slicing can be referring as process or strategy to break body of information into smaller parts to examine it from different viewpoints that can yield more precise information so that one can understand it better [35]. The term is also used to mean the presentation of information in a variety of different and useful ways to ease the visualization. But in term of automation of software testing, the direct use of UML diagrams is not feasible. Conversion of UML into XML is one of the integral part of model based slicing for automation of whole technique. The core principle of model based slicing technique is to decompose the structure into submodels without affecting their core structure and functionality. It helps the developer to gain the perfect view of software according to their requirement.
II.
RELATED WORK
In Model based slicing several types of model relations and dependency such as class-class, classoperation, operation-operation, class-object, object-object, guard condition in sequence diagram , conditional predicate, control flow , data flow etc., need to be taken into account as discussed in previous paper [34]. In this work, sequence diagram has been taken into account and various approaches present till date for slicing UML diagram have been listed. Zhao [4] introduced the concept of architectural slicing which operates on architectural description of software system. As an extension of his previous work Zhao [5] introduced Architectural Information Flow Graph with three types of information flow arcs: Component-connector, Connector-component, internal flow arcs to apply the slicing technique on software architecture precisely. Wang et.al [6] presented a method for slicing hierarchical automata. The importance of Wangs algorithm is its ability www.iosrjournals.org 18 | Page
www.iosrjournals.org
19 | Page
III.
Preliminary Work
We had proposed a method for extracting subpart from UML sequence diagram, based on conditional predicate in our previous work titled Technique for extracting subpart from UML Sequence diagram. This paper provides the detailed view on the practical implementation of the already proposed technique, for finding the chunk from a given sequence diagram.
IV.
After reviewing the literature of software testing techniques, slicing techniques, software visualization and unified modeling language, it has been analyzed that slicing UML diagrams is one of the major area in which work can be extended for various constructs like sequence diagram, state transition diagram, activity diagram, class diagram, etc. It has been thoroughly analyzed that for the process of slicing sequence diagram no consolidate technique have been developed to extract the point of interest from architecture of software to ease the software visualization that uses conditional predicate for finding out a relative slice. Consider an example UML sequence diagram as shown in figure: 1. the purpose of selecting this example is to demonstrate the concept of proposed methodology. In the example there are four objects which are interacting with each other thorough message passing (using guard condition as true to interact with each other). We illustrate our methodology by explaining the generation of chunk or refined model diagram with respect to slicing criteria. Here in this example let the slicing criterion is variable c. Given criteria is a variable used in conditional predicate of message guard condition. True and false value of these guard conditions are used by objects to interact with each other. According to user defined slicing criteria, proposed methodology will slice the model diagram shown in figure 1 and generate the resultant small chunk or refined sequence diagram.
www.iosrjournals.org
20 | Page
[a>20] message 1 [b>20] message 2 [d=10] message 3 [c-d>=0] message 4 [e<50] message 5
Fig 1: Example Sequence diagram To extract subpart from UML Sequence diagram following technique has been proposed: 1. Generation of UML (Sequence) diagram of/from a particular requirement specification. 1.1. Visual paradigm for UML, can be used to generate the UML diagram for specific requirement specifications. Figure 2 shows the designing of UML sequence diagram using visual paradigm tool.
II.
2.1. Visual paradigm for UML 10.0 version provides the in-built functionality to export the diagrams into XML format.
www.iosrjournals.org
21 | Page
III. Document Object Model (DOM) parser parse the XML code and generate an output file (with .txt extension) having Object name, identifier, message name, message to & fro information. Figure 4 shows the DOM parser and Figure 5 depicts the output file generated by DOM parser after parsing the XML file.
A practical approach for model based slicing IV. Passing file obtained from step 3 and slicing criteria to a .java program (which act as slicer) for getting the relative/required chunk of information in a separate .txt file.
4.1. Slicer will take .txt file generated in step 3 as input. 4.2. Slicer will ask user to define the slicing criteria at run time to generate the chunk/slice as per specified requirements as shown in figure 6. In this example user define the c variable as slicing criteria. 4.3. Computed slices will be store in separate .txt file which holds the information of messages, their guard condition and objects ids among which messages are being passed as shown in figure 7.
V.
5.1. To ease the retrieval of information, objects ids will be replaced with their corresponding object name (in the file retrieved from step 4.3) (as shown in figure 8.) 5.2. All the information will store in separate .txt file which holds the information of messages and the objects name (among which they are communicating relative to user defined slicing criteria). www.iosrjournals.org 23 | Page
Changing object id with relative object name among which message is passing so that information can be retrieved easily (this step will only deal with sliced part).
VI. Passing txt file as obtained from step 5, to b .java program so that it can be converted into input file format
Fig 9: Input file for quick sequence diagram editor VII. Tool will generate the final and relatively small sequence diagram. 7.1. Tool will take the input format defined at step 6 as input to convert into its equivalent diagram as shown in figure 10. 7.2. Refined slice (small sequence diagram) will be generated as final output according to slicing criteria as per requirement to ease the software visualization.
www.iosrjournals.org
24 | Page
REFERENCES
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] IEEE Standard 1059-1993, IEEE Guide for Software Verification and Validation Plans, IEEE, 1993. IEEE Standard 829-1998, IEEE Standard for Software Test Documentation, IEEE, 1998. Grady Booch, James Rumbaugh, Ivar Jacobson, The Unified Modeling Language User Guide, 2nd Edition, May 2005, Publisher. Addison Wesley. Jianjun Zhao, Slicing Software Architecture, Technical Report 97-SE-117, pp.85-92, Information Processing Society of Japan, Nov 1997. Jianjun Zhao, Applying slicing technique to software architectures, In Fourth IEEE International Conference on Engineering of Complex Computer Systems, ICECCS98, pp 87 98, 1998. J. Wang, Wei Dong, and Zhichang Qi, Slicing Hierarchical Automata for Model Checking UML Statechart, Proc. Fourth Intl Conf. Formal Eng. Methods: Formal Methods and Software Eng., pp. 435-446, Oct. 2002. H. Kagdi, J.I. Maletic, and A. Sutton, Context-Free Slicing of UML Class Models, Proc. 21st IEEE Intl Conf. Software Maintenance, pp. 635-638, 2005. S. Van Langehove, Internal Broadcasting to Slice UML State Charts: As Rich as Needed, Proc. Abstracts of the FNRS Contact Day: The Theory and Practice of Software Verification, Oct.2005. J. Lallchandani and R. Mall, Slicing UML Architectural Models, ACM SIGSOFT, vol.33, no.3 , May 2008. Jaiprakash T. Lallchandani, R. Mall, Static Slicing of UML Architectural Models, Journal of Object Technology, vol. 8, no. 1 , pp. 159-188, January-February 2009. J. Lallchandani and R. Mall, A Dynamic Slicing Technique for UML Architectural Models, IEEE Transaction on Software Engineering, Vol. 37, No. 6, NOV/DEC 2011. Philip Samuel, Rajib Mall, Slicing-Based Test Case Generation from UML Activity Diagrams, ACM SIGSOFT Software Engineering Notes, Vol. 34 No. 6, November 2009. Kunihiro Noda , Takashi Kobayashi, Kiyoshi Agusa, Shinichiro Yamamoto, Sequence Diagram Slicing, 16th Asia-Pacific Software Engineering Conference, IEEE, 2009. Ranjita Kumari Swain , Vikas Panthi, Prafulla Kumar Behera, Test Case Design Using Slicing of UML Interaction Diagram, 2nd International Conference on communication, computing and security, vol.6 , pp.136-144, ELSEVIR, 2012. Hyeon-Jeong Kim , Doo-Hwan Bae, Vidroha Debroy, W. Eric Wong, Deriving Data Dependence from UML State Machine Diagrams, Fifth International Conference on Secure Software Integration and Reliability Improvement (IEEE), 2011. Nisansala Yatapanage, KirstenWinter, and Saad Zafar, Slicing behavior tree models for verification, In IFIP Advances in Information and Communication Technology, Vol. 323, pp. 125139, 2010. B. Korel, I. Singh, L. Tahat, and B. Vaysburg, Slicing of State Based Models, Proc. Intl Conf. Software Maintenance, pp. 34 -43, 2003. Kevin Lano Crest, Slicing of UML State Machines, Proceedings of the 9th WSEAS International Conference on APPLIED INFORMATICS AND COMMUNICATIONS (AIC '09), 2009. Mathieu Acher, Philippe Collet, Philippe Lahire, and Robert France, Slicing feature models, In 26th IEEE/ACM International Conference On Automated Software Engineering (ASE11), IEEE/ACM, 2011. J. Julliand, N. Stouls, P-C. Bue, P-A. Masson, B model slicing and predicate abstraction to generate tests, Software Quality Journal, vol. 21, pp.127-158, 2013. Asadullah Shaikh, Robert Claris, Uffe Kock Wiil, and Nasrullah Memon, Verification-driven slicing of UML/OCL models, In Proceedings of the IEEE/ACM international conference on Automated software engineering, pp. 185 194, ACM, 2010. T. Kim, Y.-T. Song, L. Chung, and D.T. Huynh, Dynamic Software Architecture Slicing, Proc. 23rd Intl Computer Software and Applications Conf., pp. 61-66, 1999. T. Kim, Y.-T. Song, L. Chung, and D.T. Huynh, Software Architecture Analysis: A Dynamic Slicing Approach, J. Computer and Information Science, vol. 1, no. 2, pp. 91-103, 2000. Kevin Lano and Shekoufeh K. Rahimi, Slicing of UML Models Using Model Transformations, Model Driven Engineering Languages and Systems, 13th International Conference, MODELS 2010, Oslo, Norway, October 3 -8, 2010, Lecture Notes of Computer Science, Vol. 6395, pp. 228-242, Springer, 2010. Zoltn Ujhelyi, kos Horvth, and Dniel Varr, Towards dynamic backward slicing of model transformations, In 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011), pp.404 407, IEEE Computer Society, 2011. Zoltn Ujhelyi, kos Horvth, and Dniel Varr, Dynamic Backward Slicing of Model Transformations, IEEE Fifth International Conference on Software Testing, Verification and Validation, 2012. A. Blouin, B. Combemale, B. Baudry, O. Beaudoux, Modeling model slicers, Proceedings of the 14th international conference on Model driven engineering languages and systems, 2011. A. Blouin, B. Combemale, B. Baudry, O. Beaudoux, Kompren Modeling and Generating Model Slicers, Journal of Software and System Modeling, Springer, 2012. Mathieu Acher, Philippe Collet, Philippe Lahire, and Robert France. Separation of Concerns in Feature Modeling: Support and Applications. In Aspect-Oriented Software Development(AOSD12). ACM Press, 2012. Jung Ho Bae and Heung Seok Chae. UMLSlicer: A tool for modularizing the UML metamodel using slicing. In 8th IEEE International Conference on Computer and Information Technology (CIT), pages 772 777, 2008. Miao Chunyu and Zhao Jianmin. Dynamic slicing of statechart specifications for reactive systems. In Intelligent Computation Technology and Automation (ICICTA),volume 1, pages 110 116, 2011.
www.iosrjournals.org
25 | Page
www.iosrjournals.org
26 | Page