Started onTuesday, 15 July 2014, 11:39 AM
StateFinished
Completed onTuesday, 15 July 2014, 12:54 PM
Time taken1 hour 14 mins
Grade42.35 out of a maximum of 66.00 (64%)

Information

Not flagged

Information text

Regeln für die Klausur: 

Als Hilfsmittel sind ein beidseitig *hand*-beschriebenes DIN-A4-Blatt, ein leeres Blatt und ein Stift erlaubt, sowie eine Wasserflasche erlaubt,
sonst darf nichts auf den Tischen liegen.
Handys und sonstige mobile Geräte müssen ausgeschaltet und in der Tasche sein (die Hochschulleitung empfiehlt, Handys gar
nicht mitzubringen; das halte ich für unrealistisch).
 
Sie können die Fragen in einer beliebigen Reihenfolge bearbeiten.
Die Abgabe erfolgt über den "Submit and finish"/"Abgabe" Button.
 
Es gibt 33 Fragen; Sie können maximal 66 Punkte erreichen. Es gibt keine Mindestpunktzahl zum Bestehen, wenn Sie gemeinsam mit Ihren Übungsaufgaben mehr als 50% der Gesamtpunktzahl erreicht haben, haben Sie den Kurs bestanden.
 
Abschreiben/"klicken" von anderen und jede Form der Kommunikation mit anderen Personen in und ausserhalb des Raums, sowie das Verwenden anderer Hilfsmittel wird als Betrugsversuch gewertet, d.h. sie erhalten 0 Punkte und müssen den Raum verlassen.
 
Viel Erfolg!

Response history

Step Time Action State
1 15/07/14, 11:39 Started
2 15/07/14, 11:40 Seen
3 15/07/14, 12:54 Attempt finished
4 23/07/14, 15:08 Attempt finished

Information

Not flagged

Information text

Response history

Step Time Action State
1 15/07/14, 11:39 Started
2 15/07/14, 11:40 Seen
3 15/07/14, 12:54 Attempt finished
4 23/07/14, 15:08 Attempt finished

Question 1

Complete
Mark 0.00 out of 2.00
Not flagged

Question text

Name two advantages and two disadvantages of distributed version control versus centralized version control.

advantages:

1. multiple developers can work on differnet tasks without crossing each other (because of branches)

2. great for open source project -> good for diversity because its easy for an developer to start its own changes on a project (forks) without influencing the original project

disadvantages:

1. harder to keep overview about what is done so far and what not

2. More risk for buggy features that evolve in branches

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:44 Saved: advantages: 1. multiple developers can work on differnet tasks without crossing each other 2. great for open source project -> good for diversity because its easy for an developer to start its own changes on a project (forks) without influencing the original project disadvantages: 1. harder to keep overview about what is done so far and what not 2. More risk for buggy features that evolve in branches Answer saved
3 15/07/14, 12:49 Saved: advantages: 1. multiple developers can work on differnet tasks without crossing each other (because of branches) 2. great for open source project -> good for diversity because its easy for an developer to start its own changes on a project (forks) without influencing the original project disadvantages: 1. harder to keep overview about what is done so far and what not 2. More risk for buggy features that evolve in branches Answer saved
4 15/07/14, 12:54 Attempt finished Complete
5 23/07/14, 00:21 Manually graded 0 with comment: Complete 0.00

Question 2

Incorrect
Mark 0.00 out of 2.00
Not flagged

Question text

What does a git commit object contain?

Select one or more:
Incorrect
Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:41 Saved: branch name; a set of files Answer saved
3 15/07/14, 12:54 Attempt finished Incorrect 0.00

Question 3

Complete
Mark 3.00 out of 4.00
Not flagged

Question text

Explain briefly what the following Branch types (Patterns) are usually used for:

- Release Branch

- Task Branch

Release Branch: The tested and validated branch that gets deployed to the customer. Every validated task-branch merges into the release branch if the feature of the task branch is supposed to be in the deployable (release-ready) version

 

