Font size
WorksheetsSoftware Design Quiz
Total questions: 103
Worksheet time: 52mins
Which of these are desirable characteristics of a software design? Choose the three correct answers.
reusability
flexible
maintainability
tight coupling
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
Class
Risk
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 put them all into a DeliveryDriver class, like "takeOrder", "deliverOrder", and "DeliveryArea." She exposed some of these to other classes. She just demonstrated an important part of object-oriented design. Which of these concepts best describes what you did?
decomposition
encapsulation
generalization
abstraction
Which keywords allow your classes to achieve polymorphism in Java? Choose the 2 correct answers
implements
interfaces
inherits
extends
Which is the proper way to show an abstract method in a UML class diagram?
abstract anOperation()
anOperation()
#anOperation()
"anOperation()"
There are three different relationships that objects can have. Which of these 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 one of the core design principles of object-oriented design. Which one?
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's called…
Deadlock
Transition lock
Mutual lock
State lock
You create an object that represents a user, storing important information about them such as their preferences. What kind of object is this?
boundary
entity
control
client
You create an object that represents a dialog box. It creates buttons and text fields, etc, for the user to interact with, and it logs those interactions. What kind of object is this?
entity
display
interaction
control
boundary
You create an object that compares values from two different sources. It then updates the smaller value to be equal to the larger one. 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 that deadlines can be met
Limiting features knowing that they can be added later
Adding security knowing it will reduce speed
Adding preferences that allow users to switch some features on and off
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 the guideline 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 object-oriented programming?
Split developers into teams that each deal with different parts of the software
Separate data and actions (methods) into different classes
Ensure classes are only concerned with their own data
Separate objects or components according to their role in the software
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 the abstract methods of the superclass
the subclass adds behaviour
For which of these situations would you use a sequence diagram?
To show the collaborative behaviour of objects in your program.
To show the different modes that your program can be in.
To show all the different processes of your program.
To show the relationship between classes
When is the best time to use a design pattern? (Choose 2 answers.)
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 method that is defined in the superclass to instantiate the class
the subclass will pass a parameter into a factory that determines which object is instantiated
the subclass defines the methods for concrete instantiation. As such, the type of object is determined by which subclass is instantiated
the subclass chooses the parent class at runtime
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? (Choose one.)
adding features to a class with a new class
expands the methods of a class with inheritance
encapsulates a class to give it a different interface
builds a behaviour by stacking objects
What are the object types that are used in the Composite Pattern? (Select the two correct answers.)
root
trunk
composite
branch
leaf
What is the correct situation for the use of a Chain of Responsibility pattern?
You need a set of objects to each contribute information on responding to a request
You have multiple potential handlers, but only one will deal with the request
You need to pass a message to multiple receivers
You need to delegate a set of tasks to a hierarchy of objects
What design principles is the Command Pattern using?
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?
When you want to de-couple a class that is requesting a service from one that is providing it
When your class is sending a request that might be handled by one of several handlers.
When you have two classes with different interfaces that you must connect
When you are coordinating the activities of a set of related classes
Marlon is coding part of the software that follows a similar sequence of steps. Depending on the type of object, these steps will be implemented in slightly different ways, but their order is always the same. Which design pattern could Marlon use?
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
You have a machine performing a complex manufacturing task, with different sensors and different components of the machine represented by different classes. Which design pattern will you use to arrange the parts?
Template
Command
Mediator
Chain of Responsibility
You have a security system class, and it has 3 modes: normal, lockdown, and open. Which pattern would you use to model the behaviour in these different modes?
Template
Mediator
State
Observer
One of your classes represents a mailbox, while another is the owner of the mailbox. The person would like to know when new mail arrives. Which design pattern will you probably use?
State
Observer
Command
Mediator
What is the best description of the Dependency Inversion principle?
Client objects depend on an Adaptor Pattern to interface with the rest of the system
Client objects depend on generalizations instead of concrete objects
Service objects subscribe to their prospective client objects as Observers, watching for a request
Client objects are dependent on a service interface that directs their requests
Which of these statements is true about the Composing Objects principle? 1. it provides behaviour with aggregation instead of inheritance 2. it leads to tighter coupling
The first statement is true
The second statement is true
Neither statement is true
Both statements are true
How can Comments be considered a code smell?
Too many comments make the files too large to compile
When a comment is used to explain the rationale behind a design decision
Excessive commenting can be a coverup for bad code
They can’t! Comments help clarify code
What is the primitive obsession code smell about?
Code that contains many low-level objects, without using OO principles like aggregation or inheritance
Overuse of primitive data types like int, long, float
Using many different primitive types instead of settling on a few that together capture that appropriate level of detail for your system
Using key-value pairs instead of abstract data types
You have a class that you keep adding to. Whenever you add new functionality, it just seems like the most natural place to put it, but it is starting to become a problem! Which code smell is this?
Long Method
Large Class
Divergent Change
Speculative generality
Why is it important to avoid message chains whenever possible?
They lower cohesion in your class
The resulting code is usually rigid and complex
It's a workaround to get to private methods, which are important for encapsulation
If an unexpected object is returned, this could easily lead to runtime errors
Since his app does not have that feature yet, Deck has only one subclass, RegularDeck. What code smell is this?
Divergent Change
Refused Bequest
Primitive Obsession
Speculative Generality
Mohsin needs to create various user objects for his University learning platform. What is the act of creating an object called?
object invocation
object realization
concrete instantiation
class creation
What is the difference between the Factory Method and a Simple Factory?
In Factory Method, concrete instantiation is done in a designated method, where a Simply Factory creates objects for external clients
A simple factory instantiates only one kind of object.
In the factory method pattern, the factory itself must be instantiated before it starts creating objects. This is usually done with a dedicated method
Simple factories cannot be subclassed
José wants to build behaviours by stacking objects and calling their behaviours with an interface. When he makes a call on this interface, the stack of objects all perform their functions in order, and the exact combination of behaviours he needs depends what objects he stacked and in which order. Which Design Pattern best fits this need?
Factory Method Pattern
Singleton Pattern
Composite Pattern
Decorator Pattern
You need to connect to a third-party library, but you think it might change later, so you want to keep the connection loosely coupled by having your object call a consistent interface. Which Design Pattern do you need?
Proxy
Facade
Adapter
Decorator
Which of these design principles best describes the Proxy pattern?
encapsulation, because the Proxy hides some of the detail of the subject
separation of concerns, because the Proxy object has different concerns from the subject
generalization, because a proxy is a general version of the real subject
decomposition, because the Proxy object has different concerns than the subject
Ashley has a method in her class that needs to makes a request. This request could be handled by one of several handlers. Which design pattern does she need?
Facade
Decorator
Chain of Responsibility
Which of these is NOT a good use of the Command pattern?
Sending a command to a third-party service or library
Supporting undo/redo queues of commands
Building a user-interface that can be used to perform operations
Building macros, for example in an image manipulation program
Which code smell may become a problem with the Mediator design pattern?
Inappropriate Intimacy
Speculative Generality
Refused Bequest
Large Class
Which of these methods is found in a typical Observer class?
notify()
addObserver()
getState()
update()
In the MVC Pattern, which of these is usually made into an Observer?
Model
Back-End
View
Controller
Which of these answers does NOT accurately complete the following sentence? “A class is considered closed to modification when…
...all the attributes and behaviours are encapsulated
...its collaborators are fixed
...it is tested to be functioning properly
...it is proven to be stable within your system
How does the Dependency Inversion Principle improve your software systems?
Client classes become dependent on low-level concrete classes, rather than dependant on high-level generalizations
Dependency becomes inverted by having the system depend on the client classes
Client classes become dependent on high level generalizations rather than dependant on low level concrete classes
Client classes use an adapter to facilitate communication between itself and the rest of the system
Allison has a search algorithm, and she would like to try a different implementation of it in her software. She tries replacing it everywhere it is used and this is a huge task! Which design principle could Allison have used to avoid this situation?
Don't Repeat Yourself
Composing Objects Principle
Principle of Least Knowledge
Dependency Inversion
Which object-oriented design principle do Long Message Chains, a code smell, usually violate?
Cohesion
Separation of Concerns
Open/Closed Principle
Principle of Least Knowledge / Law of Demeter
What are the components of the MVC pattern?
Model, View, Command
Model, View, Controller
Member, Vision, Controller
Model, Vision, Command
Interface Segregation is a good way to avoid which code smell? Choose the best possible answer.
Switch Statements
Refused Bequest
Divergent Change
Long Method
Read the following statements. Which of them are true? 1. Project managers are stakeholders in the architecture 2. End users are stakeholders in the architecture
Both statements are true
Only the first statement is true
Neither statement is true
Only the second statement is true
Which of these UML diagrams might be useful for the logical view of a system? Select the 2 correct answers.
Deployment diagram
Class diagram
Sequence diagram
State diagram
You need to show how your software elements are mapped to hardware nodes and execution environments. Which view do you need?
development view
physical view
scenario
process view
What is the name for a physical result of the development process, such as an executable file?
package
leaf
artifact
node
What does the component of ‘component diagram’ refer to?
the basic parts of the software, which it could not run without
an independent, encapsulated unit in the system
an external part of the software system, like a library that must be imported
a general name for a "part" of the software system. It could be a method, variable, class, object, or grouping of any of these
Guidelines such as "the system should be easy and intuitive to learn", "the system should minimize user errors," and "the system should make it easy for users to complete tasks" fall under which category of quality attribute?
usability
intuitiveness
astonishment
complexity
Calum is leading a team of developers and would like to promote conceptual integrity. Which of these is NOT a way he could promote conceptual integrity:
Split the development team into subteams for each component of the architecture
Do regular code reviews with the development team
Establish conventions, such as structural rules or naming conventions
Adopt good documentation practices
Who are the three main groups of people involved in the architecture tradeoff analysis method?
clients, designers, stakeholders
peers, outsiders, designers
evaluation team, outsiders, project team
evaluation team, project decision makers, architecture stakeholders
Leon is analyzing the architecture and notices that under conditions of high numbers of users signing on at the same time, there is a potential that one of the architecturally significant requirements (ASRs) will not be met. What is this called?
tradeoff
risk scenario
utility shortfall
non-risk scenario
Maddie's software team is split into two subteams working on two different components that work together. These teams share one large room and are in constant contact. According to Conway's Law, what could happen if Maddie does not physically separate the two subteams?
The component interfaces will not be reusable
They will not leave sufficient comments, thinking that the other team already knows the relevant details
Their components will repeat code unnecessarily
The components they produce will be very tightly coupled
Which of these is NOT a typical advantage of developing a product line?
greatly reduced up-front development
overall cost reduction
consistency over the product line
reducing time-to-market of later products
Andy is planning the development of a product line of eBook readers and he has to categorize the components that will be handled by each team. There is one product in the line which has a backlight for reading during the night. In the development process, where would you categorize this feature?
Product-Specific
Commonality
Variation
One-Off
Which of these views show the functional design of the software, usually in the form of objects and the relationships between them?
physical view
process view
development view
logical view
To which view would the Package Diagram belong? Remember that a package diagram shows the packages that make up a software and how they are related.
process view
logical view
development view
physical view
Which of these statements about Component Diagrams is true?
They are useful for clarifying the artifacts that will be produced from development
They clarify dependency relationships
They give a dynamic view of the system
They do not show third-party libraries
Which of these will you NOT find in a deployment diagram?
component
device
class
artifact
library
What is an artifact?
A physical realization of a software component
A part of a device that is nonetheless important to depict on the deployment diagram, like a hard drive
An unintended effect that the software has on the device.
Part of the development process that is important to the developers, but not the end-users
What is an abstract data type?
A data schema that is defined by the developer
A data type that dynamically allows the storage of different primitives
An interface that defines how to store data in a class
A data type that is not actually storing data; instead, it is used to define interfaces
Select the one accurate statement about layered architecture:
Passthrough should be avoided at all costs
Enforcing communication only between adjacent layers and within a layer is key to good, layered architecture
Upper layers act as service providers to lower layers
Layered architecture is often based on layers of abstraction
What is the correct term for a machine that hosts a server?
server-tier
Called by type: e.g. print server or media server
server-host
server-machine
Some programs allow users to record a sequence of inputs - for example keyboard and mouse inputs - to run later. What are these called?
user recorders
scripts
macros
input listeners
Data Flow Architecture is also called...
Data Transformation Architecture
Pipe and Filter Architecture
Cascade Architecture
Black Box Architecture
Which of these is NOT a common component of event-driven architectures?
event generator
event processor
event consumer
event bus
Which of these is a drawback of n-Tier architecture?
Every tier demands extra resources to manage the client/server relationships
More hardware nodes are necessary
Only asynchronous messaging is possible, leading to challenging development decisions
Limited in scale
Which of these is NOT an example of Interpreter type architecture?
Excel formulas
Java Virtual Machine
Scripting and Macros
The kernel of an operating system
Which of these terms matches this definition: “The amount of time the system is operational over a set period of time?”
availability
interoperability
usability
performance
Which of these quality attributes is most important from the developer's perspective?
availability
security
usability
flexibility
General quality attributes like performance and security have more specific components like throughput and latency for performance. What are these called?
architecturally significant requirements
sensitivity points
attribute refinement
architecture specifications
Which strategy is NOT part of delivering a high-quality system?
Treat all quality attributes as equally important
Involve all stakeholders in design
Adopt good documentation practices
Set rules for design and implementation
True or False: You should focus on situations that are outside the normal execution path when building a quality attribute scenario.
True
False
"Maintenance Downtime" is an attribute refinement of what quality attribute?
Performance
Conceptual Integrity
Maintainability
Availability
Eliza is planning a product line of media boxes. Some of these will connect to traditional television lines, whereas others will only have internet media like video-streaming services. What is this type of difference between products called?
Extension
Variation
Product-Specifics
Adaptation
Which type of process control that we discussed is typically needed for complex systems?
Feedforward Control + Feedback Control
Feedforward Control
MAPE-K
Machine Learning
Which of these is NOT shown on an activity diagram?
activities
interfaces
decisions
concurrency
Which of these sets of keywords might be used on the lines in package diagrams?
deploy, merge, include
request, import, merge
interface, export, load
merge, access, import
Select the two elements of the open/closed principle:
Open for modification
Closed for extension
Open for maintenance
Open for extension
Closed for modification
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 (i.e. integer, double) but does not yet have a value assigned
a data type that cannot be used directly but must be implemented as an interface
