Homework Sheet ALL Solutions PDF

Title Homework Sheet ALL Solutions
Author Tobi Rode
Course Einführung in die Softwaretechnik (IN0006)
Institution Technische Universität München
Pages 35
File Size 2.3 MB
File Type PDF
Total Downloads 53
Total Views 143

Summary

Prof. Bernd Brügge, Ph. D.Introduction to Software Engineering (SS2018)Discussed in the tutor groups between Monday, April 23 and Friday, April 27Homework Sheet 01 - Example Solution[10 points]Please note: Other answers might be correct as well. This is a sample solution! What is the difference betw...


Description

Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

Discussed in the tutor groups between Monday, April 23 and Friday, April 27

 

Homework Sheet 01 - Example Solution [10 points] Please note: Other answers might be correct as well. This is a sample solution! 1. • • •

2.

What is the difference between a functional model, an object model and a dynamic model? [1 point] The functional model describes the functions of the system. The object model describes the structure of the system in terms of entities (classes and packages) and their associations. The dynamic model represents how the system reacts to external events. It describes the event flow of the system.

Explain why software development is difficult. [1 point]

Software development can be difficult for multiple reasons. • The problem is ambiguous • Requirements are unclear and change • The problem domain and solution domain are complex • The development process is difficult to manage • Software is extremely flexible, i.e. almost anything of the software design can be changed • Software is a discrete system, i.e. hidden surprises can come up 3.





Why does change happen in software development? Provide examples from your own experience and discuss them in the 3 areas of requirements changes, technology changes and organization change. [4 points] Requirements change throughout the project, e.g. the customer changes their mind or requirement turns out to be unfeasible • Example 1: during the construction of the Berlin Airport, the requirement of a handling facility for large aircrafts emerged, which led to additional costs and resources • Example 2: the EIST instructors change their minds about how the player can steer their car (using a mouse is just too boring) and now require you to implement voice commands to steer the player’s car instead Technologies change, e.g. new releases, updates • Example 1: since the first release of the Bluetooth specification in 1999, the requirements of mobile devices changed. Manufacturers started to incorporate 

Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

Discussed in the tutor groups between Monday, April 23 and Friday, April 27

 



4.





5. • • • •

Bluetooth in their devices, which lead to the expectation, that all mobile devices incorporate the Bluetooth specification in order to exchange data via short distances • Example 2: since updating Bumpers to JDK 10, the AudioPlayer is outdated and has to be refactored. For instance, the AudioPlayer can only play .au and .wav files, but should also support .mp3 files Organizational changes, e.g. laws, recruitment • Example 1: WhatsApp was bought by Facebook, therefore new company legal requirements and processes had to be incorporated or replaced the old ones • Example 2: the EIST instructors decide to add 10 more tutor groups and now all the students have to be re-distributed among the tutor groups

Explain the differences between programming and modeling (source code vs. model)." [2 points] The purpose of modeling is to reduce complexity by building a simplified representation of reality which ignores irrelevant details. Typically, software developers use UML. UML is a language that allows to specify models across development phases (analysis, system design, object design) with a single language. Programming is the task of mapping a model written in a language such as UML (sometimes even pseudo code) to a program written in a language such as Java, C+ +, C#, Python, Swift, etc. Explain the differences between a model, a view and a system. [2 points] A system is a set of communicating parts A model is an abstraction describing a system in a modeling language such as UML A view depicts selected aspects of a model in a specific notation such as use cases, class diagrams, text, graphic pictures, ... Example: an airplane is a system, which can be described by a flight simulator (model), and views are the blueprint of the airplane, or the electrical wiring diagram of the airplane



Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, April 30 and Friday, May 04

 

Homework Sheet 02 [18 points] - Sample Solution In the lecture Mini Intro to Software Engineering on April 19, we finished Sprint 01 of Bumpers. Your homework is to implement Sprint 02 and Sprint 03 described below. Please note: This homework consists of Part I and II. Solve PART I and Question 3 in PART II on ArTEMiS. Push your submission to the repository. Submit questions 1 and 2 of PART II in PDF format. If you used pencil and paper, then take a picture, convert it to PDF, and upload your picture into Homework Submission 02 in Moodle. Deadline for Submission: Sunday April 29, 11:55 pm

PART I Two sprint backlog items of Sprint 02 have already been implemented: 03. Cars collide with each other and each collision has a winning car 08. The player steers the car with the mouse Please take a look at the lecture slides 86-96 for a detailed explanation. [2 points]

In order to finish Sprint 02, your task is to implement sprint backlog item 13:

13. A crash sound and/or animation plays when two cars collide Start the exercise EIST 2018 Lecture 02 Bumpers Sprint 02 on ArTEMiS. Clone the repository and import the project into Eclipse. Implement the given tasks (TODOs in the code), commit and push your solution, and review your results on ArTEMiS. Hint: Use the moveCars() in GameBoard.java to play a bang sound when two cars crash. [2 points] Additional challenge: Configure your own sound. In order to add a new sound, drag and drop your own audio file into the resources folder. Make sure to use an .au or .wav file, as .mp3 files are not supported. Then, modify the AudioPlayer’s BANG variable to use your audio file instead. For PART I, you can find a detailed solution in Lecture 02, slides 97 - 100. In addition, here is also the updated object model and the solution code.



Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, April 30 and Friday, May 04

  Audio Player