Task Branch: A Task Branch is branch created to add a certain functionality/task. Only changes that are nedded for the specific task are made in this branch.

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:41 Saved: Release branch: Answer saved
3 15/07/14, 11:44 Saved: Release Branch: The tested and validated branch that gets deployed to the customer. Every validated task-branch merges into the release branch if the feature of the task branch is supposed to be in the deployable (release-ready) version   Task Branch: A Task Branch is branch created to add a certain functionality/task. Only changes that are nedded for the specific task are made in this branch. Answer saved
4 15/07/14, 12:54 Attempt finished Complete
5 23/07/14, 00:25 Manually graded 3 with comment: Complete 3.00

Information

Not flagged

Information text

Section: Processes and Agile Software Development

Response history

Step Time Action State
1 15/07/14, 11:39 Started
2 15/07/14, 11:46 Seen
3 15/07/14, 12:54 Attempt finished
4 23/07/14, 15:08 Attempt finished

Question 4

Correct
Mark 2.00 out of 2.00
Not flagged

Question text

Das Agile Manifesto besagt: 

That is, while there is value in the items on
the right, we value the items on the left more.

Fügen Sie die Seiten richtig zusammen.

Responding to change

Correct

Customer collaboration

Correct

Individuals and interactions

Correct

Working software

Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:46 Saved: Responding to change -> over following a plan; Customer collaboration -> over contract negotiation; Individuals and interactions -> over processes and tools; Working software -> over comprehensive documentation Answer saved
3 15/07/14, 12:54 Attempt finished Correct 2.00

Question 5

Complete
Mark 2.00 out of 2.00
Not flagged

Question text

What are the fundamental activities that are common to all software processes?

- specification

- development

- validation

- evolution

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:49 Saved: - specification - development - validation - evolution Answer saved
3 15/07/14, 12:54 Attempt finished Complete
4 23/07/14, 00:26 Manually graded 2 with comment: Complete 2.00

Question 6

Complete
Mark 2.50 out of 3.00
Not flagged

Question text

In Ruby (on Rails) werden die Abhängigkeiten von Libraries (gems) mit dem Tool Bunder verwaltet. In der Datei Gemfile werden die Abhängigkeiten angegeben, die Bundler dann auflöst und die verwendeten Versionen aller Gems in Gemfile.lock schreibt.

In einer Rails-Applikation sollte man diese Datei Gemfile.lock unter Versionskontrolle stellen. Warum?

Dieses Vorgehen stellt sicher das gems nicht unfreiwillig aktualisiert werden und damit Abhängigkeits-Konflikte in der bestehden Anwendung entstehen.

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:47 Saved: Dieses Vorgehen stellt sicher das gems nicht unfreiwillig aktualisiert werden und damit Abhängigkeits-Konflikte entstehen. Answer saved
3 15/07/14, 12:46 Saved: Dieses Vorgehen stellt sicher das gems nicht unfreiwillig aktualisiert werden und damit Abhängigkeits-Konflikte in der bestehden Anwendung entstehen. Answer saved
4 15/07/14, 12:54 Attempt finished Complete
5 23/07/14, 00:29 Manually graded 2.5 with comment: Complete 2.50

Question 7

Complete
Mark 2.00 out of 3.00
Not flagged

Question text

Was ist Continuous Integration (CI)? Nennen Sie sechs der Praktiken, die CI ausmachen.

Unter Continuos Integration versteht man einen Software-Engenerring-Stil bei dem das Team Ihre Arbeit in regelmäßigen Abständen comittet.

- commits mindestens täglich (mehrere commits pro Tag)

- keine Branches

- Automatisierter Build (inklusive tests) für die commits um Fehler sofort zu finden

- feature nicht abgeschlossen bis build erfolgreich (kein paralleles weiterarbeiten an anderen features)

