Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OO-Ride-Share Pair Programming- Gessica Mohr & Anna Kim. #4

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

GeMath18
Copy link

@GeMath18 GeMath18 commented Oct 1, 2020

Assignment Submission: OO Ride Share

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Question Answer
How did getting up to speed on the existing codebase go? If it went well, what worked? If it didn't go well, what will you do differently next time? Talking through the code and see the connection among files worked really well for us.
What inheritance relations exist between classes? CVS was the parent and Driver, Passenger, Trip inherit from CSV record.
What composition relations exist between classes? Trip_Dispatcher uses methods from Trip, Passenger and Driver classes.
Describe a decision you had to make when working on this project. What options were you considering? What helped you make your final decision? Work on each Wave each day and talk about what we were going to work the next day.
Give an example of a template method that you implemented for this assignment We consider that CSV_Template is the template method.
Give an example of a nominal test that you wrote for this assignment Example of nominal test: Testing for calculating average rating.
Give an example of an edge case test that you wrote for this assignment Example of edge case: Testing for no trips.
What is a concept that you gained more clarity on as you worked on this assignment For Gessica: she learned more about require_relative and inheritance. For Anna: Inheritance and composition.

@jmaddox19
Copy link

OO Ride Share

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
The code demonstrates individual learning about Time and the responsibility of Trip.from_csv, and uses Time.parse in Trip.from_csv ✔️
The code demonstrates breaking out complex logic in helper methods, such as making a helper method in Trip to calculate duration ✔️
There are tests for the nominal cases for the Passenger#net_expenditures and Passenger#total_time_spent ✔️
There is at least one edge case test for either Passenger#net_expenditures or Passenger#total_time_spent testing if the passenger has no trips ✔️
Practices inheritance. Driver inherits from CsvRecord, and implements from_csv ✔️
Employs problem-solving and implements Driver#average_rating and Driver#total_revenue ✔️
Implements the TripDispatcher#request_trip, which creates an instance of Trip with a driver and passenger, adds the new trip to @trips, and changes the status of the driver ✔️
Practices composition. In TripDispatcher#request_trip, the driver gets connected to the new trip, the passenger gets connected to the new trip ✔️
Practices git with at least 10 small commits and meaningful commit messages ✔️

Testing Requirements

Testing Requirement yes/no
There is reasonable test coverage for wave 1, and all wave 1 tests pass ✔️
There is reasonable test coverage for wave 2, and all wave 2 tests pass ✔️
Wave 3: Tests in wave 1 and wave 2 explicitly test that only completed trips should be calculated (and ignore in-progress trips)
There is reasonable test coverage for TripDispatcher#request_trip, and all tests pass ✔️

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 8+ in Code Review && 3+ in Functional Requirements ✔️
Yellow (Approaches Standards) 6+ in Code Review && 2+ in Functional Requirements
Red (Not at Standard) 0-5 in Code Review or 0,1 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging

Great work! Thorough testing, readable code, and it all works together!

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized

end

def duration
trip_duration = @end_time - @start_time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if end_time is nil?

return total_revenue
end

def added_to_trip(trip)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that this is a method defined on Driver rather than putting this code directly into TripDispatcher :)

Comment on lines +37 to +42
if rating.nil?
@rating = rating
elsif rating > 5 || rating < 1
raise ArgumentError.new("Invalid rating #{rating}")
else @rating = rating
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the validations! One way to refactor this code could be to make little helper methods for validating each parameter so that the constructor doesn't get cluttered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants