Examination CD5360 Software Engineering Course, 10P (Examination 4 Points) Datum: 2001-03-26, 8:30-13:30 Responsible: Ivica Crnkovic Max points: 40 Approved: Minimum 20 points Final Course Marks will be combined from the examination and the project: (40 points from examination + 40 points from the project) /2 5 34 40 4 28-33 3 20-27 Literature, own notes allowed Observe, please: Write your name and personal number on every sheet Write on one site of sheet only. The Swedish translation of the assignments is placed after the English text. Good luck! Software Engineering CD5360 1
Assignment 1 8 Points A company has started a project to develop a modest sized software product and has decided to use an incremental development model. The functional requirements for the product have been specified as 10 use cases, which have been assigned different priorities. The plan is to implement one use case at a time, thus producing 10 consecutive versions of the software, each providing more functionality than the previous. The project management has estimated the required effort as follows: Implementation of one use case requires two man-weeks before testing Test of one use case after implementation takes two man-days Corrections after testing require one man-day of implementation (average) Integration of each use case into the system takes 0.5 man-days The project has access to the following development resources: Five software developers Two software testers One system integrator a) Draw a Gantt chart showing an activity plan for the project and determine the calendar time required to implement all the use cases. Also, determine how much of their time (in average % per week) the testers and the integrator should work in the project. After exactly seven weeks, the first two use cases have been integrated, and it is realized that the activity plan is too optimistic. The project management revises the estimates as follows: Implementation of one use case requires three man-weeks Test of one use case after implementation takes four man-days The other estimates remain unchanged. b) Draw a new activity plan for the remainder of the project and determine how much of the intended functionality (how many use cases) can be implemented within the time limits of the first plan. Determine how much of their time the testers and the integrator should work in the project now. Software Engineering CD5360 2
Assignment 2 14 Points A telephone company has decided to implement an interactive web-based alternative to the telephone directory. Using this service, anybody with access to the Internet shall be able to browse and search the company s list of telephone customers to find their name, address, and phone number. In addition, it shall be possible for the customers listed in the directory to extend this information with their email- and webaddresses. To access this functionality, customers must authenticate themselves by supplying a password provided by the telephone company. The system must also handle updates of the directory by company staff. For security reasons, this shall not be done from the web-interface, but only from workstations within the company s internal network. a) Identify actors and use cases for the system described above and show them on a UML use case diagram. b) Give a brief description of each use case as a sequence of interactions between the system and the participating actors. (Error scenarios are not required) c) Propose a physical architecture for the system. Draw an informal diagram (alternatively a UML deployment diagram) and give a short description. d) Identify classes for realizing the central functionality of the system. Include principal methods and attributes. Show relationships on a UML class diagram. e) Draw UML sequence diagrams to illustrate the interactions within the system during execution of the most important use cases (at least 3 use cases). Software Engineering CD5360 3
Assignment 3 12 Points CR s 1 s 2 s A j A s 3 j B s B The figure above shows a train station with three railway tracks running through, but only one track leading to or from the station in either direction. The sensors s 1, s 2, and s 3 are used to detect whether a train is present on any of the three tracks inside the station, and the sensors s A and s B to detect whether a train is approaching from outside the station. The sensor signals are monitored in the station s control room (CR), where they are used to guide the operator who controls the switches at the junctions j A and j B. If, for example, s A signals that a train is approaching, s 1, s 2, and s 3 can be checked and j A operated such that the train is directed to an empty track. If none of the tracks are empty, the approaching train can be stopped by setting the stop signal at j A. If s A and s B indicate that trains are approaching from both sides at the same time, these can be directed to different empty tracks if possible, or one or both of them stopped otherwise. a) Construct a fault tree to analyze the risk of a train collision in the station as a result of sensor faults or an error made by the operator. Derive a cut-set tree from the fault tree and determine any single points of failure. b) Propose measures to reduce the risk of collision. Verify your solution by construction the same fault and cut-set trees for a station where these measures have been taken. Software Engineering CD5360 4
Assignment 4 6 Points For the benefit of students working hard and late, a vending machine is installed at the ground floor at IDt, offering candy bars and other snacks. The interface between the machine and a customer consists of the following: A slot where the customer can insert coins. A digital display where the customer s credit is continuously shown. A numerical keypad where the customer can enter a two-digit number to select which item to buy. There is also a key for canceling the purchase. Whenever the customer enters a number corresponding to an item that costs no more than the customer s current credit, the item is ejected by the vending machine, and the credit reduced accordingly. Any remaining credit is ejected when the customer presses the cancel key. Draw a UML state chart diagram for the vending machine described above. Mark the transitions with events, guards and actions as appropriate. HINT: You may find it useful to specify events and actions with arguments, such as inserted(value) and /deliver(itemno). Software Engineering CD5360 5
Uppgift 1 8 Poäng Ett företag har startat ett projekt för att utveckla en mindre mjukvaraprodukt och de har beslutat att använda sig av en inkrementell utvecklingsmodell (incremental development model). De funktionella kraven på produkten har specificerats genom 10 stycken användningsfall (use cases), vilka har tilldelats olika prioriteter. Avsikten är att implementera ett användningsfall per gång och därigenom utveckla 10 stycken versioner av produkten, där varje version erbjuder mer funktionalitet än den föregående. Projektledningen har gjort följande uppskattningar av tidsåtgången: Implementation av ett användningsfall kommer att kräva två manveckor före testning. Testning av ett implementerat användningsfall tar två mandagar. Korrektioner efter testning kräver en mandag för implementation (i genomsnitt). Integrering i systemet tar 0.5 mandagar för varje användningsfall. Projektet har tillgång till följande resurser: Fem mjukvarautvecklare Två mjukvaratestare En systemintegrerare c) Rita ett Gantt-schema (Gantt-chart) som visar en aktivitetsplan för detta projekt och avgör den kalendertid som behövs för att implementera alla användningsfallen. Avgör också hur mycket av deras tid (i medel, % per vecka) som testarna och integreraren behöver arbeta i projektet. Efter exakt sju veckor är de två första användningsfallen integrerade i systemet, och man inser då att aktivitetsplanen är för optimistisk. Projektledningen reviderar tidsuppskattningen till följande: Implementation av ett användningsfall kommer att kräva tre manveckor före testning. Testning av ett implementerat användningsfall tar fyra mandagar. Övriga uppskattningar förblir som förut. d) Rita en ny aktivitetsplan för det som är kvar av projektet och gör en uppskattning av hur mycket av den önskade funktionaliteten (hur många användningsfall) som man kommer att hinna med att implementera inom de ursprungliga tidsplanerna. Uppskatta också hur mycket tid som testarna och integreraren nu kommer att behöva arbeta i projektet. Software Engineering CD5360 6
Uppgift 2 14 Poäng Ett telefonbolag har tagit beslutet att implementera ett interaktivt webbaserat alternativ till televerkets telefonkatalog. Genom denna service kommer alla som har tillgång till en Internetuppkoppling att kunna utforska och söka i bolagets listor över telefonkunder, för att hitta namn, adresser och telefonnummer. Dessutom ska det vara möjligt för kunder som finns med i katalogen att utöka informationen om dem själva med deras e-post och webadresser. För att få tillgång till den här funktionaliteten måste kunden identifiera sig genom ett lösenord som kunden fått av telefonbolaget. Systemet ska också ha stöd för att bolagets personal ska kunna utföra uppdateringar av telefonkatalogen. Av säkerhetsskäl ska detta inte kunna göras genom webgränssnittet, utan endast direkt från en arbetsstation inom företagets interna nätverk. f) Identifiera olika aktörer och användningsfall i systemet som beskriv ovan, samt visa dessa aktörer i ett Use-case-diagram i UML. g) Ge en kortfattad beskrivning av ett användningsfall genom en sekvens av interaktioner mellan systemet och de inblandade aktörerna. (Scenarion för felaktig användning är inte nödvändiga). h) Ge förslag till en systemarkitektur (physical architecture) för detta system. Rita ett informellt diagram (alternativt ett Deployment diagram i UML) samt ge en kortfattad beskrivning. i) Identifiera klasser för att realisera den centrala funktionaliteten i systemet. Inkludera viktiga operationer och attribut. Visa relationer mellan dessa klasser i ett klassdiagram i UML. j) Rita ett sekvensdiagram i UML för att illustrera interaktioner inom systemet under exekveringen av de viktigaste användningsfallen (minst tre stycken användningsfall). Software Engineering CD5360 7
Uppgift 3 12 Poäng CR s 1 s 2 s A j A s 3 j B s B Figuren ovan beskriver en järnvägsstation med tre spår, men med två spår som leder in till stationen. Sensorerna s 1, s 2, och s 3 används för att veta om det finns ett tåg på något av de tre spåren inne på stationen, och sensorerna s A and s B för att veta när ett tåg närmar sig stationen. Sensorerna övervakas i stationens kontrollrum (CR), där de används av en operatör för att styra växlarna j A och j B. Om exempelvis s A signalerar att ett tåg närmar sig, kan s 1, s 2, och s 3 läsas av och j A ställas så att tåget leds in på ett tomt spår. Om samtliga spår är upptagna kan det ankommande tåget stoppas genom en stoppsignal vid j A. Om s A och s B indikerar att det kommer tåg från båda håll, ska de ledas in på olika spår om det är möjligt. I annat fall ska ett av dem, eller båda, stoppas. c) Konstruera ett felträd (fault tree) för att analysera risken för tågkollisioner på stationen till följd av fel på sensorer eller ett felaktigt beslut från operatören. Härled ett klippmängds-träd (cut-set tree) från felträdet och hitta samtliga enkelpunkts-fel (single points of failure). d) Föreslå åtgärder för att minska risken för kollisioner. Verifiera din lösning genom att konstruera motsvarande felträd och klippmängds-träd som i uppgiften ovan, men baserat på dina förslag. Software Engineering CD5360 8
Uppgift 4 6 Poäng För studenter som jobbar hårt och sent, finns det en varuautomat på IDt där man kan köpa godis av olika slag. Gränssnittet mellan maskinen och en kund består av följande delar: Ett myntinkast där kunden kan stoppa in pengar. En digital display som hela tiden visar hur mycket pengar som stoppats in. Ett numeriskt tangentbord där kunden kan ange vilken vara som önskas genom att knappa in ett tvåsiffrigt nummer. Det finns också en knapp för att avbryta ett köp. När en kund knappar in numret för en vara som inte kostar mer än mängden ilagda pengar, spottar maskinen ut ett exemplar av varan och mängden ilagda pengar reduceras. Om knappen för att avbryta trycks in ska hela kvarvarande summan returneras till kunden. Rita ett tillståndsdiagram (statechart diagram) i UML, för varuautomaten. Markera tillståndsövergångarna med lämpliga händelser (events), villkor (guards) och handlingar (actions). Ledtråd: I UML kan man specificera händelser och handlingar med argument, såsom inserted(value) och /deliver(itemno). Software Engineering CD5360 9