midterm1S23
midterm1S23
Name:
Signature:
This exam is open course web page, open Ed, open notes, open slides, open your assignment solutions
and open calculator, but closed everything else (e.g., consulting with others and searching online are not
permitted). You have 2 hours in a single sitting to complete the exam. Read the problem descriptions
carefully and write your answers clearly and legibly in the space provided. Circle or otherwise indicate your
answer if it might not be easily identified. You may use extra sheets of paper, stapled to your exam, if you
need more room, as long as the problem number is clearly labeled and your name is on the paper. If you
attached extra sheets indicate on your main exam paper to look for the extra sheets for that problem.
1
Page 2 of 8
Question 1. User stories
You are developing a web application for managing a library. When interviewing stakeholders, multiple
individuals described presenting an alert in the user interface when a patron has books due within the
next week. Write two I.N.V.E.S.T. user stories, one from the perspective of a library patron, the other
from the perspective of a librarian working at the circulation desk. Your user stories will be evaluated
on format and quality.
(a) Library patron:
Write the expected output for left-side code below on the left If the right-side code produces the same
result indicate below, otherwise provide the expected output below on the right.
});
afterEach(() => {
});
test("Duplicate title shows error feedback, () => {
});
});
Page 5 of 8
Question 4. Scenarios
Imagine you are writing a React implementation of a blog. The Post component will either show a short
version of the post truncated after the first sentence, or the full post. In the truncated view the user can
click on a ”Show more” button to show the article and in the full view click on the ”Show less” button
to truncate the test. Write a Gherkin-style test scenario that covers this behavior. You do not need to
provide the implementation details of the tests, just describe the scenario for the test.
Question 5. React
You are implementing the following view for a simple To-Do tracking application with React. Outline
and label the wireframe (below, left) with a possible set of components. Label the tree (below, right)
with components to show the hierarchy. Further label the tree nodes with state implemented in that
component and label the tree edges with props passed to each component (similar to figure in program-
ming assignment 2). The top-level component ToDoTracker is labeled for you. Any implementation
reflecting good React practices will be accepted. You may not need all the nodes in the tree; cross out
any unused nodes. Your component, state and prop names should be sufficiently descriptive that their
role is clear.
ToDoTracker ToDoTracker
Add to-do
Page 6 of 8
Question 6. REST
For each of the following pages in a NextJS-based web application, provide an appropriate RESTful
front-end (browser) URL for that page and, where relevant, an appropriate RESTful server API endpoint
(HTTP verb and URL) that component would interact with. An example is provided is below.
Page Page URL API HTTP verb and URL
Add a new article to Simplepedia /edit POST /api/articles
(b) Choose ONE answer. When creating an application for libraries to track their collection, you
decided to create an Author model. Which association between Author and Book best models this
relationship?
⃝ An Author has one Book, an Book belongs to an Author.
⃝ A Book has many Authors, an Author belongs to a Book.
⃝ An Author has many Books, a Book has many Authors.
(c) You want to implement a features where patrons can put holds on books that are currently checked
out, e.g., put themselves on a first-come-first-serve wait list. What association between Patron and
Book would model this relationship. Your answer should be formatted similarly to the answers to
the previous part. In your answer note any Model attributes needed to support this feature.
Page 7 of 8
Question 8. Development processes
In class we practice continuous delivery, in which we can deploy our applications on demand with a
single command. An alternative is continuous deployment, in which each integration to the main branch
is automatically deployed.
(a) What technical changes, if any, in our project workflow to enable continuous deployment?
(b) Would we need to make other changes to our processes to enable continuous deployment? Your
answer should specifically address testing and the role of our different branches.
(c) One challenge for continuous delivery is coordinating with specific events, e.g., our sprint demo or
marketing push. How could we control and coordinate feature availability?
Page 8 of 8
Page intentionally blank.