0% found this document useful (0 votes)
18 views18 pages

2212 - Practice Final

Uploaded by

joudallahham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views18 pages

2212 - Practice Final

Uploaded by

joudallahham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

CS2212A Final Examination – December 16, 2019 Page 1 of 18

THE UNIVERSITY OF WESTERN ONTARIO


LONDON CANADA

COMPUTER SCIENCE 2212A


FINAL EXAMINATION
DECEMBER 16, 2019
3 HOURS

I want out of this course please...


NAME: ______________________________________________

STUDENT NUMBER: __________________________________

Question

1-20. ________

21. ________

22. ________

23. ________

24. ________

25. ________

26. ________

27. ________

28. ________

29. ________

30. ________

31. ________

32. ________

33. ________

34. ________

35. ________

36. ________

TOTAL _________

(Out of 180 marks)


There are no cheat sheets, books, or other reference materials allowed for this exam. No calculators or other
electronic devices are permitted either.
CS2212A Final Examination – December 16, 2019 Page 2 of 18

Part I -- Multiple Choice, True/False -- Choose the best answer from the choices given.
Circle your answer on the paper. [40 marks total, 2 marks each]

1. Software is:
a. Instructions (computer programs) that when executed provide desired
features, function, and performance.
b. Data structures that enable programs to adequately manipulate information.
c. Documentation that describes the operation and use of programs.
d. All of the above.
e. None of the above.

2. Which of the following is an organization for software professionals operating


specifically in Canada:
a. IEEE.
b. ACM.
c. ISO.
d. OMG.
e. None of the above.

3. As discussed in class, there are five key activities applicable to all software
projects. Which of the following is the proper sequence for these activities?
a. Planning, communication, modeling, deployment, construction.
b. Communication, planning, modeling, deployment, construction.
c. Planning, communication, modeling, construction, deployment.
d. Communication, planning, modeling, construction, deployment.
e. None of the above.

4. A software system exists for one reason: to provide value to its users.
a. True.
b. False.

5. If a project falls behind schedule, more programmers can be added to the project to
enable it to catch up.
a. True.
b. False.

6. The simplest and oldest paradigm for software engineering is:


a. The agile model.
b. The incremental model.
c. The spiral model.
d. The waterfall model.
e. None of the above.
CS2212A Final Examination – December 16, 2019 Page 3 of 18

7. Which of the following is not a trade-off proposed by the manifesto for agile software
development?
a. Individuals and interactions over processes and tools.
b. Working software over comprehensive documentation.
c. Customer collaboration over contract negotiation.
d. Careful planning over chaotic disorganization.
e. All of the above, in fact, are part of the manifesto for agile software development.

8. Kanban was originally developed by:


a. NASA for planning rocket launches in the Apollo lunar program.
b. Toyota for just-in-time manufacturing.
c. IBM for its MVS mainframe operating system.
d. Tropicana for production of oranges for orange juice.
e. None of the above.

9. Which of the following statements about software requirements is false?


a. A requirement is a short and concise piece of information.
b. Requirements say something about the software.
c. Requirements are dictated by the customer.
d. Requirements help solve the customer’s problems.
e. All of the above, in fact, are actually true statements about requirements.

10. Use case diagrams are a visual way of capturing all of the details of a use case.
a. True.
b. False.

11. Which of the following cannot be captured in a UML class diagram?


a. Inheritance between classes.
b. Multiplicity in relationships.
c. Transient dependencies.
d. Visibility of attributes and operations.
e. All of the above, in fact, can be captured in a UML class diagram.

12. Flowcharts were initially created to assist with modeling processing on early
mainframe computers in the 1940’s and 1950’s.
a. True.
Flowcharts are one of the oldest forms of diagrams used in computing,
b. False. originating in 1921 as the "flow process chart" by Frank and Lillian Gilberth
CS2212A Final Examination – December 16, 2019 Page 4 of 18

13. Consider the following state diagram for processing comments in Java:

Suppose a code file began with /* This is my file. */ What state


would the system be in after processing the last / of this comment?
a. start
b. saw ‘/’
c. block comment
d. saw ‘*’
e. line comment

