KXA Exam Template
Student ID No: Click or tap here to enter text. Pages: 9
Questions: 10
UNIVERSITY OF TASMANIA
EXAMINATIONS FOR DEGREES AND DIPLOMAS
November 2019
KIT206 Software Design and Development
First and Only Paper
Ordinary Examination
Examiners: Dr Julian Dermoudy and NAME
Time Allowed: THREE (3) hours
Reading Time[footnoteRef:1]: FIFTEEN (15) minutes [1: You may write during the Reading Time.]
Instructions:
Type your Student ID into the field at the top of this page.
There is a total of 180 marks available. Attempt ALL TEN (10) questions. Each question is worth 18 marks.
Answers for each question should be typed into the spaces provided in this document and the document uploaded to MyLO before the deadline.
This is an individual assessment task. You may not consult with anyone while completing the examination. Your work will be checked for plagiarism and severe penalties may be applied under the Ordinance of Student Academic Integrity
(Assessing ILO: 1)
Consider the following excerpt from an RTM for software to manage a hot drink dispensing machine. Write the action–software reaction table that would be part of the structured scenario for this use case.
Entry
Para
Requirement
Type
Use Case
201
7.3.1
The user will choose and receive a hot drink
SW
UC20 Order Drink
202
7.3.1
The action is started by pressing a button labelled “Order”
SWC 20
203
7.3.2
The user will be shown a list of available hot drinks
SWC 20
204
7.3.2
The user selects a drink from the displayed list
SWC 20
205
7.3.3
If the machine has cups then the chosen hot drink is dispensed
SWC 20
206
7.3.3
If the machine does not have cups then an error message is displayed
SWC 20
Click or tap here to enter text.
[18 marks]
(Assessing ILO: 1)
Birds are covered in feathers, can walk, and lay eggs. Birds have an age which is classified into chick, young, and old. Seagulls are birds and can scavenge for Food. Penguins are birds and can sleep in a Burrow. Pigeons are birds and they walk differently to all other birds. Penguins can swim. Pigeons can fly. Seagulls can swim and fly. Birds, Swimmers, and Flyers are abstract classes. Seagulls, Penguins, and Pigeons are concrete classes.
Draw a UML class diagram that best describes the above information. Include attributes and methods that are mentioned in these classes. (Treat actions, like walk or scavenge, etc as methods.) Include multiplicities, enumerations, specialisation, and so on, where relevant.
[18 marks]
(Assessing ILO: 1)
Draw a UML sequence diagram to show what happens when the following classes are executed.
class Program {
static void Main(string[] args) {
A a = new A();
B b = new B{ Thing = a };
C c = new C();
a.Run(c);
}
}
class A {
public void Run(C c) {
c.Show(this);
c.Run(c);
}
}
class B {
public A Thing { get; set; }
public void Run() {
Run2(Thing);
}
public void Run2(A) {
C c = new C();
}
}
class C:A {
public void Show(A a) { /* code to be written */ }
}
[18 marks]
(Assessing ILO: 1)
a. What is the Model-View-Controller design pattern and what are the benefits of using it?
Click or tap here to enter text.
[6 marks]
b. Design patterns often make development quicker in the long run but slower when first being used. Why is this? Give an example.
Click or tap here to enter text.
[6 marks]
c. Describe two design patterns (other than Model-View-Controller), draw them, and explain what they are used for.
Click or tap here to enter text.
[6 marks]
(Assessing ILO: 3)
a. What is white box testing and when would you use it instead of black box testing?
Click or tap here to enter text.
[6 marks]
b. What is black box testing and when would you use it instead of white box testing?
Click or tap here to enter text.
[6 marks]
c. Are execution-testing approaches the only approach to testing? When are non-execution testing schemes preferable?
Click or tap here to enter text.
[6 marks]
(Assessing ILO: 3)
Consider the following class diagram. Write C# code to declare the classes and enumerations contained within the diagram. Do not include using or namespace declarations in your answer.
You may assume that all required namespaces are available. Each attribute must be a public, auto-generated property. Any methods you write should be stubs, with an appropriate header but no code within their body { }.
Click or tap here to enter text.
[18 marks]
(Assessing ILOs: 2 and 3)
In parts (a)–(c) below, suppose there exists a class called Joke that represents a joke. Each joke has three public properties: Text (a string), minimum Age in years for those who can hear the joke (an int), and average funniness Score (a double) between 0 (not funny) and 10 (funniest joke in the world! Ever!).
a. Assuming the following declaration of a collection of Jokes
List
that has been filled with Joke objects, write a LINQ expression that selects those jokes which are intended for an adult audience (Age at least 18).
Click or tap here to enter text.
[6 marks]
b. Further suppose that there exists a MySQL database with a table called Jokes that has a string-valued column author, an int-valued column count to keep track on the number of times the joke has been told, a double-valued column rating which stores the average funniness score, and a string-valued column entitled text. Write a suitable SQL query to retrieve the information necessary to create Joke objects from the information in the Jokes table.
Click or tap here to enter text.
[6 marks]
c. Now, assuming that a MySqlDataReader called rdr has been created using the query you defined in (b), and that it has been executed and its Read() method called to load the first result. Write a single C# statement to instantiate a Joke object using the data retrieved and assign it to a variable called j.
Click or tap here to enter text.
[6 marks]
(Assessing ILO: 3)
a. Assume a WPF Window uses a Grid layout with two columns and three rows. Write a fragment of XAML to create a TextBlock with the name “sampleText” that occupies all of the bottom-left cell in the grid. Have the TextBlock display the text “TextBlock!”. Include only those properties that are necessary to achieve this behaviour. Do not write the XAML for the containing Grid.
Click or tap here to enter text.
[9 marks]
b. Consider the following excerpt from the XAML for an application’s main Window. Draw a low-fidelity sketch of the GUI it defines. It should be approximately to scale, but does not need to be exact.
[9 marks]
(Assessing ILO: 3)
a. In the .NET Framework, what is LINQ and what benefits does it provide to software development? (Write three to five sentences in total.)
Click or tap here to enter text.
[6 marks]
b. Describe the purpose of and benefits from using Data Templates in XAML.
Click or tap here to enter text.
[6 marks]
c. With regard to WPF and XAML, what is data binding and what are some of the benefits it provides? Include an example of how data binding may be used.
Click or tap here to enter text.
[6 marks]
(Assessing ILO: 3)
Consider the following use-case-based test for an application and answer the questions that appear below the table.
Description
The system should be able to generate a list of the units under the control of the School, ordered alphanumerically, according to semester of offering.
Type and Use Case
SW UC41_User_views_SemUnitList
Criteria
When the user chooses the semester number from the Semester drop-down menu, the list of units offered in that semester (1, 2, 3, 4, or 5) should appear.
Method
White box test:
1. Open the application
2. Choose a semester from the Semester drop-down menu
3. Check that a list of units is displayed
Outcome
Fail
a. Can the “Fail” shown as the outcome be trusted? Does this indicate that the Test has failed or that the entry in the RTM has not been implemented?
Click or tap here to enter text.
[6 marks]
b. Are there enough test methods in this test case? If not, what additional methods (steps) would you add?
Click or tap here to enter text.
[6 marks]
c. What makes (or would make) this a white-box test?
Click or tap here to enter text.
[6 marks]
Please ensure you have put your Student ID in the top-left corner of Page 1.