Skip to content

Conversation

@iamsammysam
Copy link

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What was a design challenge that you encountered on this project? It was a very challenging project. How to decide when to create classes for room instead of date_range and if I needed both or not. I kept most of the methods and functionalities at hotel_organizer as a "trip dispatcher" for ride_share project.
What was a design decision you made that changed over time over the project? At the beginning I had a Class for date_range because dates are a very important part of a Hotel but I decided to add this behavior to a Class called Reservation and have an extra Class called Rooms to give the rooms more flexibility info future updates on the hotel.
What was a concept you gained clarity on, or a learning that you'd like to share? I learned how to create better tests and how to connect different classes that have a dependency on each other and use that on my favor, unfortunately creating Classes too dependent. I'd improve my Hotel by using the best practices on the book "Practical OOD - Sandi Metz".
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? When searching for a specific date, that date is not available in the hotel_organizer list of reservations it produces an error, it's a nominal error because it a situation that can happen in a normal Hotel but needs to be flagged.
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? If a reservation is made on a end_date before start_date, it's a unexpected input for the program and doesn't represent a real situation in any case possible for a valid reservation.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? For this case was very difficult to use this formula, with a "blank page" to start the project feels more helpful to have some code first and then make the tests. I understand the concept and applied as much as possible for this project.

@beccaelenzil
Copy link

beccaelenzil commented Sep 13, 2019

Hotel

What We're Looking For

Test Inspection

Workflow yes / yes but no test / no
Wave 1
List rooms yes
Reserve a room for a given date range yes
Reserve a room (edge case) yes
List reservations for a given date yes
Calculate reservation price yes
Invalid date range produces an error yes
Test coverage 95-100%
Wave 2
View available rooms for a given date range this resulted in a failed test.
Reserving a room that is not available produces an error yes
Test coverage 95-100%
Wave 3 N/A
Create a block of rooms N/A
Check if a block has rooms N/A
Reserve a room from a block N/A
Test coverage N/A

Code Review

Baseline Feedback
Used git regularly yes
Answer comprehension questions yes
Design
Each class is responsible for a single piece of the program yes
Classes are loosely coupled yes
Fundamentals
Names variables, classes and modules appropriately yes
Understanding of variable scope - local vs instance yes
Can create complex logical structures utilizing variables yes
Appropriately uses methods to break down tasks into smaller simpler tasks yes
Understands the differences between class and instance methods yes
Appropriately uses iterators and Enumerable methods yes -- but I believe their was a bug with where you returned true/false
Appropriately writes and utilizes classes yes
Appropriately utilizes modules as a namespace yes
Wrap Up
There is a refactors.txt file whoops, you missed this requirement!
The file provides a roadmap to future changes whoops, you missed this requirement!

Overall Feedback

Great work overall! 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 the way that you how you broke down complex functionality into methods in your HotelOrganizer class.

One place you could grow is writing more comprehensive tests that consider both positive and negative edge and nominal cases. You did write a test that caught a bug in finding the available rooms for a given date range. Take a look back at this and ask a question if you are still having trouble seeing where this bug came from.

before do
@hotel_organizer = Hotel::HotelOrganizer.new

@reservation1 = @hotel_organizer.make_reservation(18, Date.new(2018,01,01), Date.new(2018,01,06), nil)

Choose a reason for hiding this comment

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

Consider storing your dates as variable so it is clear how the dates relate to each other and what you are testing.

Suggested change
@reservation1 = @hotel_organizer.make_reservation(18, Date.new(2018,01,01), Date.new(2018,01,06), nil)
start_date1 = Date.new(2018,01,01)
end_date1 = start_date1 + 5
start_date2 = start_date1 + 2
end_date2 = start_date2 + 9
...

Copy link
Author

Choose a reason for hiding this comment

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

Added refactors.txt file and roadmap to future changes.


while start_date != end_date
if reservation.date_range.include?(start_date)
result = false

Choose a reason for hiding this comment

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

You should return false as soon as you hit false, because you don't want to find an overlap and then reset to true, but you should not return true until you've looped through all the dates to make sure you haven't missed any overlaps.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed the loop and made new tests that are passing.

list_rooms = @hotel_organizer.list_available_rooms(Date.new(2018,01,01),Date.new(2018,01,06))

rooms_after = list_rooms.length
expect(rooms_after).must_equal 19

Choose a reason for hiding this comment

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

Hrmm, it is returning 0. I think this is an issue in your rooms_available? method. See comment above.

test_0003_returns only the rooms that have dates available FAIL (0.00s)
Expected: 19
Actual: 0
/Users/becca/Documents/GitHub/c12-student-repos/hotel/test/hotel_organizer_test.rb:99:in `block (3 levels) in <top (required)>'

Copy link
Author

Choose a reason for hiding this comment

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

Fixed method room_available? (room is now passed in as an argument and checked against the list of reservations), made new tests that are passing.

end
end

describe "method add_reservation" do

Choose a reason for hiding this comment

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

It would be good to add tests here that test for different types of reservation conflicts and edge cases for allowed overlapping reservations.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed bug to make room show as available also on the last_day of reservation, made new test that's passing.

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