Formal Software Specification (UML Modelling)
March, 2007
1. Module Description
A product with sensors, actuators and network connections can offer an interesting, useful, or playful behavior to its users and to the other products, systems and services to which it is connected. The ID Master takes responsibility for the creation of this behavior. If the product isn’t stand-alone, neither is the designer. Whenever product behavior is realized through computer software and protocols, the designer takes advantage of being an excellent communicator in these matters. In present-day software engineering, the Universal Modeling Language UML has become widely accepted. It contains “activity diagrams”, “use case diagrams”, “class diagrams”, “state charts” and “message sequence charts”. The knowledge and skills that students get by participating in this module will help them to express the structure and behavior of the software components in their design in a way that is understood by third parties. Starting from elementary programming skills, which are a prerequisite, the student will develop an understanding and appreciation of what it means to master complexity. The scope is widened from small programs to real complex software systems. Although developing and maintaining such systems usually involves computer scientists as well, the ID Master will be well equipped to use UML and thus specify system structure and desired behavior.
Jun Hu, Loe Feijs and Philip Ross will work together to provide background information, explain UML and create a learning experience in which reading UML, writing UML, and creating software come together. A method of acting out will be applied in verifying the models and the specifications.
2. Schedule
All morning sessions start at 9:30AM.
== 26 March, morning ===
Introduction to Software Engineering, by Loe Feijs
Think Different: Object orientation, by Jun Hu
2.1. 26 March afternoon
Introduction to Use cases and Class Diagrams, By Jun Hu
- Exercise
- Use cases and class diagrams of a Zoo.
2.2. 27 March morning
Acting out, by Philip Ross
- Exercise
- Action out the diagrams of the Zoo.
2.3. 27 March afternoon
Introduction Sequence diagrams, activity diagram and state machine diagrams by Jun Hu
Introduction to the project: Zoo of Tamagotchi animals, by Jun Hu
2.4. 28 March morning
- Project: Zoo of Tamagotchi animals
2.5. 28 March morning
- Project: Zoo of Tamagotchi animals
2.6. 29 March afternoon
- Project: Zoo of Tamagotchi animals
- 3:00pm: Finalizing the specifications
- 5:00pm: Specification handover
2.7. 30 march morning
- Read the specification;
- Act it out;
- Look for problems.
2.8. 30 March afternoon
- The Show. Invite friends and families to the show.
- acting out the specifications;
- pointing out the design flaws;
- defending your designs;
- open discussions.
3. Exercise: Reverse engineering of a Zoo of animals
Students start with an existing Java implementation of a Zoo of animals. By running and reading the code, students gets their hands on the use cases, class diagrams and activity diagrams. Acting out is practiced to see whether the diagrams correctly presents the design concepts of the Zoo.
== Project: Designing and modeling a Zoo of Tamagotchi animals==
Based on the basic understand of OO design principles and the acting-out approach, a new Zoo is to be designed, modeled, specified and verified.
3.1. Format
Students are divided into teams. Every team gets the same task: Designing a system called Zoo of Tamagochi Animals:
- The first half of the project would be the teams making and specifying the OO design of the system;
- At the end of the first half of the project, the teams swap their specifications for implementation;
- The second half of the project would be implementing the specifications received.
You are not going to do real software implementations. You will implement the system by acting the specification out to show how the system should work according to the specification. You can play the objects, showing their behaviors and the communications in between. Stage props can be used to represent objects, interfaces, and events etc. Imagination and creativity are needed.
3.2. Zoo of Tamagotchi animals
A preliminary description of the requirement:
- All animals live in a zoo.
- An animal has got a life after it is born. While the life goes on, the animal moves and sleeps (if it is still alive), eats (if it moves and finds food), grows (if it eats) until one day, it dies because of hunger, illness or age.
- Every animal has got a body. Different animals look different because of their different bodies. Every animal has got two eyes and one mouth on its body. When eyes are pinched, animals scream and can be hurt.
- There are male and female animals. When grownup males and females meet, they may fall into love and the love may result in baby animals.
- Some animals are pets. Pets have names and they wear their name plates on their bodies. People (the users) take care of their pets and feed them with food.
- People may play with their pets to keep their pets fit.
- Some baby animals will be selected by people and they become pets. The rest are left free in the zoo and they have to strive for food and try to survive by themselves.
- When a zoo is created, it is empty, until people get some animals from somewhere else (from shops, for example).
- People may exchange their pet animals.
- Dogs and cats will be our favorite animals for the time being. Dogs bark and cats miaow. Cats are scared of dogs and can be bitten by dogs. When big dogs bark, cats scream and start running away. When big dogs fall into sleep, cats start getting together and partying.
- The zoo is open for other animals, including unknown ones. attachment:barkdifferent.jpg
4. Tools
- You will need the following software packages:
[http://w3.tue.nl/en/services/dienst_ict/organisatie/groepen/wins/campus_software/ms_visio/ Microsoft Visio 2003]
[http://www.phruby.com/stencildownload.html UML 2.0 stencils] from Pavel Hruby
5. Feedback to and from the teams
You have learnt the knowledge and skills that help to express the structure and behavior of the software components in their design in a way that is understood by involved parties. You have developed an understanding and appreciation of what it means to master complexity and to communicate it with engineers.
We appreciate that all the teams did their best to actively follow the lectures and practice with the exercises. The method of acting out the UML diagrams instead of implementing them using programming worked remarkably well, thanks to the efforts that all of you have put in the module.
Note that in one week of time, it is impossible to grasp every detail of UML and to make the diagrams perfect. Hence we are not going to give feedback on your diagrams here, except the comments that were given during your presentations. Again we would emphasize that there is no diagram that is absolutely right or wrong. A UML diagram is a good diagram if it helps to express what is in your mind. More accurate is better. More consistent is better. Whether it is a good design is yet another issue - but as all of you have found, the formal specifications of the zoo you made did help you to clarify the concepts and to find the design flaws.
As we have already pointed out, this model tries to give you some taste of a formal specification language (UML) and its use in a design process. The focus was not on the diagrams themselves. But we did not mean that you should not continue to explore object-oriented design and formal specification methods. As we all found out, combining formal specifications and acting out in design cycles (even small cycles in spiral design or agile design) can be a good method in a design process. To put this method into your collection of design gadgets (or in your designer's words, to get this method into your portfolio), you still need to learn more and practice more. Come back to us if you need any further help.
Your reflections on this module are published here. Read the comments you have got from the users of your diagrams – the team that acted out your diagrams. Read carefully what the others thought about your specifications:
- Team 1 (Stefania Nicolosi, Esra Günlü, Jeroen Berk, Ruud-Peter Lemmens):
- attachment:team1.pdf
- Team 2 (Fabian Koopman, Sander Kruitwagen, Marcel Verbunt, Thomas Visser , Carl Megens, Michel Peeters):
- attachment:team2.pdf
- Team 3 (We did not have team 3)
- Team 4 (Michel van der Hoek, Leoni Hurkx, Victor Versteeg, Benjamin Voss, Ralph Zoontjens):
- attachment:team4.pdf
- Team 5 (Sibrecht Bouwstra, Sander Kouwenberg, Bart-Jan van Putten, Jos Verbeek, Alice Verdonk):
- attachment:team5.pdf
- Team 6 (Pei-Yin Chao, Bas Groenendaal, John Helmes, Philip Mendels, Rik Wesselink, Mehmet Yalvac):
- attachment:team6.pdf