The First Friday Challenge – Airport
Today we undertook our first Friday challenge! The challenge was fairly similar to Boris Bikes, we had to use TDD to develop a program that used multiple classes to manage the flow of airplanes through an airport, depending on the weather.
I won’t go through it loads of detail as it is quite similar to Boris Bikes, but overall I would say it went really well. I flew (ha) through the challenge today managing to get it to a really good point before lunch. After lunch I carried on mainly refactoring and adding different features and improving what I had.
The main difference today was the addition of a couple of helpful gems, rubocop and coverage. Rubocop checked your code for any quality errors; too many spaces, missing additional lines, anything like that that would make your code messy. Coverage checked the coverage of your tests. It looks through every line of your code and made sure there was a test that was somehow related to it. I loved it, it was so helpful. If it pointed out a line of code it either meant that you need to write a test to include it to make sure it works or you may not need that code at all. I had a mixture of both, some lines I added tests for and some I removed and altered other parts of my code to not need them. It made refactoring my tests and code much easier.
I finished the challenge with all my tests passing, all features met, 100% coverage and no errors from rubocop, so I am very happy with todays work!

Image from Google Images (link)
And here are the completed tests!

The one thing I would like to improve on today was my committing to git. I forgot to do it for the first couple of tests I wrote, which is pretty bad. I normally am quite good with it, especially for TDD where I tend to do it after every Red Green Refactor cycle, but I was so in the zone writing tests and code that it slipped my mind. After I remembered I ensured I kept it up much more frequently.

Not much more to say about today, very productive, but didn’t do much outside of the challenge.
Here is todays song of the day though!