14. The FURPS software quality attributes introduced by Hewlett-Packard are:


a. Functionality, usability, reliability, performance, supportability.
b. Features, usability, robustness, performance, supportability.
c. Functionality, understandability, robustness, performance, supportability.
d. Features, understandability, robustness, performance, supportability.
e. None of the above.

15. It is desirable for a software design to exhibit:


a. Low coupling and low cohesion.
b. Low coupling and high cohesion.
c. High coupling and low cohesion.
d. High coupling and high cohesion.
e. None of the above.
CS2212A Final Examination – December 16, 2019 Page 5 of 18

16. Suppose you were creating a software system using a collection of Unix shell
scripts and command line programs, connected together with pipes. This system
would be following which architectural style as discussed in class:
a. A data-centered architecture.
b. A data flow architecture.
c. A call and return architecture.
d. A layered architecture.
e. None of the above.

17. In the context of object-oriented software engineering, a component is always a


single class.
a. True.
b. False.

18. Which of the following is not a consideration in user interface design of software:
a. Are users of the software being compensated for the work being performed
with the software?
b. What tasks and subtasks will the user perform in their work?
c. In what environment is the software being used?
d. How will error messages and warnings be presented to the user?
e. All of the above, in fact, are considerations in user interface design.

19. Technical reviews are:


a. A meeting conducted by technical people for technical people.
b. A project summary or progress assessment.
c. A technical assessment of a work product.
d. Both a) and c) are true.
e. All of the above are true.

20. In most cases, the least efficient approach to debugging software is:
a. Brute force.
b. Backtracking.
c. Cause elimination.
d. Enlisting help.
e. None of the above.
CS2212A Final Examination – December 16, 2019 Page 6 of 18

Part II -- Short Answer -- For the following questions, write your answer in the space
provided, using diagrams as appropriate. You do not need to write full sentences, and can
use point form if that is your preference. [54 marks total]

21. What is meant by the term “legacy software”? Why is such a large volume of
legacy software still in use today? [4 marks]

Legacy software is critical software that is still in use to this day. Sometimes it is kept as it is, sometimes
showing its age, but other times it is simply hidden under a newer layer.

As mentioned above, most legacy software are critical to the way some things operate and as such
must be dealt with and maintained to keep up their usage due to their importance. For example, a
company that has been running on Ruby simply cannot switch over to another language because their
entire infrastructure runs on Ruby which means that a drastic change like that is not financially or
logically reasonable. It's as if you took a house and broke it down to replace the bricks; it's going to cost
time, money and other resources for the company. Thus it would be a smarter choice to maintain
business continuity and continue using Ruby as their software programming language to uphold their
already built and maintained infrastructure.

22. As discussed in class, in the classic book, “How to Solve It”, George Polya outlined
the essence of problem solving and, unknowingly, software engineering practice as
well. Identify Polya’s four steps to problem solving and explain how these steps
relate to software engineering practice. [8 marks]

Polya's 4 Steps:

1. Understanding the problem. The software engineering equivalent would be the requirement
analysis phase where the developers must first contemplate the problem at hand and work to
create a detailed list of user needs as well as functional requirements.

2. Devising a Plan: This corresponds to the designing phase. Once the requirements are
understood and taken into account, now comes the planning/designing phase.

3. Carrying Out the Plan: This aligns with the implementation phase where developer write the code
based off the requirements analysis + the plan/design they decided on.

4. Reflecting on the Solution: This step is analogous to testing and maintenance phases. After
implementing in the previous step, tests must be done to assure a high quality product. Through
feedback, maintenance ensures that the software remains effective in its 'goal to achieve'.
CS2212A Final Examination – December 16, 2019 Page 7 of 18

23. It has been written that the key attributes of an effective software team include a
sense of purpose, a sense of involvement, a sense of trust, a sense of improvement,
and a diversity of team member skill sets. Select two of these qualities and justify
how those qualities contribute to software team effectiveness. [4 marks]

B.S this part lmfao

24. In class, on numerous occasions, we discussed how divide and conquer can be an
effective strategy to be leveraged during software development. Identify and
discuss one situation that can arise during software development in which divide
and conquer can help lead to an effective solution. [4 marks]