-

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:48 Saved: Continuos Integration ist Answer saved
3 15/07/14, 11:53 Saved: Unter Continuos Integration versteht man einen Software-Engenerring-Stil bei dem das Team Ihre Arbeit in regelmäßigen Abständen comittet. - commits mindestens täglich (mehrere commits pro Tag) - keine Branches - Automatisierter Build (inklusive tests) für die commits um Fehler sofort zu finden - continuos deployment: funktionierende Builds werden dem End-Nutzer sofort zur Verfügung gestellt - Answer saved
4 15/07/14, 12:47 Saved: Unter Continuos Integration versteht man einen Software-Engenerring-Stil bei dem das Team Ihre Arbeit in regelmäßigen Abständen comittet. - commits mindestens täglich (mehrere commits pro Tag) - keine Branches - Automatisierter Build (inklusive tests) für die commits um Fehler sofort zu finden - feature nicht abgeschlossen bis build erfolgreich (kein paralleles weiterarbeiten an anderen features) - Answer saved
5 15/07/14, 12:54 Attempt finished Complete
6 23/07/14, 00:34 Manually graded 2 with comment: Complete 2.00

Question 8

Complete
Mark 1.00 out of 3.00
Not flagged

Question text

Was ist Continuous Deployment/Delivery (CD)? Nennen Sie drei der Praktiken, die CD ausmachen.

Continuos Deployment bedeutet funktionierende Builds (aus dem continuous integration verfahrens) sofort dem End-Nutzer zur Verfügung zu stellen

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:54 Saved: Continuos Deployment bedeutet funktionierende Builds (aus dem continuous integration verfahrens) sofort dem End-Nutzer zur Verfügung zu stellen Answer saved
3 15/07/14, 12:54 Attempt finished Complete
4 23/07/14, 00:45 Manually graded 1 with comment: Complete 1.00

Question 9

Partially correct
Mark 2.25 out of 3.00
Not flagged

Question text

Imagine a project "Songbook" which implements an online-catalog of songs with references about where to find the score.

Decide whether the following requirements are functional or non-functional.

The landing page should have a response time below 300ms.

Correct

Search should take no longer than 500ms.

Correct

The application should run on an ubuntu server.

Incorrect

Artwork can be uploaded to a song description page.

Correct

The Songbook can be searched for guitar chords used.

Correct

Songs can be sorted by title, year of appearance and artist.

Correct

The Songbook should be easy to use.

Incorrect

On the landing page, the newest songs should be shown.

Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:55 Saved: The landing page should have a response time below 300ms. -> nonfunctional; Search should take no longer than 500ms. -> nonfunctional; The application should run on an ubuntu server. -> functional; Artwork can be uploaded to a song description page. -> functional; The Songbook can be searched for guitar chords used. -> functional; Songs can be sorted by title, year of appearance and artist. -> functional; The Songbook should be easy to use. -> functional; On the landing page, the newest songs should be shown. -> functional Answer saved
3 15/07/14, 12:54 Attempt finished Partially correct 2.25

Question 10

Partially correct
Mark 1.50 out of 3.00
Not flagged

Question text

What are the following UML diagrams for?

Associate the correct descriptions with the diagram names.

Class Diagram

Correct

Object Diagram

Incorrect

Sequence Diagram

Incorrect

Use case diagram

Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:57 Saved: Class Diagram -> Shows main objects and their associations.; Object Diagram -> Shows how objects cooperate with each other in handling a specific process or use case.; Sequence Diagram -> Shows a complete or partial view of the structure of the system at a specific time.; Use case diagram -> Shows user's interaction with a system. Answer saved
3 15/07/14, 12:54 Attempt finished Partially correct 1.50

Question 11

Complete
Mark 0.00 out of 3.00
Not flagged

Question text

What are properties of good user stories? Name 4 - or 2 with a reasoning why this property is important for a good user story.

- user

- action/motivation

- steps in software system

- all possible paths that can be taken

 

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:46 Saved: - user - motivation - steps in software system   Answer saved
3 15/07/14, 12:50 Saved: - user - action - motivation - steps in software system   Answer saved
4 15/07/14, 12:51 Saved: - user - action/motivation - steps in software system - all possible paths that can be taken   Answer saved
5 15/07/14, 12:54 Attempt finished Complete
6 23/07/14, 00:47 Manually graded 0 with comment: Complete 0.00

