Invert your assertions

TDD Tip: Invert your assertion One top tip I picked up years ago from a co-worker was to invert your assertions when you are in the midst of your TDD cycles. In other words, if you have an RSpec assertion like this: expect(foo.nil?).to be_truthy flip the truthy to falsey and run the test expect(foo.nil?).to be_falsey What you want to see there is that your test fails. In a ‘true’ TDD environment the test would be perfectly clean and no state would be acting on your subject, but that’s just not how most test suites for production products work....

January 26, 2023 · 1 min · 120 words · Matt

Macroservices - A Pragmatic Approach For Small Teams

In an ideal world, all software projects would be written well. Full test suite, a good ci/cd pipeline, and a general focus on maintainability. If that’s the world you live in, or your org spends a lot of time from the onset of a project optimizing for a clean codebase, this is nirvana. One well kept monolith keeps complexity down across the board. No complicated SOA, deployment tooling, or failure case handling....

June 13, 2019 · 2 min · 310 words · Matt

Programmatically Change S3 Storage Class To Glacier

The glacier storage class within Amazon S3 is a great way to reduce costs for files you don’t think you will ever need again, but want to have stick around just in case. Unfortunately the AWS SDK doesn’t provide a way to transition an object to the Glacier storage class; you can only transition to Infrequent Access and no further. Here is my quick hack to enable that ability: Create a special folder in your S3 bucket named ‘archive’ (or whatever you like)....

March 8, 2018 · 1 min · 195 words · Matt

Where is next November?

Today I finished up The Mythical Man Month by Frederick Brooks, which is a surprisingly relevant collection of essays about software engineering, despite being written 42 years ago. Some of the essays I found quite boring, but those were usually essays that also detailed systems specific to the 70s. Most of the book tends to deal with the people of software engineering, and management tactics around the profession. I won’t rehash them all here; however there is one section in No Silver Bullet - Refired that I found particularly compelling:...

April 28, 2016 · 3 min · 627 words · Matt

iOS Design Patterns: The Builder

One of the things I’d like improve in 2016 is my knowledge of software engineering design patterns, with a particular emphasis on iOS. I’ll be posting a quick summary of each one I stumble across on the blog so that my future self can find things again easily. Today’s pattern is called ‘The Builder’. The intent of the pattern is to make it easy to create objects with a lot of initial configurations, without bloating your code with a bunch of long initializers....

January 5, 2016 · 1 min · 175 words · Matt