Project: Ride Sharing
You are a tech company that provides a mobile app for booking taxi rides (e.g. Uber, Lyft). Both drivers and riders use this app and this is the database that stores the records of those trips. The app also has a reviewing system where both drivers and riders review each other.
DB0: Setup
For setting up in the lab or on your own machine, follow our DB Project Setup Instructions.
Grading Setup: 20 points
- All steps implemented (10)
- CI fully passes (10)
Grading notes:
- Make sure you tagged the commit as
db0
so we can find it easily. - We grade GitLab only, unless an instructor or TA has given explicit written instructions that you can bypass the CI (which is rare)
DB Design & Style Expectations
These live over at design expectations. Be sure to consult these when you are trying to think of helpful feedback.
DB1: Initial Schema, Test Data Set
In this iteration, please name your topic branch db1-dev
. Once you have merged this into the master
branch, tag the version that you consider to be your submission with db1
.
The main purposes of this twofold:
- Get your initial schema going
- Set up your test data for unit testing
Build a table in your database and populate it with some test data. We will be building this database schema incrementally, so let’s just start with two or three tables.
This iteration you will build some initial tables that relate to each other. Don’t worry about storing all the columns you can think of - just get the general concept of the table and its foreign/primary keys.
Generally speaking, your APIs will be CREATE
and SELECT
and your data will be loaded via your tests using INSERT
. See your project domain for specifics.
We will give you test cases and you will need to adapt them into Python unit tests. You also must add 3 additional tests (i.e. test_*
methods). You are welcome (encouraged!) to add to your test dataset too.
Also, delete example_table
from your code. We’re doing with the example setup, so adapt your code accordingly. Lesson: Learn the value of deleting out of date code. That code will live on in your repository. Don’t comment it out like a packrat. Delete. The sooner you get used to the idea of revising code instead of continually adding to it, the better your software will be on so many levels.
Grading DB1: 80 points
By lab day:
- Set up merge request by lab day (10 pts)
- Enough functionality finished such that it can be thoroughly reviewed (10 pts)
By submission day:
- Directions followed. e.g. Example removed, git branch, merge, tag, etc. 10 pts)
- Provided useful feedback to others (merge request feedback) (5 pts)
- Responded to feedback on your own project (merge request) (5 pts)
- CI Succesfully runs (10 pts)
- Requirements implemented (15 pts)
- Test cases implemented and pass (15 pts)
DB1 Ride Sharing Specifics
The core of your system is the concept of a rider and driver taking a ride. Make these tables with test data. Don’t worry about too many other columns than what you need for these tests. At this point, you can load your test data with any mechanism you choose. We’ll get to loading from files later (although you can do that here as well, if you choose)
Also, the main stakeholders in this system are riders and drivers. Riders have a name, any special instructions, and a current average rating. Drivers also have those things, as well as a car make and model and the system knows how long they have been a driver.
Key decisions:
- One table or multiple tables for drivers and riders?
- What if a driver also wants to take a ride? Should they have separate accounts?
- How do we handle return trips? Trips with multiple stops?
Test Case Sketches
- The database is seeded with a test data set without crashing
- The test data contains drivers “Tom Magliozzi” and “Ray Magliozzi”. Their average ratings are 3.2 and 3.4 respectively. Both of their special instructions are “Don’t drive like my brother.”
- The test data contains a rider named “Mike Easter” whose average rating is 4.3. No special instructions.
- The test data contains a ride where Tom gave a ride to Mike
- The test data contains a ride where Ray gave a ride to Mike
- The test data contains a ride where Tom gave a ride to Ray