mokacoding

unit and acceptance testing, automation, productivity

Posts tagged "refactoring"

A real-world example of TDD catching bugs

I published a YouTube video with a tutorial on implementing the FizzBuzz algorithm using Test-Driven Development. While recording, I made a couple of thinking or coding mistakes, and, sure enough, the tests immediately pointed them out.

Code Coverage Is A Broken Metric

But you should track it anyways.

Write Less Code

The best thing you can do as a software developer is not writing code, but removing it. Here's why.

How to split decision and action logic with the Swift type system

There is a subtle way to overload software components, by making them both take decision and act on them. We can simplify these bloated components by separating the responsibility of taking decisions from the one action on them. This will result in leaner and easier to maintain software, and is made simple by the Swift type system.

How to choose what to refactor

A way to identify the areas of code to refactor with the highest return of investment using the "focusing question" technique.