Skip to content

Conversation

@antoniairizarry
Copy link

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? Even though during the design portion I had ideas in mind, once I started working it was challenging to connect parts with certain structure so I resorted to using the scaffold.
What was a design decision you made that changed over time over the project? I originally had a room class, but then thought maybe it was unnecessary. I was having difficulties overall, and started the project all over.
What was a concept you gained clarity on, or a learning that you'd like to share? I think I learned a bit more about design the hard way by making many mistakes. Though there are different ways of doing things, I certainly made the situation more difficult for myself by not looking at the big picture.
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? I created a test that would check if the costs were being calculated accurately, it's a nominal case because it's testing expected behavior.
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? I made a test to check if an ArgumentError was being raised if invalid data was input into a method. Since it checks for something unexpected, it's an edge case.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? I feel that writing pseudocode is something I definitely need to do more as it isn't very difficult and is helpful. I do find writing tests first and then code challenging, it feels counterintuitive, though I do understand the purpose of it and want to improve on that.

@dHelmgren
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
Yellow (Approaches Standards) 9-13 total in all sections ✔️
Red (Not at Standard) 0-8 total in all sections, or assignment is breaking/doesn’t run with less than 5 minutes of debugging

Additional 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 way that you broke down the problem into thoughtful methods, and used your methods to separate concerns within your project. I also like how you approached Rooms, as there isn't much data that concerns a room except the number! As a matter of fact, that's how instructors have approached this problem in the past!

I do see some room for improvement around breaking down complex logic, and double checking the validity of tests. When we tackle problems like these, we want to make sure we are really thoroughly understanding the scope and nature of the problem.

These are the warning that got printed out when I ran your tests


/Users/devin/Documents/Ada/c13/hotel/lib/hotel_controller.rb:25: warning: mismatched indentations at 'end' with 'if' at 19
/Users/devin/Documents/Ada/c13/hotel/lib/hotel_controller.rb:26: warning: mismatched indentations at 'end' with 'def' at 18
/Users/devin/Documents/Ada/c13/hotel/lib/hotel_controller.rb:33: warning: mismatched indentations at 'end' with 'if' at 31
/Users/devin/Documents/Ada/c13/hotel/lib/hotel_controller.rb:36: warning: mismatched indentations at 'end' with 'def' at 28
/Users/devin/Documents/Ada/c13/hotel/lib/date_range.rb:13: warning: mismatched indentations at 'end' with 'if' at 11
/Users/devin/Documents/Ada/c13/hotel/lib/date_range.rb:14: warning: mismatched indentations at 'end' with 'def' at 7
/Users/devin/Documents/Ada/c13/hotel/lib/hotel_controller.rb:28: warning: method redefined; discarding old reservations

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

Comment on lines +21 to +25
if @start_date >= range.end_date || @end_date <= range.start_date
return false
else
return true
end

Choose a reason for hiding this comment

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

This is good start, but you are missing a few important cases with this logic! In situations like this, I try drawing a picture where I can visualize all the possibilities for input data.

Comment on lines +37 to +42
it "returns false" do
start_date = @range.end_date
end_date = @range.end_date
test_range = Hotel::DateRange.new(start_date, end_date)

expect(@range.overlap?(test_range)).must_equal false

Choose a reason for hiding this comment

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

This test is failing, and I'm pretty sure it's failing because of line 11 in the DateRange class.

Comment on lines +32 to +37
reservation_list = @hotel_controller.reservations(@date)

expect(reservation_list).must_be_kind_of Array
reservation_list.each do |res|
res.must_be_kind_of Reservation
end

Choose a reason for hiding this comment

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

I don't see you putting any reservations in this list, so this test ends up passing without actually checking that the code works, if you get my meaning.

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