430 likes | 1.06k Views
Petri Nets and Software Engineering. Anis Yousefi a_yousefi@ce.sharif.edu. We attempt to…. illustrate different dimensions of software engineering (SE), to point out aspects of Petri nets that can be exploited to solve SE problems
E N D
Petri Nets and Software Engineering Anis Yousefi a_yousefi@ce.sharif.edu
We attempt to… • illustrate different dimensions of software engineering (SE), to point out aspects of Petri nets that can be exploited to solve SE problems • present a design methodology that extends UML using colored Petri nets
Structure of our talk • Petri Nets and Software Engineering • Problem- vs. Solution- oriented disciplines • SE dimensions that can be supported by Petri nets • Why Petri nets? • limits of Petri nets in coping with SE problems • Verifiable Modeling Techniques Using a Colored Petri Net Graphical Language • UML and CPN • Orchestrate • Visio
Problem- vs. Solution- orienteddisciplines • problem-oriented disciplines : focus on problems and search for the best solutions regardless of the underlying methods or techniques • software engineering. • solution-oriented disciplines : focus on theory and offer it for different application domains • Petri net. • The meeting of problem- and solution-oriented disciplines can lead to important progresses in both areas!
Useful applications of Petri nets • Requirement engineering • Reverse engineering • Design of user interfaces • Modeling and analysis of safety critical systems • Distributed systems • Real time systems • Multimedia systems • Software process management • Software performance evaluation
Why Petri nets? • The ability of easily modeling concurrency and synchronization aspects • The intuitive graphic notation • The formal semantics that supports powerful analysis capabilities
Why Petri nets? (cont.) • The various extensions of Petri nets (in particular CPNs or, more generally, high-level Petri nets) are very useful for modeling many software engineering problems • Software engineering is dealing with new problems: pervasive computing, mobile applications, context awareness, … • The software engineering community is actively seeking new solutions and ideas to address these new problems. • Petri nets may provide useful support to some new challenges.
limitsof Petri nets in coping with software engineering problems • mastering complexity and size : Software engineers need flexible, adaptable and scalable modeling notations. • Petri nets, as many other formal methods, rarely provide the flexibility, adaptability, modularity and scalability required in software development. • But, hierarchy and object oriented extensions to add flexibility, adaptability and scalability, i.e., the modeling power needed for software engineers.
A Verifiable Modeling Technique Using ColoredPetri Net Graphical Language
Petri Nets for Specification and Verification • Software Engineers tend to use different modeling languages through the many phases of software development. • UML (Unified Modeling Language) is based on sets of modeling languages with different characteristics that is integrated in a unifying framework.
The Problem • The Unified Modeling Language(UML) cannot perform formal model verification. • Adding executable semantics to UML provides the formalisms required for automated verification. • We want to present a design methodology that extends UML by verifying software designs using a colored Petri net (CPN)
UML • UML : A language for specifying, visualizing, constructing, and documenting the artifacts of software systems, business modeling, and other nonsoftware systems. • Major drawback : • Its semantics are imprecise and vague (no executable semantics) Formal verification extremely difficult and expensive.
CPN • Petri net : A simple graphical model consisting of places, transitions, and arcs. • Well suited for : complex systems in which communication, synchronization, and resource sharing are important. • The graphical representations can be translated into mathematical models by which the graph’s semantics can be analyzed, using formal proofs. • CPNs allow the use of a variety of formal analytical techniques : • to prove properties (e.g., safety properties, deadlock) • to calculate performance measures (e.g., response times, waiting times).
CPN and UML • Major disadvantage : • Lack of commercially acceptable tools for developing Petri net models • Petri nets implemented with a standard interface can be used to extend UML capabilities overcoming UML’s lack of formalisms. • A drawing package + Orchestrate verification server(to verify and correct UML-based designs)
Orchestrate • Extends UML with formal modeling techniques based on CPNs • Allows systems to be designed informally in UML from inside the drawing package and then translated into a CPN for formal verification. • Implemented as a Web service and written in Java, the Orchestrate system provides a Web-server-based verification engine to client programs. • Any drawing package that is programmable and able to use Web services can work with Orchestrate as the graphical user interface (GUI).
Orchestrate (cont.) • Orchestrate is a server that verifies CPN models presented to it by clients and then returns the results of the verifications to the clients. • The CPN models submitted to Orchestrate are XML documents, as are the returned verifications. • Orchestrate does not provide a GUI. Instead, off-the-shelf drawing packages are used to provide the graphical semantics. • Visio 2000 • Visio’s key feature is support of a macro language capability that is used to translate the graphical designs into XML for submission to the Orchestrate server. • Visual Basic
Visio • Using Visio’s PetriNet.vss template and its built-in Visual Basic control program, system designers convert the visualization of the design into the executable semantics of a CPN, as described in eXtensible Markup Language/Simple Object Access Protocol (XML/SOAP) • The Visual Basic program in the drawing package transmits the XML description of the graphical design to the Orchestrate server, which validates it. • The Orchestrate server returns the results to the Visio program, which displays the verification status by modifying the colors of the objects of the diagram.
Visio (cont.) • Objects colored blue are valid CPN constructs; those colored red are invalid. The designer must revise the red paths until verification is completed. • While the designer works on the CPN model, the Orchestrate system automatically verifies each change in design and gives the user immediate feedback on potential flaws. • The designer continues to refine the model until the Orchestrate system verifies that it follows correct Petri net constructs.
Conversion of UML-based Design to CPN • To verify the UML-based design system, we must first convert the design to a CPN. • By hand! • The drawing package provides: • The drawing tools for the graphical semantics • Connects to the verification server.
Conclusions • The meeting of problem- and solution-oriented disciplines can lead to important progresses in both areas. • Petri nets have been successfully applied many times to several software engineering problems. • Translating UML-based diagrams into CPNs is not difficult and permits formal verification of UML-based designs.
Future Work • Extension for the Orchestrate system : • Automatically converting UML into formal models, such as Petri net diagrams. • Since Visio supports the diagramming of UML, it should be possible to translate UML-based designs into CPNs, thus extending UML to support formal verification techniques.
References • [1] Giovanni Denaro and Mauro Pezz`e, “Petri Nets and Software Engineering”, In: J. Desel, W. Reisig, G. Rozenberd Eds., Advances in Petri Nets Lecture Notes on Concurrency and Petri Nets, LNCS 3098 Springer-Verlag 2004. • [2] Ben M. Faul, “Verifiable Modeling Techniques Using a Colored Petri Net Graphical Language”, Technology Review Journal, Spring/Summer 2004.
“ Thanks for your attention! ” Questions?