Skip to content

Conversation

@gyjin
Copy link

@gyjin gyjin commented Sep 9, 2019

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What was a design challenge that you encountered on this project? I struggled a lot at the beginning, just trying to decide what kind of classes I needed, how they should be related to each other, and the general structure of the whole program.
What was a design decision you made that changed over time over the project? I originally had a DateRange class that took in a start and end time as a string and converted that to an instance of Date. Over time I realized that may not have been necessary, as I was converting times into Date elsewhere in the program and it just became redundant to have that DateRange class. I ultimately decided to remove it.
What was a concept you gained clarity on, or a learning that you'd like to share? I learned that starting from the smallest or least responsible class can help you get started. At first, the whole project seemed daunting and I didn't really know where to start, but building the first class led me to think of all the other portions I needed for the program, helping me move along.
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? A nominal test that I wrote was making a new reservation when all the rooms were empty. I knew that that reservation should be able to be booked, and booked in the first room. It's a nominal case because it's what would happen in normal conditions.
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? An edge case test I wrote was trying to make a new reservation when all the rooms were booked for that date range. This passed back an error. It's an edge case because while possible, the situation is unlikely, but should still be tested for.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? I enjoyed thinking in pseudocode first. It really solidifies exactly what I want the program to do without having to worry about syntax and exact "coding language". It just gets the logic part of the program down.

@dHelmgren
Copy link

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 good
Wave 2
View available rooms for a given date range yes
Reserving a room that is not available produces an error yes
Test coverage good
Wave 3 DNF
Create a block of rooms
Check if a block has rooms
Reserve a room from a block
Test coverage

Code Review

Baseline Feedback
Used git regularly yes, great commit messages
Answer comprehension questions yes
Design
Each class is responsible for a single piece of the program Mostly. Your Reserv_system reaches inside your reservation to get info.
Classes are loosely coupled no, due to above.
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
Appropriately writes and utilizes classes yes
Appropriately utilizes modules as a namespace yes
Wrap Up
There is a refactors.txt file yes
The file provides a roadmap to future changes yes

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 tested all sides of the booking problem!

I do see some room for improvement around class delegation. The discussion of POODR chapter 4 should help here.

@reservations << new_res
not_reserved_rooms[0].reservation << new_res
else
raise ArgumentError.new("Cannot make a reservation for that date range. No rooms available.")

Choose a reason for hiding this comment

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

I don't think this is a problem with the arguments. This is just an error, or perhaps you should define a custom error.

def make_reservation(start_time, end_time)
not_reserved_rooms = not_reserved_on_date_range(start_time, end_time)

if not_reserved_rooms.class == Array

Choose a reason for hiding this comment

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

This is a weird way to check this. We generally don't check the class of something in ruby. I'd rather see you always return an array, and check like, the length of the array.

else
curr_room.reservation.each do |each_res|
if overlap?(start_time, end_time,
each_res.start_time, each_res.end_time) == true

Choose a reason for hiding this comment

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

have this bit of logic live in the reservation rather than the system. That way you don't have to reach inside the reservation to get the info.

end
end

describe "determining date overlap" do

Choose a reason for hiding this comment

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

Nice!


1. A lot of my tests seem redundant. While I want to make sure every
possible scenario is covered and that my code is doing what I want it
to, I may be able to cut some out

Choose a reason for hiding this comment

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

Your tests are very thorough, and I appreciate it!

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