Deriving prototypes from UML 2.0 sequence diagrams Zbigniew Huzarr and Grzegorz Loniewskil Institute of Applied Informatics, Department of Computer Scicncc and Managcmcnt, Wroclaw Univcrsity of Technology, Poland zbigniew. huzar@pwr. wroc . p1, grzegorz . l-oniewski@student . plrr . wroc . pI Abstract. Executable prototypcs generatcd on early stages of software development bring many benefits, first of all they help to develop and validate systcm's spccification. The paper prcsents an approach to au- tomatic systcm prototype generation based on a collection of UML 2.0 scquerrce diagrams. In thc approach a set of sequcnce diagrams rcpresent- ing behavior of a specified systenr is transforrned into a state machirre and next a Java code is generated for the state machine. Thc trarrs- formatiorm arc described inforrnally by presentation of simplc examples. Architecture of the system implementing the transformation is briefly describcd. Keywords: Sequence diagram, statc machine, prototype, code gcncration Introduction Sequencediagrams are verv often used as behaviour specification of developed systcrrs. Thcy becorne very popular with advcnt of the UML specification lan- guagc. UML scquence diagrams were adopted from messagesequencecharts that wcre known already in other visual languages developed long ago by the Interna- tional Telecommunication Union. UML 2.0 also uses other diagrams to specify bchaviour, e.g. communication and collaboration diagrams. All those diagrams express similar all,hough not, identical information and show il, in a way dillerent from thc sequence diagrams. Sequcnce diagrams arc used to specify scenarios as sequences of messagespassing betwcen objects. A sequence diagram represents an interaction - a sct of communications among objects arranged visually in time order. They can exist in a descriptor form (describing all possible scenarios) and in an instance form (describing onc actual scenario). In thc paper wc deal with an instancc form only. Scquencediagrams have some practical limitations. Neverthclcss, they are used at vcry early stage of softwarc development for rapid but usually partial speci- fication of systern's bchaviour. For devclopers the most important factor should be quick validation of systetn's behaviour defined by a given set of sequencedi- agrams. Scquencc diagrams still have an informal scmantics, therefore the most