Skip to content

Conversation

@snowistaken
Copy link

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? Getting up to speed on the codebase was a relatively fast process. What worked was looking at what we needed to implement/improve and walking ourselves through the codebase to understand how each component connected and affected each other.
What inheritance relations exist between classes? CSVRecord is the parent class, part of the module Rideshare. The CSVRecord class is a parent class of trip, driver, and passenger.
What composition relations exist between classes? Driver, trip, and passenger classes all have interlaced composition between one another. For example, the connect method in the parent class CSVRecord instigates this composition by adding and connecting instances of each class in the required manner.
Describe a decision you had to make when working on this project. What options were you considering? What helped you make your final decision? The main implementations of feature requirements were relatively straightforward, this is mostly due to the fact that the requirements were clearly laid out and did not have much room for interpretation. The most of our decision making energy was directed towards determining how we wanted to implement our tests. One such example of this would be that we had to decide how and where we wanted to implement instance variables instantiated by reading from the test data. Our options here were to use the existing 'describe' blocks and build off of them with additional but arguably unrelated tests, or to create new blocks and re-instantiate those variables. Ultimately we went for reinstantiating these variables, even though it may create a few extra lines of repetitive code. The readability of our code and tests was the main influence in making this decision.
Give an example of a template method that you implemented for this assignment One example of a template method in this project is the self.from_csv method in the CSVRead class. This method is overridden by all other classes and an error message is called if the user attempts to call it on an instance of CSVRecord.
Give an example of a nominal test that you wrote for this assignment One example of a nominal test in our code is the test that insures that if there are no drivers who have never completed a trip, the driver who completed the trip the longest ago is selected. In this test we call the appropriate method until a driver who has completed a trip needs to be selected, then we use an 'expect' keyword argument to specify the appropriate return variable.
Give an example of an edge case test that you wrote for this assignment An example of an edge case test in our code is the test that checks if an ArgumentError is raised in the case that there are no available drivers to complete the trip. This test runs the TripDispatcher#request_trip method until there are no available drivers remaining in the test data. This is done using the 'expect' and '.must_raise' arguments.
What is a concept that you gained more clarity on as you worked on this assignment We feel that inheritance was the most key concept to completing this project. Understanding how the parent class interacts with the children classes and what that entails was necessary in developing new classes and methods. One of the aspects that we gained the most clarity on in this topic is the idea of template methods. Understanding how and why a template method needs to be overridden by a child class was very helpful in knowing when to implement the method in each child class.

Copy link

@beccaelenzil beccaelenzil left a comment

Choose a reason for hiding this comment

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

Great work on this assignment! It is clear that the learning goals around TDD, inheritance, and object composition were met. In particular, nice job implementing the optional features and writing comprehensive tests for this. One thing to note is you could use more tests for the edge case on the passenger methods. Keep up the hard work.

end

# You add tests for the net_expenditures method
it "will return the total cost for all trips made by the passenger" do

Choose a reason for hiding this comment

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

These tests are good, but a few more are needed. What happens if a passenger has zero trips? What happens if the passenger has trips that are in progress?

end
end

describe "Request Trip method tests" do

Choose a reason for hiding this comment

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

Nice work on these tests!

return 0
end

@trips.each do |trip|

Choose a reason for hiding this comment

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

Consider using a .map

end

available_drivers.each do |driver|
if driver.trips.length == 0

Choose a reason for hiding this comment

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

Is there an enumerable you could use here?

@beccaelenzil
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 inheritence. 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 Your commit messages look good, but I would like to see more frequent commits. If you're having trouble remembering to commit regularly, you might find this article interesting

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) See in-line comment.
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

Additional Feedback

Your answer to the comprehension question about composition gets at this, but I want to call out this vocabulary explicitly. By composition we mean a has-a or has-many relationship. Examples in this project include "a TripDispatcher has-many Drivers, Passengers and Trips", "a Driver has-many Trips", "a Trip has-a Driver".

Code Style Bonus Awards

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

Quality Yes?
Elegant/Clever
Descriptive/Readable
Logical/Organized

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.

2 participants