Question 12

Partially correct
Mark 1.67 out of 2.00
Not flagged

Question text

Was gehört zu den Aufgaben eines Scrum Masters?

Select one or more:
Correct
Dies ist eine Aufgabe des Scrum Masters.
Correct
Dies ist eine Aufgabe des Scrum Masters.
Incorrect
Dies ist eine Aufgabe des Product Owners.
Correct
Dies ist eine Aufgabe des Scrum Masters.
Correct
Dies ist eine Aufgabe des Scrum Masters.
Correct
Dies ist eine Aufgabe des Scrum Masters.
Correct
Dies ist eine Aufgabe des Scrum Masters.

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 11:58 Saved: Beseitigt Hindernisse, die das Team bei der Arbeit stören; Ist verantwortlich für die Arbeitsfähigkeit und Produktivität des Teams; Aktualisiert die Features und ihre Priorisierung für jede Iteration; Verantwortlich dafür, Scrum Werte und Praktiken einzuhalten; Nimmt Arbeitsergebnisse ab; Schützt das Team vor externen Unterbrechungen und Anforderungen; Unterstützt die Zusammenarbeit zwischen allen Rollen und Funktionen im Prozess; Repräsentiert das Management gegenüber dem Projekt Answer saved
3 15/07/14, 12:51 Saved: Beseitigt Hindernisse, die das Team bei der Arbeit stören; Ist verantwortlich für die Arbeitsfähigkeit und Produktivität des Teams; Aktualisiert die Features und ihre Priorisierung für jede Iteration; Verantwortlich dafür, Scrum Werte und Praktiken einzuhalten; Schützt das Team vor externen Unterbrechungen und Anforderungen; Unterstützt die Zusammenarbeit zwischen allen Rollen und Funktionen im Prozess; Repräsentiert das Management gegenüber dem Projekt Answer saved
4 15/07/14, 12:54 Attempt finished Partially correct 1.67

Information

Not flagged

Information text

Software Testing Section

Response history

Step Time Action State
1 15/07/14, 11:39 Started
2 15/07/14, 11:58 Seen
3 15/07/14, 12:54 Attempt finished
4 23/07/14, 15:08 Attempt finished

Question 13

Complete
Mark 4.00 out of 4.00
Not flagged

Question text

Im Test-Driven-Development sollen die Tests vor der eigentlichen Funktionalität geschrieben werden. Welche Vorteile kann ein solches Vorgehen gegenüber dem späteren Schreiben von Tests haben (nachdem die Funktionalität bereits implementiert ist)?

Vorteile von TDD:

 

1. man schreibt automatisch besser testbaren code

2. durch das schreiben der tests vor der Programmierung beschäftigt man sich eingehender mit dem gewünschten Verhalten einer Funktionalität -> dedizierterer Code

3. Code ist weniger anfällig für Fehlverhalten da man sich bei Implemantation an seine Tests hält

4. jede funktionalität muss Test passieren: man "vergisst" keine Tests

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:02 Saved: Vorteile von TDD:   1. man schreibt automatisch besser testbaren code 2. durch das schreiben der tests vor der Programmierung beschäftigt man sich eingehender mit dem gewünschten Verhalten einer Funktionalität -> dedizierterer Code 3. Code ist weniger anfällig für Fehlverhalten da man sich bei Implemantation an seine Tests hält 4. jede funktionalität muss Test passieren: man "vergisst" keine Tests Answer saved
3 15/07/14, 12:54 Attempt finished Complete
4 23/07/14, 00:49 Manually graded 4 with comment: Complete 4.00

Question 14

Complete
Mark 2.00 out of 2.00
Not flagged

Question text

Name the steps of Test Driven Development.

1. write failing tests

2. implement simplest solution

3. refactor after pasing tests

 

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:04 Saved: 1. write failing tests 2. implement simplest solution 3. refactor after pasing tests   Answer saved
3 15/07/14, 12:54 Attempt finished Complete
4 23/07/14, 00:53 Manually graded 2 with comment: Complete 2.00

