Fall 2007 - Take-Home Midterm
The midterm consists of the following questions. You are to answer these questions to be the best of your ability. Answers should be clear and straightforward.
All work is to be done independently: you may not discuss any of the material with your classmates, friends, or colleagues.
You may use external references including web pages, research literature, and textbooks. However, you must indicate which resources you have consulted. If your answers make use of specific facts that you find in an external resource, please footnote them. If you just use external resources for background information, please simply list them. Any use of external resources without proper attribution will be closely examined for signs of possible plagiarism.
All answers must be typed or otherwise computer-generated.Take as much space and time as you need, but no more. If your answers take 2 pages, you've likely not done enough work. If you're tempted to write 40 pages of prose, you've probably done too much.
Your answers must be sent to me via email at or before 5:00PM on Tuesday October 30.
Question 1 (50%): Social Networking for Professionals
The social networking site LinkedIn (www.linkedin.com) acts as a facebook for professionals. Individuals can specify aspects of their education (schools and dates), their employment (employer, years, position), and indicate goals - whether they are online for networking, to find a job, or for other purposes.
This information forms the basis for online social networking. Each member can build up a "network" of people they know, by inviting current and former friends and colleagues to join their networks. Members can also search through lists of people with similar current or previous schools or employers, in order to find people they might know.
Members can see the list of friends for any of the people in their network. This can form the basis for introductions: if Ms. Smith is a friend of mine, and Mr. Jones is a friend of hers, I can ask Ms. Smith to introduce me to Mr. Jones.
Premium members have access to additional functionality, including mailboxes, enhanced tools for building networks, and the ability to post and apply for jobs.
Your job is to design and model an implementation of LinkedIn. Assume that you're using Ruby on Rails. Which models would you need? How would they relate to each other? Which controllers? List some methods you would need.
Your answer should include the following:
- A list of specific features that site would provide
- A list of models (in the Rails sense) that would be needed.
- A list of controllers
- Descriptions of why each of the above is required.
- Diagrams and/or textual descriptions of the relationships between classes.
- Use cases or scenarios that would flesh out the specific details of how the following features would work:
- Creating a new account - joining for the first time.
- Accessing a list of members who work at a place where the user had worked previously.
- Inviting a friend of a friend to join the user's network - including confirmation that the invitee wished to join.
Question 2: Testing and Rails (30%)
The ongoing development of the Depot in the textbook and in class has left us with a shopping cart and the ability to create an order, complete with the buyer's name, email and address. However, the Order and the associated LineItem classes have not been thoroughly tested. The challenge in this problem is to write tests to verify the proper operation of these classes. Specifically, write- Unit Tests for the Order and LineItem classes
- Functional Tests for the checkout and save_order actions in the StoreController.
Keep in mind that properly constructed tests will verify that the models work correctly with valid input and that they fail appropriately with invalid input.
If you need to refer to any information in fixtures, please indicate what your fixture files would contain.
You are welcome to - but not required to - run your tests against a live copy of the Depot application.
