Presentation is loading. Please wait.

Presentation is loading. Please wait.

A given modeling and code generation framework Formalization of UML with Traceability Department of Computer Science & Engineering College of Engineering.

Similar presentations


Presentation on theme: "A given modeling and code generation framework Formalization of UML with Traceability Department of Computer Science & Engineering College of Engineering."— Presentation transcript:

1 A given modeling and code generation framework Formalization of UML with Traceability Department of Computer Science & Engineering College of Engineering Min Deng State-of-the-Art The Unified Modeling Language (UML) is the de facto object-oriented modeling language widely used in industry and academia. However, UML notations are not defined formally. Formalization is a process of giving formal semantics to UML notations by translating them into a target formal specification language (for example, Promela). Tool support for automatic code generation from UML diagrams  Code here refers to specifications  Enables automatic analysis of the UML diagrams The Code Distribution Problem The formalization of some UML features produces code that crosscuts the modular structure of the target language.  one UML feature is mapped to many non-contiguous lines of target- language code  one line of target-language code is mapped from many UML features Thus, it is not obvious how the UML features and target-language code are related. As a result, it is difficult to understand and thus validate the correctness of the implementation of a formalization. In addition, property specification and analysis of UML diagrams is aggravated by this problem. Providing Traceability for UML Formalizations Enables understanding and validation of correctness of the implementation of a formalization  Visualize the code distribution problem  Validate coarse-grained correctness such as employed communication protocols  Visualize fine-grained correctness such as semantics of individual UML features Aids in property specification, automatic property generation and analysis of UML diagrams Facilitates the impact analysis of different design decisions for a formalization Helps the interpretation of analysis results from supporting tools for target formal languages Our Approach and Status U-Banyan  A framework to provide traceability between UML diagrams and target-language code using views  A view is a relation between the elements in UML diagrams and elements in target-language code. Views keep references to elements in UML diagrams and target-language code. Thus, we are able to trace forward and backward.  Instantiated with forward traceability in our own UML-to-Promela formalization, and applied to validate the implementation of the formalization and analyze UML state diagrams. Future Directions Automate property and instrumentation code generation for analyzing UML diagrams Provide more advanced visualization capabilities  Explore backward traceability Further explore the applicability of traceability in the analysis of UML diagrams Apply our framework to more UML formalizations References William E. McUmber and Betty H.C. Cheng, “A general framework for formalizing UML with formal languages”, Proceedings of 23 rd IEEE International Conference on Software Engineering, May 2001 Betty H.C. Cheng, R.E.K. Stirewalt, Min Deng, and Laura Campbell, "Enabling Validation of UML Formalizations", MSU-CSE-03-20, July, 2003 The Unified Modeling Language Specification, http://www.uml.org Promela Language Reference, http://spinroot.com/spin/Man/promela.html Acknowledgements This work has been funded in part by NSF grants EIA-0000433, CDA-9700732, and CCR-9901017, Department of the Navy, Office of Naval Research under Grant No. N00014-01-1-0744, and Eaton Corporation, and in cooperation With Siemens Automotive and Detroit Diesel Corporation. Ovals represent states; arrows represent transitions Transitions are labeled by events Sample distributions  Transition on event f is translated into 6 different places in Promela (in red)  Transition on event e is translated into 4 difference places in Promela (in blue)  Composite state comp3 is translated into two blocks of code (in black boxes), first of which leads an if-fi statement and second of which is a process declaration, in Promela Code Distribution in a UML-to-Promela Formalization An Example UML State Diagram proctype comp3(mtype state) { int comp2_pid; int comp3_pid; mtype msg; int dummy; /* Init state */ init: goto two; /* State one */ one: if :: ex_q?e -> t?free; wait!_pid,st_four; goto exit :: ex_q?f -> t?free; wait!_pid,st_five; goto exit :: ex_q?g -> t?free; wait!_pid,st_five; goto exit fi; /* State two */ two: if :: ex_q?e -> t?free; wait!_pid,st_four; goto exit :: ex_q?f -> t?free; wait!_pid,st_five; goto exit :: ex_q?g -> t?free; goto three fi; /* State three */ three: if :: ex_q?h -> t?free; goto one :: ex_q?e -> t?free; wait!_pid,st_four; goto exit :: ex_q?f -> t?free; wait!_pid,st_five; goto exit fi; exit: skip } proctype comp2(mtype state) { int comp2_pid; int comp3_pid; mtype msg; int dummy; /* Init state */ init: goto to_comp3; /* State four */ four: skip; if :: ex_q?f -> t?free; wait!_pid,st_five; goto exit fi; /* Link to composite state comp3 */ to_comp3: comp3_pid = run comp3(msg); wait??eval(comp3_pid),msg; if :: msg == st_five -> wait!_pid,st_five; goto exit :: msg == st_four -> goto four fi; exit: skip } proctype comp1(mtype state) { int comp2_pid; mtype msg; int dummy; /* Init state */ init: goto to_comp2; /* Link to composite state comp2 */ to_comp2: comp2_pid = run comp2(msg); wait??eval(comp2_pid),msg; if :: msg == st_five -> goto five fi; /* State five */ five: skip; exit: skip } active proctype ex() { mtype m; bit dummy; int comp1_pid; /* link to environment */ run Environment(); /*Init state*/ initS: goto to_comp1; /* Link to composite state comp1 */ to_comp1: comp1_pid = run comp1(m); wait??eval(comp1_pid),m; exit: skip } Produced Code in the Promela Language Advisors: Dr. Betty H.C. Cheng & Dr. R.E. Kurt Stirewalt Software Engineering and Network Systems (SENS) Laboratory Monday, May 10, 2004 Why name our framework U-Banyan? U stands for UML Banyan is an East Indian fig tree. It can establish new roots from its branches, but you can always trace it back to the original tree. Sometimes the branching can become quite complex, but there is always traceability ex comp1 five comp2 four two threeone comp3 g hg e f Data Flow Diagram of U-Banyan 1.User draws a UML diagram so that the diagram objects are in memory 2.User draws the same UML diagram in a given modeling and code generation framework to produce the target-language code 3.The code is input to its parser so that the in-memory representation for the code is created 4.User inputs the UML diagram element to highlight, and a view object is constructed, which connects the element with the target-language objects implementing the element 5.The code corresponding to target-language objects is highlighted in the HTML representation Graphical editors for UML diagrams UML diagram objects Generator for View objects Construction of traceability links from view objects to target-language objects Graphical editors for UML diagrams Target-language objects Generator for producing HTML file Code generator for producing a formal language Parser for target-language code HTML representation of target-language code View objects Target-language code U-Banyan 1 2 3 4 5


Download ppt "A given modeling and code generation framework Formalization of UML with Traceability Department of Computer Science & Engineering College of Engineering."

Similar presentations


Ads by Google