Question 15

Partially correct
Mark 0.60 out of 3.00
Not flagged

Question text

Consider a method boolean divisible(int i, int n) which returns true if the first number can be divided by the second, that is, if i % n == 0.

Which of the following are suitable equivalence classes for a black-box test for testing this method?

Select one or more:
Correct
Correct
Incorrect

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:06 Saved: i*n for i >= 0 (all multiples of n); all i: i % n != 0 for i>0 (all positive numbers not dividable by n); i = 0 (only zero) Answer saved
3 15/07/14, 12:54 Attempt finished Partially correct 0.60

Question 16

Correct
Mark 2.00 out of 2.00
Not flagged

Question text

Betrachten Sie die folgende Methode:

	public int method1(int x, int y){
		int result = y;
		if (x > 0){
			int z = y % 2;
			if (z == 0){
				result = x*y;
			}else
				result = x;
			}
		return result;
	}

Mit welchen Testcases (jeweils {x, y, result}) erreichen Sie genau 100% Testabdeckung (ohne Redundanz?)

NMC: Kreuzen Sie alle falschen Antworten an!

Select one or more:
Correct
Correct
Correct
Correct
Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:11 Saved: {1,1,1}, {1,2,2}; {-1,5,5}, {-1,2,2}, {1,1,1}, {1,2,2};  {-1,5,5}, {-1,1,1}, {1,2,2}; {0,5,5},{-1,5,5}, {1,1,1}, {1,2,2}; {-1,5,5}, {1,2,2} Answer saved
3 15/07/14, 12:54 Attempt finished Correct 2.00

Information

Not flagged

Information text

OOD and Clean Code

Response history

Step Time Action State
1 15/07/14, 11:39 Started
2 15/07/14, 12:11 Seen
3 15/07/14, 12:54 Attempt finished
4 23/07/14, 15:08 Attempt finished

Question 17

Complete
Mark 0.00 out of 2.00
Not flagged

Question text

What does the "Law of Demeter" say, what are the rules of it?

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:54 Attempt finished Not answered
3 23/07/14, 00:54 Manually graded 0 with comment: Complete 0.00

Question 18

Partially correct
Mark 1.33 out of 2.00
Not flagged

Question text