The example I'd like to use is from the project we had to complete this semester in which the back end and front-
end was divided up based on each person's comfortability with the previously mentioned divisions. Those with
experience building a more stripped down version of a dictionary were tasked with handling the functionality of
how words would be detected, how to store the messed up words, etc. Those who were more comfortable learning
Java Swing did the GUI portion. As such this sped up our workflow, covering for each other in our respective divisions
in case someone needed help with a component. All's this to say that when a diverse group is brought together, their
comfort with certain things versus others can be a very handy way to split up workload in order to 'divide and conquer'.
CS2212A Final Examination – December 16, 2019 Page 8 of 18

25. Fred Brooks once said, “The hardest single part of building a software system is
deciding what to build. No part of the work so cripples the resulting system if done
wrong. No other part is more difficult to rectify later.” Explain why this statement
is true in practice. [4 marks]

When the vision for a piece of software is not clear and there's no sense of purpose, it becomes a detriment to
team morale as well as their willingness to give their best effort for the project. When you're not building with a
clearly laid out plan, things go unaccounted for thus resulting in a significantly worse end result than a team who's
idea and subsequent plan was well laid out with a good amount of passion and dedication supporting them would
make a far superior product in terms of quality. That at the end of the day is what's most important. If you do not have
a solid ideation, everything else crumbles.

26. What is the difference between functional and non-functional software


requirements. Provide an example of a functional requirement and a non-
functional requirement from your group project for the course. [6 marks]

Functional Requirements:
These are requirements that are necessary in order for the software you're creating must have in order to serve its
purpose. From our project, I can draw the example of Error Detection. For a spell checker application, it goes without
saying that it needs a function that catches errors in the document uploaded by the user. This is a required feature that
must be implemented in order to accomplish the goal of creating a spell checker application.

Non-Functional Requirements:
These are requirements that don't necessarily involve implementing features into a piece of software, rather it serves as
parameters that the engineer needs to build an application as it was requested. Looking at our group project, one of the
first non-functional requirements that we are given is that the application must be developed in Java and Java Swing which
is the GUI builder. This doesn't tell us to incorporate any specific features but instead gives us a parameter that must be
met in order to build the application as per the "customer's" request.
CS2212A Final Examination – December 16, 2019 Page 9 of 18

27. Explain how a “grammatical parse” of usage scenarios can assist in a class-based
approach to requirements modeling. Be sure to consider all relevant parts of speech
(e.g. nouns, verbs, etc.) and how they can be used in the process. [6 marks]
In the context of requirements modeling, a grammatical parse of usage scenarios can be a valuable tool in a class-based approach.
Let's break down the elements involved:

1. Nouns (Objects/Classes): In a class-based approach, nouns often represent objects or classes in the system. By identifying nouns in
usage scenarios, you can determine determine potential classes or objects that need to be modeled. For example, if a scenario
mentions a 'customer,' it suggest the existence of Customer class.

2. Verbs (Actions/Methods): Verbs in usage scenarios often represent actions that the system needs to perform. These verbs can be
translated into methods or functions associated with the identified classes. If a scenario involves a "payment" action, it implies the
existence of a method like "processPayment" associated with a relevant class.

3. Adjectives (Attributes/Properties): Adjs in usage scenarios might describe properties or attributes of the identified classes. If a
scenario mentions a "fast processing" system, it suggests that a potential attribute like "processingSpeed" associated with a relevant
class.

4. Prepositions (Relationships): Prepositions can indicate relationships between classes. For example, if a scenario mentions "a
customer making a purchase," it suggests a relationship between the "Customer" class and the "Purchase" class

5. Adverbs (Constraints/Conditions): Adverbs may introduce constraints or conditions on actions. If a scenario includes "securely
process payment," it implies a constraint on the "processPayment" method, suggesting the need for security measures.

By performing a grammatical parse of usage scenarios, you can create an initial mapping of the language used in requirements to
potential classes, methods, attributes, and relationships in your system. This mapping can serve as a foundation for further analysis
and the development of a class diagram. The class diagram is a visual representation of the system's structure, depicting classes, their
attributes, methods and relationships.

