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

Time - Jocelyn #37

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

Time - Jocelyn #37

wants to merge 43 commits into from

Conversation

wangjoc
Copy link

@wangjoc wangjoc commented Mar 9, 2020

Assignment Submission: Hotel

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

Reflection

Question Answer
What was a design challenge that you encountered on this project? Figuring out how to integrate blocks. It was also challenging to just start a design from scratch and determine what classes to create.
What was a design decision you made that changed over time over the project? At first, I created an entirely new class for blocks which inherited from reservations. Later on, I realized there was so much overlap between the two, that it made more sense to just modify the number of rooms that reservation could accomodate.
What was a concept you gained clarity on, or a learning that you'd like to share? I gained a lot more on inheritance. Although I ultimately scrapped the block class that inherited from reservations, I learned a lot about how inheritance actually works, espeically when trying to inherit an initialize block.
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? I created a reservation and then confirmed that it was added to the hotel controller tracker by checking to make sure that the array length increased by one. This is a nominal case because it's testing a basic and expected functionality of the code.
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? An edge case I wrote is to raise an arugment error if there are not rooms available. This is more of an edge case because it's a situation that shouldn't occur in the normal operation of the hotel.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? This project was really great practice for this. I really enjoyed reading the instructions for the waves, and then translating the user stories into pseudocode. I think it also helped me make sure that I had enough test coverage since I wouldn't really write code unless it was to address a test.

wangjoc added 30 commits March 2, 2020 08:55
def check_reservation_range(date_one, date_two)
first_date = date_one < date_two ? date_one : date_two
second_date = date_one < date_two ? date_two : date_one
first_date < @end_date && second_date > @start_date

Choose a reason for hiding this comment

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

Remember the ada way is to use explicit return :)

@rooms.nil? ? validate_room(@room_ids) : validate_room(@rooms)
end

def validate_room(attribute)

Choose a reason for hiding this comment

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

Consider giving this method a name like validate_block or adding a comment to increase readability.


describe "Reservation Manager Class - Allow Booking" do
before do
@sample = HotelManager::ReservationManager.new()

Choose a reason for hiding this comment

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

It is good to use meaningful variable names to increase readability. It's not immediately clear what @sample us. Consider @hotel.

end
end

describe "Reservation Manager Class - Double Booking" do

Choose a reason for hiding this comment

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

I like you test design choice to separate out positive and negative test cases. Consider wrapping these tests in a save_reservation describe block since these tests specifically test that method.

@beccaelenzil
Copy link

Hotel

Section 1: Major Learning Goals

Criteria yes/no, and optionally any details/lines of code to reference
Practices SRP by having at least two separate classes with distinct responsibilities, and test files for these two classes ✔️
Overall, demonstrates understanding instance variables vs. local variables. (There aren't unnecessarily too many instance variables, when it should be a local variable) ✔️
For each test file, tests demonstrate an understanding of instantiating objects properly, and using Arrange-Act-Assert ✔️
Practices pseudocode and TDD, and reflected on it by filling out the reflection questions ✔️
Practices git with at least 15 small commits and meaningful commit messages ✔️

Section 2: Code Review and Testing Requirements

Criteria yes/no, and optionally any details/lines of code to reference
There is a class that represents a reservation, and a second class that holds/manages a collection of reservations through composition (instance variable) ✔️
The logic for checking if a reservation's date overlaps with another reservation's date is complex logic that is separated into method(s) (and potentially class(es)) ✔️
The logic for checking if a reservation's date overlaps with another reservation's date has unit tests ✔️
All of the given tests run and pass ✔️
A test coverage tool is installed and used, and shows 95% test coverage ✔️

Section 3: Feature Requirements

Feature Requirement: There is a method that... yes/no
gives back a list of rooms, and it's tested ✔️
creates a specific reservation for a room for a given date range, and it has nominal test cases ✔️
creates a specific reservation for a room for a given date range, and it tests an edge case, such as no available room, or invalid date range ✔️
gives back a list of reservations on a given date. Its tests include a test that makes several reservations for a given date ✔️
calculates the total price for a reservation ✔️
gives back a list of available rooms for a given date range, and it has nominal test cases ✔️
gives back a list of available rooms for a given date range, and it has edge test cases, such as no available room, or invalid date range ✔️
creates a block of rooms ✔️
reserves a room from a block ✔️

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 14+ total in all sections ✔️

Additional Feedback

Great work on this project! You've built your first project with minimal starting code. This represents an incredible milestone in your journey, and you should be proud of yourself!

I am particularly impressed by your object oriented design. It is clear by your code and your answers to the reflection questions that you iterated on your design. Furthermore, you've written comprehensive tests that supported your process. Nice work implemented the optional csv class! I've left a few comments of minor ways you might consider refactoring. It is clear that the learning goals around TDD and Object Oriented design were met. Keep up the hard work!

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
Concise
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