Ross-HunterDoing the whole "software" thing.http://www.ross-hunter.com2018-12-23T00:00:00ZRoss HunterDon't Test Like That!http://www.ross-hunter.com/2018/12/23/dont-test-like-that/2018-12-23T00:00:00Z2022-08-01T11:08:27-04:00Ross HunterAs a consultant, I come across a lot of bad test suites in Rails and JavaScript apps. The following are all RSpec, Jest, or Jasmine tests that I have found in the wild – with minor changes for clarity or to protect the guilty :) (myself included!)
These are some simple things not to do, along with some advice about what to do to accomplish the same goal.
Don’t test internals in a system test
SystemThe New Best Practices Podcasthttp://www.ross-hunter.com/2018/02/09/the-new-best-practices-podcast/2018-02-09T00:00:00Z2022-08-01T11:08:27-04:00Ross HunterHey everyone! We recently published the first couple episodes of my podcast The New Best Practices. Long-time friends and collaborators Jason Sich, Jace Browning, and myself discuss the process of creating software.
Our first four episode topics cover:
Code Review
Code Comments
YAGNI
Story Points
We are unlikely to ever have episodes like “What’s new in technology XYZ”, and instead we have upcomingJSON API Helpers for API Testing in Rails using Airbornehttp://www.ross-hunter.com/2017/01/16/json-api-airborne-expectation-helpers/2017-01-16T00:00:00Z2022-08-01T11:08:27-04:00Ross HunterUpdate 05/08/2017
I made a gem! https://github.com/Ross-Hunter/jsonapi_expectations
I am a huge fan of the Airborne gem for testing APIs. Airborne uses rest_client to make HTTP requests and provides the following properties for use in your tests.
response - The HTTP response returned from the request
headers - A symbolized hash of the response headers returned by the request
body - The raw HTTP
Topic Based Retrohttp://www.ross-hunter.com/2016/05/09/topic-based-retro/2016-05-09T00:00:00Z2022-08-01T11:08:27-04:00Ross HunterAt Modustri we have always had weekly retrospectives amongst the dev team. We tried a couple different formats, but now we do a simple format that we call a “topic-based” retro.
The concept is simple, throughout the course of the week, if you run into something that you would like to discuss with the whole dev team, you simply post it into our “retros” slack channel, and we will cover it at our weeklyIndex Your Foreign Keyshttp://www.ross-hunter.com/2014/06/13/index-foreign-keys/2014-06-13T00:00:00Z2022-08-01T11:08:27-04:00Ross HunterWe add indexes to our database in order to speed up read operations. Basically, an index is a sorted copy of a particular set of columns the database uses to quickly look up the attributes of another table, most commonly, foreign keys of relations. There are several ways this can actually be implemented on the database; essentially, we tell the database which values we’ll be looking up most often andActiveRecord Associations & Youhttp://www.ross-hunter.com/2014/06/12/activerecord-associations/2014-06-12T00:00:00Z2022-08-01T11:08:27-04:00Ross HunterI love abstraction. It’s great to compartmentalize complexity and keep your application modular. SQL is not that. Relying on SQL strings in your code ties your implementation directly to the type, structure, and even the version of your database. ActiveRecord (the ORM behind Rails) is great for letting us focus on our application and not worry so much about the database particulars.
However, understanding