Dev Setup — ensuring code quality and test coverage

Alistair Phipps
Makers — Greenbook
2 min readDec 3, 2019

In order to ensure we start our project off in the best way, we decided to implement some tooling to ensure the code we are writing is a close to production ready as possible. The focus for this post is to look at how we are using common Ruby development helpers to nudge us in the right direction.

Linting -Rubocop

Rubocop is a Ruby linter that helps developers write code according to the accepted Ruby style, and also catches some basic stats and hints on spotting where code complexity may be too large. We are using it to learn how to write consistent Ruby code as a team. So that as we work on a common codebase, it emerges a style that is easy for any Ruby developer to understand.

We have installed a gem to enable rubocop and are running the tool adhoc at the moment.

Test Coverage — SimpleCov

Simplecov produces stats on unit test coverage, where we are aiming for 100% coverage. While this doesn’t guarantee our application has a good set of unit tests, it gives us a signal that we are working towards ensuring the unit tests are at a good level for us to build on, and we are following TDD.

It runs every time we run our unit tests in Rspec.

Code Quality — CodeClimate

CodeClimate offers test coverage and assesses code maintainability. We are trying to write code that is maintainable and we are using CodeClimate as a tool to assess our progress on this. We have integrated it to GitHub and it runs on every pull request we make to the master branch. We are looking forward to seeing the results!

--

--

Alistair Phipps
Makers — Greenbook

Delivery Lead and Agile Coach at John Lewis & Partners Digital