Software Engineering 3 rd Bachelor Informatics Ahmed Lamkanfi October 15, 2009
1 Objective Get initial system design from specification Use Cases as requirements specification CRC Cards to create and validate design Role playing exercise
2 Example system E-Finance case: Basic banking services: current and savings accounts Private investments: buying and selling stocks Specified using Use Cases
3 Use Case model
4 Agenda Team building: ~5 persons per team Extract candidate classes from specification Role-playing scenarios Select Use Cases While playing the scenario: Extract responsibilities and collaborations Build hierarchies Assess the simulation, revise CRC cards Repeat until all scenarios go smoothly
5 A CRC card
6 Classes Look for noun phrases Derive candidate classes Distinguish: Core, irrelevant and undecided classes Attribute or class? Aliases?
7 Responsibilities Look for verb phrases Responsibilities = what instead of how What a class must know about itself What a class must be able to do Beware of: God classes: doing most of the work Mere data containers: doing practically nothing
8 Collaborations Responsibilities the class does not fulfill independently Clues for collaborations Client-server Dependencies Forcefully break up complex classes Move responsibilities to collaborators
9 Hierarchy Building Look for “kind-of” relationships Distinguish from “part-of” relationships! Extract common behavior Insert abstract classes if necessary Fill out subclass/superclass fields on cards
10 Role playing The core of CRC cards: Interactive review of the design Fosters shared meaning, common understanding Enacted system simulation Reading aloud, acting out Involves everybody in the team Experimental, playful technique
11 Questions for the review Are classes called frequently by same class? Is the responsibility in the right place? Are they really separate classes? Does every class have all necessary information to carry out its responsibilities? Do classes have responsibilities that never come into play? Have necessary classes been left out?
12 Use Case sets Basic banking services Open a current account Withdraw from a current account Deposit on an account Transfer between two accounts Process a deposit Process a withdrawal Process a transfer Process a charge Investment services Transfer between two accounts Open a custody account Place a direct order for a stock Place a limited order for a stock Execute put option Execute call option