GameBoardUI size setupGame() paint() paintCar() steerCar()

playBangAudio() playBackgroundMusic() stopBackgroundMusic() isPlayingMusic()

GameBoard

Car icon

startGame() stopGame() playMusic() stopMusic() moveCars()

Player

Collision

2

winningCar

collide() drive()

FastCar

detectCollision() evaluate()

SlowCar

Java Code: public class GameBoard { //... public moveCars(){ if(collision.isCollision) { Car winner = collision.evaluate(); System.out.println(winner); audioPlayer.playBangAudio(); //... } //... } //... }!



Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, April 30 and Friday, May 04

 

PART II Sprint 03 includes the following backlog items: 07. The game supports different car types! Hints: • Fast and slow cars are already supported, come up with at least one more car type. Remember to add new pictures too! 12. Collisions follow the “right before left” rule, and thus right-most cars win the collisions! Hints: • The loser car is crunched and stops driving • The player gets notified when he looses or wins the game 15. Implement a new type of collision as subclass from the class “Collision”, be creative!! If you need inspiration, here are a couple of examples: • The winner has to hit the car twice • The winner is the car from the top • Handle cars like a wave Similar to the lecture, start with updating the models according to the new requirements and then implement the new features. 1.

[2 points] Update the functional model (UML Use Case Diagram) of Bumpers with the following requirements:" In the future, when starting the game, the player can choose … • … the type of their car • … the collision type

2.

[4 points] Update the analysis object model (UML Class Diagram) of Bumpers with classes, attributes, and associations for the backlog items of Sprint 3.

3.

[10 points] Start the exercise EIST 2018 Lecture 02 Bumpers Sprint 03 on ArTEMiS. Clone the repository and import the project into Eclipse. Implement the given tasks (TODOs in the code), commit and push your solution, and review your results on ArTEMiS.#



Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, April 30 and Friday, May 04

 

Sample Solution: 1. Updated Functional Model

2. Updated Analysis Object Model

3. Implementation of Sprint 03 You can find one sample solution on " https://repobruegge.in.tum.de/projects/EIST2018L02BUMPERSS03/repos/eist2018-l02-bumpers-sprint03-solution



Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, May 07 and Friday, May 11

 

Homework Sheet 03 [20 points] - Sample Solution Deadline for Submission: Sunday May 06, 11:55 pm Requirements Analysis for Bumpers Read again the problem statement of Bumpers and review the artifacts that we already have created to solve the following exercises. Make sure that your solution is consistent and complete. 1.

[3 points] Define the functional requirements for the Bumpers game.

Examples: 1. Start Game: The system shall support starting the game 2. Stop Game: The system shall support stopping the game. 3. Drive Car: The system supports autonomous cars that drive on their own and a car steered by the user. 4. Crash Car: The system determines a collision of two cars. 5. Determining a Winner: The system determines the winner of the game. 6. Present a dialog window that notifies the winner or loser of the game.

2.

[3 points] Define quality requirements for the Bumpers game using the URPS categories.

Examples: 1. Portability: Bumpers can be moved from iOS to Android 2. Usability: Bumpers can be played without reading a user manual 3. Reliability: Bumpers should not crash more than 1 out of 1000 executions. 4. Performance: The game board should support an update of 25 frames per second. 5. Performance: The cars direction should be changeable within 1/10 sec after steering. 6. Maintainability: Bumpers must be re-designable to a client-server architecture. 7. Adaptability: As Bumpers must support North Americas and European markets, that means it must support metric and imperial systems.



Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, May 07 and Friday, May 11

 3.



[4 points] Create 2 scenarios for the Bumpers game. Use an as-is scenario and a visionary scenario. In the visionary scenario, include functionality that was not addressed in the original problem statement in Lecture 02.

As-is scenario: Use case name

Win Collision

Participating actors

Alice: Player

Entry conditions

1. Bumpers game has started, and the user car (UC1), and the Autonomous Car (AC1) are driving. 2. Bumpers knows the position, direction and speed of the UC1, and AC1.

Flow of events

1. 2. 3. 4.

Exit conditions

AC1 speed is set to 0.

Special requirements

There are no collision ties.

Alice steers the UC1 in the direction of the AC1. The UC1 approaches AC1 from below. Bumpers detects a collision based between the UC1 and AC1. Because the UC1 has approached AC1 from below, AC1 is set to crunched. 5. UC1 wins the collision.

Visionary Scenario: Use case name

Win Collision

Participating actors

Alice: Player

Entry conditions

1. The shield of the autonomous car (AC1) is closed. 2. Bumpers game has started, and the user car, and AC1 are driving. 3. Bumpers knows the position, direction and speed of the user car, and AC1.

Flow of events

1. 2. 3. 4. 5.

Exit conditions

AC1 speed is set to 0.

Special requirements

There are no collision ties.

The shield of autonomous car (AC1) opens and closes every 3seconds. Alice steers the user car in the direction of the AC1. The user car approaches AC1 from below. Bumpers detects a collision based between the user car and AC1. Because the user car has approached AC1 from below and hit AC1 while the shield was open, AC1 is set to crunched. 6. The user car wins the collision



Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, May 07 and Friday, May 11

 

4.

[6 points] Create a textual description of the use case “Crash Car” using the following template. Your main focus should be on the description of the flow of events.

Use case name Participating actors Entry conditions Flow of events

Exit conditions Special requirements

Use case name

Crash Car

Participating actors

Player

Entry conditions

1. Bumpers game has started, and cars are driving. 2. Bumpers knows all initial car positions, directions, and their speed.

Flow of events

1. The Player steers the user car in the direction of another Car. 2. Bumpers detects a collision based between two cars. 3. If the user car's position is below the position of the other Car, the other Car is set to crunched. Otherwise, the user car is set to crunched.

Exit conditions

The crunched car has a speed of 0.

Special requirements

There are no collision ties.

5.

[2 points] Explain the differences between and in UML use case diagrams. Why does UML support both? Provide an example from the Bumpers game to illustrate the difference.

Why does UML support both? Functional models need to support the modeling of common functionality () to allow reuse, as well as exceptional functionality (). The example below points out the difference using the Bumpers Use Case Diagram from Homework Sheet 02: 1. An inclusion use case A is typically involved in more than one other use case, e.g. B and C. This means, that B and C can “invoke” / “execute” the functionality from use 

Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, May 07 and Friday, May 11

 

case A. This allows to reuse the functionality of use case A in multiple places. B would then have one step in its flow of events when use case A is executed. In Bumpers, the use case “Start Game” executes the functionality of the use case “Play Music”, therefore we use here. 2. An extension use case E is typically used to describe exceptional behavior that does not occur in all cases. In Bumpers, the use case “Crash Car” is only executed when a collision is detected. In case no collision is detected, the use case is not executed. 6.

[2 points] Explain the differences between aggregation and composition in UML class diagrams. Provide an example for the Bumpers game that points out the difference.

Both support consist-of hierarchies (as opposed to inheritance) Difference: In composition, the child classes cannot exist independently from the parent class. In aggregation, the child classes have “their own life” (see lecture 03, slide 21, 22). Examples in Bumpers: 1. GameBoardUI consists of GameBoard (using composition): This means that if the GameBoardUI does not exist any more (e.g. because the player closes the application), the GameBoard also does not exist any more. 2. GameBoard consists of Player (using aggregation): The player still exists (in reality), even if the GameBoard does not exist any more.



Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, May 14 and Friday, May 18

 

Homework Sheet 04 [17 points] - Example Solution Deadline for Submission: Monday May 14, noon Dynamic Modeling of Bumpers and System Design Read the problem statement of Bumpers (see Lecture 02 Slide 21) and review the functional model and object model (Lecture 02, Slides 84-85). Now you have to create the dynamic model of Bumpers. 1.

[5 points] Model the dynamic behavior of the user car in Bumpers using a UML statechart diagram.

Example Solution:

User Car Moving do/change speed do/steer user clicks “Stop Game” in the Menu /stopGame()

[overlap occurs] /detectCollision()

Collision Test do/evaluate() [evaluate==false] /setCrunched() evaluate

User Car Crunched

/setSpeed(0)

User Car Stopped

/stopGame()

[evaluate==true] /winCollision()

[overlap occurs] evaluate==true

≝ ≝ ≝ means equal by definition

the bounding box of the user car is overlapping with the bounding box of another car evaluate() returns the user car

1 

Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 

To be discussed in the tutor groups between Monday, May 14 and Friday, May 18

 2.



[1 point] Introduce a taxonomy for the car class that models autonomous cars and user cars as subclasses. Add an attribute shield to the autonomous cars, that protects the autonomous car against collisions.

Example Solution:

3.

[4 points] Based on the modified class diagram of Question 2, below is a visionary scenario Win Collision, that involves an autonomous car. Model the flow of events using a UML activity diagram.

Scenario name

Win Collision

Participating actors

Alice: Player

Entry conditions

1. The shield of Autonomous Car (AC1), is opened. 2. The Bumpers game started, and the user car UC1, and AC1 are driving. 3. Bumpers knows the position, direction and speed of the UC1 and AC1.

Flow of events

1. 2. 3. 4. 5.

Exit conditions

AC1 speed is set to 0.

Special requirements

Not applicable

The shield of AC1 opens and closes every 3 seconds. Alice steers UC1 in the direction of AC1. UC1 approaches AC1 from below. Bumpers detects a collision between UC1 and AC1. Because UC1 has approached AC1 from below and hit AC1 with an open shield, AC1 is set to crunched. 6. UC1 wins the collision

2 

Chair for Applied Software Engineering Prof. Bernd Brügge, Ph. D. Introduction to Software Engineering (SS2018) 


Similar Free PDFs