Integrated Tests are a Scam, Test Doubles Comments

If you’re thinking about starting to use Contract Tests, don’t look for tools, because they don’t help you with the most important aspect of Contract Tests, and they might even distract you from it.

Read on →

Simple Design Comments

Years ago, I learned a simple heuristic to discover when subclasses are ready to die. In functional programming, it appears that we can use that same heuristic to surprisingly good effect!

Read on →

Simple Design, Integrated Tests Are a Scam, Test Doubles, Surviving Legacy Code Comments

I’ve been teaching programmers about the value of isolated tests for a long time, and recently I’ve seen increasing resistance to the idea. I worry that this comes partly from having presented motivations and reasons that tends towards the overly-abstract, ironically enough. Perhaps I can improve matters by returning to the concrete issues and constraints that led me to being exploring this idea in the first place.

Read on →

Tutorials Comments

It took a day, but I managed to learn how to deploy a Jekyll blog to Heroku using GitLab CI, even though I’d never used GitLab CI before. This not only provides a tutorial, but also an example of applying a Learning Tests approach to something other than code running in a single process.

Read on →

Simple Design, Dependency Inversion Principle (DIP) Comments

We have standard workflows in our systems that programmers copy and paste from module to module in order to achieve some kind of standard behavior. Programmers call this boilerplate. If they extract the standard workflow from the boilerplate, then the copy/paste risk goes away, it becomes easier to gain confidence in the code, and everyone wins.

Read on →

Read on →

Comments

I recently encountered a code base in which someone had applied the Golden Master technique, but done so in a way I find risky, so I wanted to warn you against letting this happen in your code. This code exhibits a bad idea that probably started out as a good idea or seemed like a good idea at the time. This makes it plausible-but-risky, and this is where a lot of legacy code comes from.

Read on →

Comments

Today I’d like to share an example of a tiny cohesion risk. I leave it to you to evaluate the severity of the risk and the appropriateness of the refactoring. I like to deal with risks when they are small enough that their impact, while painful, probably won’t kill.

Read on →

Dependency Inversion Principle (DIP) Comments

If you want reuse, you have to make it happen. Fortunately, you don’t need to be psychic; it’s enough to start by removing duplication, which makes opportunities for reuse easier to spot. Let me show you an example from code I’m working on to generate Nginx server block configurations I need to support some pretty URLs.

Read on →

Read on →

Design credit: Shashank Mehta