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

adds detailed rubric requirements to challenge readme #236

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 52 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,84 @@ Instructions
Steps
-------

1. Fill out your learning plan self review for the week: https://github.com/makersacademy/learning_plan_october2015 (edit week 1 - you can edit directly on Github)
1. Fill out your learning plan self review for the week: https://github.com/makersacademy/learning_plan_november2015 (edit week 1 - you can edit directly on Github)
2. Fork this repo, and clone to your local machine
3. run the command `gem install bundle`
3. Run the command `gem install bundle`
4. When the installation completes, run `bundle`
3. Complete the following task:

Task
-----

We have a request from a client to write the software to control the flow of planes at an airport. The planes can land and take off provided that the weather is sunny. Occasionally it may be stormy, in which case no planes can land or take off. Here are the user stories that we worked out in collaboration with the client:
We have a request from a client to write the software to support an air traffic controller managing the flow of planes at an airport. The planes can land and take off provided that the weather is sunny. Occasionally it may be stormy, in which case no planes can land or take off. Here are the user stories that we worked out in collaboration with the client:

```
As an air traffic controller
So planes can land safely at my airport
I would like to instruct a plane to land
As an air traffic controller
So I can provide waiting passengers with information
I want to ask a plane if it has landed

As an air traffic controller
So planes can take off safely from my airport
I would like to instruct a plane to take off
As an air traffic controller
So I can get passengers to a destination
I want to instruct a plane to land at an airport and confirm that it has landed

As an air traffic controller
So that I can avoid collisions
I want to prevent airplanes landing when my airport if full
As an air traffic controller
So I can get passengers on the way to their destination
I want to instruct a plane to take off from an airport and confirm that it is no longer in the airport

As an air traffic controller
So that I can avoid accidents
I want to prevent airplanes landing or taking off when the weather is stormy
As an air traffic controller
To ensure safety
I want to prevent takeoff when weather is stormy

As an air traffic controller
So that I can ensure safe take off procedures
I want planes only to take off from the airport they are at
As an air traffic controller
To ensure safety
I want to prevent landing when weather is stormy

As an air traffic controller
To ensure safety
I want to prevent landing when the airport is full

As the system designer
So that the software can be used for many different airports
I would like a default airport capacity that can be overridden as appropriate

As an air traffic controller
So the system is consistent and correctly reports plane status and location
I want to ensure a flying plane cannot take off and cannot be in an airport

As an air traffic controller
So the system is consistent and correctly reports plane status and location
I want to ensure a plane that is not flying cannot land and must be in an airport

As an air traffic controller
So the system is consistent and correctly reports plane status and location
I want to ensure a plane that has taken off from an airport is no longer in that airport
```

Your task is to test drive the creation of a set of classes/modules to satisfy all the above user stories. You will need to use a random number generator to set the weather (it is normally sunny but on rare occasions it may be stormy). In your tests, you'll need to use a stub to override random weather to ensure consistent test behaviour.

For overriding random weather behaviour, please read the documentation to learn how to use test doubles: https://www.relishapp.com/rspec/rspec-mocks/docs . There’s an example of using a test double to test a die that’s relevant to testing random weather in the test.

Your code should defend against inconsistent states of the system ensuring that planes can only take off from airports they are in; planes that are already flying cannot take off and/or be in an airport; planes that are landed cannot land again and must be in an airport.

Please create separate files for every class, module and test suite.

The submission will be judged on the following criteria:
The submission will be reviewed using the following criteria:

* Supporting Files:
* [ ] README has been updated with description of your approach
* [ ] README has been updated with 'how to use' instructions
* Testing set up:
* [ ] Uses named subject with `described_class`
* [ ] Uses `context` and `describe` blocks to create test scopes
* [ ] Avoids Vacuous tests
* [ ] Use `before` blocks to set up objects rather than repeat code
* [ ] Sufficient [Test coverage](https://github.com/makersacademy/course/blob/master/pills/test_coverage.md)
* [ ] Avoids multiple `expect`s in `it` block
* [ ] Handles randomness in tests
* [ ] Eliminates redundant `respond_to` expectations
* [ ] Tests all green
* Application Code:
* [ ] Naming conventions match the domain model
* [ ] Has no commented out code
* [ ] Conditionals are refactored to minimum possible
* [ ] Uses implicit return of booleans
* [ ] Does not expose internal implementation
* [ ] Classes and methods have clear single responsibilities
* [ ] Methods are short
* [ ] Avoids magic numbers
* [ ] Prefers symbols to strings
* [ ] Methods are named as commands OR queries
* [ ] Makes correct use of attr_* methods
* [ ] Avoids redundant lines of code

* Tests pass
* [Test coverage](https://github.com/makersacademy/course/blob/master/pills/test_coverage.md) is good
* The code is elegant: every class has a clear responsibility, methods are short etc.

**BONUS**

Expand Down