In summary, grammatical parse bridges natural language requirements to a formal representation in a class-based modeling approach,
facilitating the translation of user needs into a structured and organized system design.

28. What is meant by the term “refactoring”? Why can refactoring be important to a software
project? Why is it of particular importance to agile software projects? [6 marks]

Refactoring: a reorganization technique that simplifies the design (or code) of a component without changing its function or behavior.

Refactoring can be an important design activity for many agile methods to ensure a sound design frequent additions, modifications, and
evolutions.

When software is refactored, the existing design is examined for:


- Redundancy
- Unused design elements
- Inefficient or unnecessary algorithms
- Poorly constructed or inappropriate data structures
- Or any other design failure that can be corrected to yield a better design.
CS2212A Final Examination – December 16, 2019 Page 10 of 18

29. In class, we identified three “Golden Rules” of user interface design. Identify the
three rules and justify why following each rule is important. [6 marks]

Three "Golden Rules" of UI design:

1. Place the user in control


2. Reduce the user's memory load
3. Make the interface consistent

1. The principles outlined emphasize user-friendly interaction design by avoiding unnecessary actions, promoting flexibility, enabling
interruption and undoing, adapting to varying skill levels, customization options, shielding technical complexities, and facilitating direct
interaction with on-screen objects. In essence, the goal is to create a seamless and adaptable user experience that accommodates
different preferences and skill levels while keeping technical details discreet.

2. The summarized principles for user interface design include minimizing reliance on short-term memory, using meaningful defaults,
employing intuitive shortcuts, adopting real-world metaphors for visual layout, and progressively disclosing information - from a
high-level overview to detailed specifics based on user interest. These guidelines aim to enhance user experience by reducing
cognitive load, providing familiar cues, and presenting information in a user-friendly and progressively revealing manner.

3. Maintaining consistency in the interface by organizing visual information and input mechanisms according to established design
rules. It highlights the importance of allowing users to place tasks in a meaningful context, implementing consistent navigation
mechanisms between tasks, ensuring uniformity across a family of applications, and avoiding unnecessary changes to past
interactive models unless there are compelling reasons to do so. Overall, these guidelines aim to create a cohesive and predictable
user experience across the entire application. Basically, if it ain't broke don't fix it.

30. What is meant by the term “good enough software”? What are the arguments for and
against this approach to software quality? [6 marks]

"Good Enough Software": Good enough software delivers high quality functions and features that end-users desire, but at the
same time it delivers other more obscure or specialized functions and features that contain known bugs. "You got what you
wanted, but it's not totally polished, my bad"

Argument for "Good Enough Software": The hope is that the vast majority of end users either will miss the bugs or will overlook
them as they are otherwise very satisfied with what the software delivers.

Argument against "Good Enough Software": If you work in certain application domains (e.g., real time embedded software),
application software that is integrated with hardware can be negligent and open your company expensive litigation. In some
cases, it can even be criminal. For example, no one wants good enough aircraft avionics software.
CS2212A Final Examination – December 16, 2019 Page 11 of 18

Part III -- Long Answer -- For the following questions, write your answer in the space
provided, using diagrams as appropriate. Again, you do not need to write full sentences,
and can use point form if that is your preference. [86 marks total]

31. In class, we compared the failure curve for hardware to the failure curve for
software. Reproduce these failure curves and discuss the differences between
hardware and software failures over time. Be sure to note the differences in actual
and idealized failure curves for software. [10 marks total]
Failure curve for software
Failure curve for hardware:
Increased failure rate due to side effects

Actual curve

Change
Idealized curve

Differences between Hardware and Software failure over time.

- During the beginning of their life cycle, both hardware and software see a steady decline in failure rate as revisions are
made and the technology is improved. They both plateau for a while until hardware experiences a rapid increase in failure
rate due to the worsening of the materials it's made of.