Consider the following code snippet:

	// ist die Kleinunternehmer-Regelung anzuwenden?
	if (jahresumsatz <= 00000){
		//....
int tax = 0;
// .... (some more tax calculations) } else { includeVatCalculation(); }

What might be the problem with it?

Select one or more:
Correct
Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:13 Saved: The limit for "Kleinunternehmerregelung" should be in a constant.; Rather than commenting the if-condition, a new method should have been created. Answer saved
3 15/07/14, 12:54 Attempt finished Partially correct 1.33

Question 19

Complete
Mark 2.00 out of 2.00
Not flagged

Question text

What are the differences between Java and Ruby? Name at least three(3).

1: Java is typesafe while ruby uses duck typing

2: Ruby has an interpreter (doesn't nedd to be compiled)

3: Ruby has no primitve datatypes like java, literaly everything is an object

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:14 Saved: 1: Java is typesafe while ruby uses duck typing 2: Ruby has an interpreter (doesn't nedd to be compiled) 3: Ruby has no primitve datatypes like java, literaly everything is an object Answer saved
3 15/07/14, 12:54 Attempt finished Complete
4 23/07/14, 01:00 Manually graded 2 with comment: Complete 2.00

Question 20

Complete
Mark 1.50 out of 2.00
Not flagged

Question text

What is Duck Typing and why is it difficult to implement in Java? How could you implement something similar?

Duck typing determines the type of an element by its behaviour and not by a certain definition.

JAva is a typesafe programing language that needs ever variable/field to be defined to have a certain datatype. The Java-Compiler checks if an value that is to be assigned to an variable/field is from the type that the variable/field expects.

 

A Workaround colud be to abstract this behaviour by an class. Lets call is "DuckType" - it has an constructor andnd multiple fields that represent the value of the object in different datatypes and getters for those. This class could have multiple constructors. Every constructor is for assigning a value from a certain datatype to an object of the class "DuckType".

Now I could do something like this:

//for string

DuckType var = new Ducktype(42);//an integer is given as param, so the constructor for an integer parameter is called and assignes 42 to the field "int valueInt"

DuckType var = new Ducktype("hello world");// astring is given, so the constructor for a string parameter is called and assignes "hello world" to the field "String valueStr"

 

Now all you need is matching getters to return the value of the field corresponding to the used datatype

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:24 Saved: Duck typing determines the type of an element by its behaviour and not by a certain definition. JAva is a typesafe programing language that needs ever variable/field to be defined to have a certain datatype. The Java-Compiler checks if an value that is to be assigned to an variable/field is from the type that the variable/field expects.   A Workaround colud be to abstract this behaviour by an class. Lets call is "DuckType" - it has an constructor andnd multiple fields that represent the value of the object in different datatypes and getters for those. This class could have multiple constructors. Every constructor is for assigning a value from a certain datatype to an object of the class "DuckType". Now I could do something like this: //for string DuckType var = new Ducktype(42);//an integer is given as param, so the constructor for an integer parameter is called and assignes 42 to the field "int valueInt" DuckType var = new Ducktype("hello world");// astring is given, so the constructor for a string parameter is called and assignes "hello world" to the field "String valueStr"   Now all you need is matching getters to return the value of the field corresponding to the used datatype Answer saved
3 15/07/14, 12:48 Saved: Duck typing determines the type of an element by its behaviour and not by a certain definition. JAva is a typesafe programing language that needs ever variable/field to be defined to have a certain datatype. The Java-Compiler checks if an value that is to be assigned to an variable/field is from the type that the variable/field expects.   A Workaround colud be to abstract this behaviour by an class. Lets call is "DuckType" - it has an constructor andnd multiple fields that represent the value of the object in different datatypes and getters for those. This class could have multiple constructors. Every constructor is for assigning a value from a certain datatype to an object of the class "DuckType". Now I could do something like this: //for string DuckType var = new Ducktype(42);//an integer is given as param, so the constructor for an integer parameter is called and assignes 42 to the field "int valueInt" DuckType var = new Ducktype("hello world");// astring is given, so the constructor for a string parameter is called and assignes "hello world" to the field "String valueStr"   Now all you need is matching getters to return the value of the field corresponding to the used datatype Answer saved
4 15/07/14, 12:54 Attempt finished Complete
5 23/07/14, 01:05 Manually graded 1.5 with comment: Complete 1.50

Question 21

Incorrect
Mark 0.00 out of 2.00
Not flagged

Question text

When should you test outgoing messages of an object?

Select one or more:
Correct
Incorrect

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:24 Saved: if they have side-effects; If they are a query Answer saved
3 15/07/14, 12:54 Attempt finished Incorrect 0.00

Question 22

Correct
Mark 2.00 out of 2.00
Not flagged

Question text

Consider the following Code example from the Book "Practical Object Oriented Design" by Sandi Metz. How many Dependencies are there from Gear to Wheel?

class Gear
  attr_reader :chainring, :cog, :rim, :tire
  def initialize(chainring, cog, rim, tire)
    @chainring = chainring
    @cog       = cog
    @rim       = rim
    @tire      = tire
  end

  def gear_inches
    ratio * Wheel.new(rim, tire).diameter
  end

  def ratio
    chainring / cog.to_f
  end
# ...
end

class Wheel
  attr_reader :rim, :tire
  def initialize(rim, tire)
    @rim       = rim
    @tire      = tire
  end

  def diameter
    rim + (tire * 2)
  end
# ...
end

Gear.new(52, 11, 26, 1.5).gear_inches
Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:25 Saved: 2 Answer saved
3 15/07/14, 12:54 Attempt finished Correct 2.00

Question 23

Complete
Mark 2.00 out of 2.00
Not flagged

Question text

Which refactorings are ok if you are confronted with legacy code that cannot be tested easily? And why?

automated refactoring that is provided by the ide as those refactorings don't affect the behaviour of  a programm

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:26 Saved: automated refactoring that is provided by the ide as those refactorings don't affect the behaviour of  a programm Answer saved
3 15/07/14, 12:54 Attempt finished Complete
4 23/07/14, 01:10 Manually graded 2 with comment: Complete 2.00

Information

Not flagged

Information text

Software Design Patterns - Section

Response history

Step Time Action State
1 15/07/14, 11:39 Started
2 15/07/14, 12:27 Seen
3 15/07/14, 12:54 Attempt finished
4 23/07/14, 15:08 Attempt finished

Question 24

Partially correct
Mark 1.00 out of 2.00
Not flagged

Question text

NMC: In which of the following Books / Articles was the Model-View-Controller Paradigm first described or introduced?

NMC: Check all wrong answers.

Select one or more:
Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:27 Saved: GoF: Design Patterns Answer saved
3 15/07/14, 12:54 Attempt finished Partially correct 1.00

Question 25

Partially correct
Mark 1.00 out of 2.00
Not flagged

Question text

Which Patterns of Enterprise Application Architecture as described in Martin Fowler's Book are implemented in the Ruby on Rails Framework?

Check all correct answers.

Select one or more:
Correct
Correct

Feedback

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:27 Saved: Template View; Active Record; Page Controller; Application Controller Answer saved
3 15/07/14, 12:28 Saved: Template View; Active Record Answer saved
4 15/07/14, 12:54 Attempt finished Partially correct 1.00

Question 26

Complete
Mark 2.00 out of 2.00
Not flagged

Question text

Explain the Template Method Pattern and give an Example (either one we discussed in class or another one).

Template method is a pattern where a method defines a behaviour. This Methods (called hook methods as they can be overridden in an inerhiting class when a new behaviour needs to be defined) is than called by  an overlying method. This overlying  method is the actual public method that is used for the object to behave.

Example - the duck simulator:

We have an program that simulates ducks. We have a method that defines how a duck flies. Since we also want to cover rubber ducks within our programm we have a problem because rubber ducks can't fly. So we write a class "Duck" with a method "fly()" in our duck class. If we define our class "RubberDuck" for the rubber duck, that inherites from "Duck" and overrides the method fly to, for example, give an  error message that says: "rubber ducks can't fly"

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:37 Saved: Template method is a pattern where a method defines a behaviour. This Methods (called hook methods as they can be overridden in an inerhiting class when a new behaviour needs to be defined) is than called by  an overlying method. This overlying  method is the actual public method that is used for the object to behave. Example - the duck simulator: We have an program that simulates ducks. We have a method that defines how a duck flies. Since we also want to cover rubber ducks within our programm we have a problem because rubber ducks can't fly. So we write a class "Duck" with a method "fly()" in our duck class. If we define our class "RubberDuck" for the rubber duck, that inherites from "Duck" and overrides the method fly to, for example, give an  error message that says: "rubber ducks can't fly" Answer saved
3 15/07/14, 12:54 Attempt finished Complete
4 23/07/14, 01:12 Manually graded 2 with comment: Complete 2.00

Question 27

Complete
Mark 3.00 out of 3.00
Not flagged

Question text

Explain the main Idea of the Interface Segregation Principle in 2-3 sentences.

The main idea of interface segregation is to split up interfaces in order to be dedicated to certain task. So an interface should cover as less tasks as possible ->  This way we try to keep classes to be responsible for as few tasks as possible

Response history

Step Time Action State Marks
1 15/07/14, 11:39 Started Not yet answered
2 15/07/14, 12:39 Saved: The main idea of interface segregation is to split up interfaces in order to be dedicated to certain task. So an interface should cover as less tasks as possible ->  This way we try to keep classes to be responsible for as few tasks as possible Answer saved
3 15/07/14, 12:54 Attempt finished Complete
4 23/07/14, 01:17 Manually graded 3 with comment: Complete 3.00