Chris Roos by Chris Roos

Week 331

Howdi, folks.

We continue to divide our week between GDS and GFR, spending Monday to Thursday working on Smart Answers for GDS and Friday working for ourselves.

Smart Answers

James continued to improve the Smart Answers DSL by adding options to parse value questions as floats. This allows us to declare the type of data we’re expecting and to DRY up a number of the Smart Answers that were each having to parse responses.

James replaced some of our custom rake test tasks with the standard Rails test tasks. In doing so, we realised that Rails now runs all tests together, where it would previously run unit tests before anything else. James points out that it’s desirable to run unit tests separately as they’re supposed to run quickly and give you some early warning as to whether other tests are going to fail. There’s no point continuing to run the more expensive integration tests if the unit tests are failing.

I started the week by opening a pull request containing an example set of the regression tests that James talked about in week 330. We had some good discussion on the pull request itself and later on in-person, after which we agreed to go ahead with the regression testing approach.

There were some concerns about this approach (see the discussion on the pull request if you’re interested) but in the end we think the benefits outweight the potential problems and we’re fairly confident that these tests will be relatively shortly lived while we make some of the larger changes that we’re planning.

Before merging the first set of regression tests, I spent a short while investigating the addition of such tests to the complex Marriage Abroad Smart Answer. This Smart Answer contains questions that allow you to choose from a list of countries. Testing every combination would be impractical so I wanted to see whether it’d be possible to reduce the number of combinations while still retaining close to 100% code coverage. While I didn’t finish this exercise, I got far enough to convince myself that it would be possible.

Working with our new ERB templates made me realise that I didn’t understand how the various trim modes worked. I ended up creating a number of tests to try to demonstrate the behaviour and now have a slightly better idea about how they work.

One unexpected, but beneficial, side effect of switching from YAML to ERB was the speed up of the newly added regression tests: I saw a reduction of around 60 seconds (from 110s to 50s) after making the change!

I spent a short while trying to run Rubocop as part of our build process. We already have Rubocop in the project but it’s not currently configured to run. I didn’t quite get it running but I’m pretty keen so I think I’ll have another play soon. One thing I hadn’t seen before was Rubocop’s ability to automatically fix a number of violations. That definitely could’ve saved me some time in the past when I’ve gone through manually fixing some of the more trivial violations.

GFR

We had a slightly more relaxed Friday after the fairly intensive week working on Smart Answers. I’m enjoying the work but it’s definitely leaving me feeling quite tired, and without the time/energy to focus on GFR things during the week.

We spent most of the day ticking off some admin tasks that had built up during the week.

James and I had an enjoyable lunch with Tom T, Tom S, Ben G and Chris L at the Strongrooms. The sun drew us out but we weren’t quite early enough to beat everyone else with the same idea and ended up sitting in the shade.

Chris L spent the afternoon in our office and managed to publish Web Audio Weekly 36.

The only real thing of note I managed to do was to update our Checking our Annual accounts page. This had been hanging over since we completed our annual accounts at the beginning of the year so it was great to finally get it done.

We finished up Friday afternoon at the Shoreditch Works Mixer. We spent some time chatting to Ben and Sam of Fun and Plausible. Although we only sit a few metres from each other, our paths hadn’t really crossed so it was good to finally meet them properly.

Until next time.

– Chris

If you have any feedback on this article, please get in touch!

Historical comments can be found here.

Recent