- As for the failure curve for software, there's two curves, one that is idealized and one that is more true to reality. Looking at
the idealized curve we see how software is meant to behave as time passes on, with each update reducing the failure rate
closer and close to zero. However, we then look at the actual curve and see that some changes that are made to the
software aren't necessarily good and could cause spikes in the failure rate leading to the blue graph above. All in all, the
increase in failure rate in software isn't nearly as bad as hardware since the factors leading to failure are very different.
CS2212A Final Examination – December 16, 2019 Page 12 of 18

32. In class, we introduced a number of prescriptive software models. This question


concerns the waterfall and evolutionary prototyping models. [14 marks total]
a. Provide diagrams, similar to those presented in class, depicting the various stages
and flows for each of the waterfall and evolutionary prototyping models. [10 marks]

Planning
Modeling

Communication

Construction
Deployment

Requirements
Waterfall Model

Design

Implementation

Testing
Maintenance

b. Provide two examples of software projects that would be amenable to the waterfall
model and two examples that would be amenable to the evolutionary prototyping
model. Be specific. [4 marks]

Waterfall model, 2 examples:

1. Developing firmware for a simple household appliance like a microwave oven


2. Creating a software to manage and report compliance with government regulations

Evolutionary Prototyping, 2 examples:

1. E-Learning Platform - The requirements of an e-learning platform might not be fully clear at the outset as user preferences
and educational methods can evolve. With evolutionary prototyping, an initial prototype can be quickly developed to showcase
basic functionality and user interfaces. Stakeholders, including educators and students, can then provide feedback, leading to
iterative refinements. This iterative process is valuable for adapting the system to changing educational needs and preferences.
2. Collaborative Project Management Tool - Create an initial prototype of such tool, then with feedback from stakeholders of
additional features needed to be implemented, the developers can add said features with constant feedback from usage can
inform them on successive iterations, ensuring the tool meets the evolving needs of the team.
CS2212A Final Examination – December 16, 2019 Page 13 of 18

33. In class, we also discussed a variety of agile approaches to software development.


This question focuses on the Scrum and Kanban approaches. [10 marks total]
a. Scrum is a common approach to agile software development. Draw a diagram similar
to the one presented in class depicting the key elements of the Scrum approach and
how these elements are connected and flow into one another. [5 marks]
Product Backlog:
Prioritized product features desired by the customer
Scrum: 15-min daily meeting
every 24 hours

30 Days

New functionality is demonstrated


Sprint Backlog: at end of sprint
Feature(s) assigned to sprint

b. A Kanban board is a common tool in agile development (we used this sort of thing in
Jira for our group projects, for example). Draw a diagram of a sample Kanban board
and describe how project tasks are tracked over time using the board. [5 marks]

Backlog Selected Analysis Development Testing Done


Tasks generally move from
Doing Done Doing Done L -> R in the board

- Backlog: Tasks waiting to


be selected for development

- Selected: Tasks selected


for development that are
waiting to be worked on

- Doing: Tasks that are


currently assigned, in
progress, and are being
worked on in some capacity
(e.g. analysis, development)

- Done: Tasks that have


been completed
Expedite Lane
This approach is flexible
and so organizations will
frequently have their own
columns and conventions
for their own business needs
CS2212A Final Examination – December 16, 2019 Page 14 of 18

34. Consider the following activities: [20 marks total]


• Making a withdrawal at an ATM.
• Using your debit or credit card to pay for a meal at a restaurant.
• Buying a stock using an online brokerage account.
• Searching for books on a specific topic using an online bookstore.

a. Develop a complete use case for one of the above activities. [5 marks]
Actor: User Priority: High

Description: The meal is done and User is preparing to pay the bill using When available: As soon as possible
either a debit or credit card.
Frequency of use: Only when at restaurant
Actor Type: Person, End User

Active/Passive

Use Case: Using your debit or credit card to pay for a meal at a restaurant

Primary Actor: User

Goal in context: To successfully use your debit/credit card to pay for a meal

Preconditions: User has debit/credit card, knows the PIN, restaurant has card
reading machine

Trigger: It is time to pay for the meal

Scenario:
1. User finishes meal
2. User requests for the bill and to pay by card
3. User then selects which card to use
4. User observes that the payment has been accepted.

Exceptions:
1. User has forgotten his/her cards
2. The restaurant is cash-only
3. PIN does not work
4. User lacks funds to pay for meal

