WorksheetsSoftware Design Quiz
Total questions: 49
Worksheet time: 25mins
Which of these are desirable characteristics of a software design? (Choose three)
reusability
flexible
tight coupling
maintainability
You are writing out a CRC card for a bank machine component. Under which section should you put “Track Cash Remaining”?
Collaborator
Responsibility
Class
Risk
Which two of these are likely to be a part of conceptual design?
Mockups
Abstract data types
Methods
CRC Cards
When during the design process are you likely to produce CRC cards the most?
conceptual design
after releasing the software
customer meetings
technical design
An object which is responsible for showing data to the user could be considered which category of object?
control
representation
boundary
entity
What is a requirement of this form called? “As a ____, I want to ____, so that ____”.
conceptual mockup
user story
entity abstraction
key concept
You are a programmer creating software for a bank machine system. Which section of a CRC card for the bank machine component will the “User” go into?
Responsibility
Collaborator
Object
Class
Some of the earliest computing languages supported:
main program and subroutines
objects and classes
abstract data types
local variables
Sam identified the important attributes and behaviours of a delivery driver and exposed some of them to other classes. Which OOP concept best describes this?
decomposition
encapsulation
generalization
abstraction
Which keywords allow your classes to achieve polymorphism in Java? (Choose two)
implements
interfaces
inherits
extends
Which is the proper way to show an abstract method in a UML class diagram?
abstract anOperation()
«anOperation()»
#anOperation()
anOperation()
Which relationship best describes the relationship between a Chair and its Legs?
association
aggregation
composition
formation
Which is the most desirable?
high cohesion, tight coupling
low cohesion, tight coupling
high cohesion, loose coupling
low cohesion, loose coupling
Information Hiding is closely related to which OOP principle?
generalization
abstraction
decomposition
encapsulation
During model checking, what is the name for a violation of the desired properties of the model?
Counterexample
Error
Model Gap
Redevelopment
When two processes cannot run because they are waiting on the same resource, it is called:
Deadlock
Transition lock
Mutual lock
State lock
You create an object that represents a user and stores their preferences. What kind of object is this?
boundary
entity
control
client
You create an object that represents a dialog box with buttons and text fields. What kind of object is this?
entity
display
interaction
control
boundary
You create an object that compares values and updates one of them. What kind of object is this?
entity
control
repository
update
Which of these is an example of a quality tradeoff?
Not delivering key features so deadlines can be met
Limiting features knowing they can be added later
Adding security knowing it will reduce speed
Adding preferences for switching features
What is the term for reducing a class or object to its inputs and outputs in modelling?
black box thinking
pipe thinking
process thinking
filter thinking
Which one of these classes is in most need of being decomposed?
Student
Store
Book
Order
Which design principle enables developers to follow D.R.Y. (“Don’t Repeat Yourself”)?
generalization
decomposition
abstraction
encapsulation
Select the object pairing that has an association relationship:
Hiker – Trail
Coffee – Water
Book – Page
Tree – Root
Select the object pairing that has an aggregation relationship:
Book – Page
Pie – Crust
Stapler – Staple
Car – Road
Select the object pairing that has a composition relationship:
Tea – Sugar
Book – Page
Record Player – Record
Bear – Forest
How can you apply the principle of Separation of Concerns in OOP?
Split developers into teams
Separate data and methods
Ensure classes are only concerned with their own data
Separate objects or components according to their role
Which of these violates Liskov’s Substitution Principle?
the superclass is too general
an operation in the superclass is replaced by a different operation in the subclass
subclasses specify abstract methods
the subclass adds behaviour
For which of these situations would you use a sequence diagram?
To show the collaborative behaviour of objects
To show different modes of the program
To show all processes
To show class relationships
What is an abstract data type?
a type of data defined by the developer rather than the language
a data-centric class
variables that are assigned a type but do not yet have a value
a data type that cannot be used directly but must be implemented as an interface
When is the best time to use a design pattern? (Choose 2)
For a problem that is unique to your program
For a commonly encountered issue
When fixing spaghetti code
When explaining a solution to your fellow developers
What does it mean to “let the subclass decide” in the Factory Method Pattern?
the subclass decides which object to create but calls a superclass method
the subclass passes a parameter to determine which object is created
the subclass defines the methods for concrete instantiation
What do we call the creation of an object, for example with the new operator in Java?
object realization
class creation
concrete instantiation
manifestation
Which of these is NOT a common application of the Proxy Pattern?
information proxy
virtual proxy
remote proxy
protection proxy
How does a Decorator Pattern work?
adding features to a class with a new class
expands methods with inheritance
encapsulates a class to give a different interface
builds behaviour by stacking objects
What object types are used in the Composite Pattern? (Choose 2)
root
trunk
composite
branch
leaf
What is the correct situation for using Chain of Responsibility?
multiple objects contribute to one response
multiple potential handlers, but only one handles the request
pass a message to multiple receivers
delegate tasks to a hierarchy
What design principles does the Command Pattern use?
Encapsulation, generalization, loose coupling
Encapsulation, generalization, information hiding
Encapsulation, information hiding, loose coupling
Generalization, information hiding, loose coupling
When are you most likely to need a Mediator pattern?
to de-couple a requester and provider
when one of several handlers may handle a request
when connecting two different interfaces
when coordinating activities of related classes
Which pattern fits a fixed sequence of steps with varying implementations?
Template pattern
Mediator pattern
Command pattern
State pattern
What are the important roles in the Command Pattern?
Command, Queue, Receiver
Command, Receiver, Invoker
Sender, Receiver, Invoker
Delegate, Command, Requester
Which pattern arranges interacting machine components and sensors?
Template
Command
Mediator
Chain of Responsibility
Which pattern models different modes (normal, lockdown, open)?
Template
Mediator
State
Observer
Mailbox notifies owner when new mail arrives. Which pattern?
State
Observer
Command
Mediator
Select the two elements of the Open/Closed Principle:
Open for modification
Closed for extension
Open for maintenance
Open for extension
Closed for modification
Best description of Dependency Inversion Principle:
Clients depend on an Adapter
Clients depend on generalizations instead of concrete objects
Services subscribe as Observers
Clients depend on a service interface directing requests
Composing Objects principle — which is true?
The first statement is true
The second statement is true
Neither is true
Both are true
How can comments be a code smell?
Too many comments increase compile size
Explaining design rationale
Excessive comments can hide bad code
They can’t be a code smell
What is Primitive Obsession?
many low-level objects without OO principles
overuse of primitive data types
using many different primitive types
using key-value pairs instead of ADTs