b. Construct a use case diagram for the selected activity from part a). [4 marks]

User
CS2212A Final Examination – December 16, 2019 Page 15 of 18

c. Construct a UML activity diagram capturing the flow of interaction for the
selected activity from parts a) and b). [5 marks]

d. Construct a UML class diagram capturing the main entities for the selected activity
from parts a), b), and c). Be sure to include important classes (including key
attributes and operations) as well as appropriate relationships and associations
between the classes. [6 marks]
CS2212A Final Examination – December 16, 2019 Page 16 of 18

35. Consider the various stages of a software testing strategy. [16 marks total]
a. What is unit testing? Identify three different types of testing that are typically
performed during unit testing. [8 marks]

Unit Testing: 3 Types

In unit testing, testers assess the component, module, or class under testing by subjecting it to a number of
test cases and inspecting the results to see if the unit operating according to expectations.

1. Black-Box Testing: (AKA functional testing) focuses on the functional requirements of the software. B-B
testing techniques enable you to derive sets of input conditions that will fully exercise all functional
requirements for a program.

2. White-Box Testing: (AKA structural testing) It is a test-case design philosophy that uses the control
structure described as part of component-level design (and through coding) to derive test cases.

3. Boundary Condition Testing: Software often fails at its boundaries (e.g. at the beginning or end of
arrays, at the start or end of loops, or when maximum or minimum values are encountered). Test cases
that are exercise data structures, control flow, and data values just below, at, and just above maxima and
minima are likely to uncover errors.

b. What is integration testing? What are the differences between top down
integration testing, bottom up integration testing, and sandwich testing? [8 marks]

Integration Testing

Integration testing is a systematic technique for constructing the software architecture while at
the same time conducting tests to uncover errors associated with interfacing. The objective is
to take unit-tested components and build a program structure that has been dictated by
design.

Top Down I.T : In this approach to incremental integration, modules are integrated by
moving downward through the control hierarchy, beginning with the main control module
(or main program)

Bottom Up I.T : In this approach to incremental integration, construction and testing begins
with atomic modules (i.e., components at the lowest levels in the program structure).
Because components are integrated from the bottom up, the functionality provided by
components subordinate to a given level is always available and the need for stubs is
eliminated.

Sandwich Testing: Combines both top down and bottom up strategies. Higher levels of the
program structure are integrated top down. Lower levels of the program structure are
integrated bottom up into clusters. These elements are then integrated together.
CS2212A Final Examination – December 16, 2019 Page 17 of 18

36. In class, we discussed white box and black box approaches to testing. [16 marks total]
a. What do white box and black box testing entail? How do these approaches differ from
one another? [6 marks]

White Box testing uses the source code to devise test cases based off the understanding
of the internal code paths. Black box testing however, simply tests the functionality and
behavior of the end product as it has no access to the source code. It simply just tests if the
program can do what it promised to do based off the functional specifications and expected
external behavior.

White Box: Internal perspective, understanding the code's workings


Black Box: External perspective, treating the system as a closed box with inputs and
outputs

b. Should white box and black box testing be used together, or should developers choose
between the two approaches. Justify your answer. [4 marks]

Ideally, developers should be using both White and Black box testing in order to
leverage the strengths of each test respectively to identify a wider range of defects.

This ensures both internal quality and external functionality meet the desired
requirements.

c. Identify one white box and one black box testing technique discussed in class, and
briefly describe how each approach works. [6 marks]

White Box Testing Technique: Basis Path Black Box Testing Technique: Interface Testing

The basis path method enables test-case designers to Interface testing is used to check that a program
derive a logical complexity measure of a design and use component accepts information passed to it in the proper
this measure as a guide for defining a basis set of order and data types and returns information in proper
execution paths. order and data format.

Test cases derived to exercise the basis set are Again, components are not stand-alone programs and so
guaranteed to execute every statement in the program at testing interfaces requires the use of stubs and drivers.
least one time during testing.
CS2212A Final Examination – December 16, 2019 Page 18 of 18

This page has been left intentionally blank. Use it as additional workspace or extra space for
answers if necessary.

You might also like