Scripts and their undo

TL;DR. Scripts are a great way to automate the mundane. But be sure you give yourself a way out — an undo — when running them.

Some time ago, I had to carry out a long sequence of manual changes in the deployment of my ‘cloud’ service, and so like a good software engineer, I automated large chunks of these changes with shell scripts. Here I learned the importance of building and ‘undo’ in all your shell scripts that mutate the state of world.

Read more

Merits of unit tests — part 5

Cross posted on LinkedIn.

This is the fifth, and final, post in my series of notes on unit tests. So far, we’ve talked about how unit tests help us in documenting our code, reliably refactor software, build better code, and even help debugging in prod. In this post, we’ll discuss how unit tests (more precisely, the act of writing unit tests) help us improve the usability of our code.

Continue reading “Merits of unit tests — part 5”

Unit tests FTW! — Part 4

Cross posted on LinkedIn

In the previous three parts of this series, I have talked about how unit tests are useful in a lot more than just verifying that your code works. We’ve talked its uses for documentation, refactoring and code health, and writing better software. Next, we’ll see how unit tests helps you debug issues in production.

Continue reading “Unit tests FTW! — Part 4”

The merits of unit tests — Part 3

Cross posted on LinkedIn.

Previously, I talked about how unit tests serve purposes other than verifying code functionality; I talked about unit tests serving as defacto documentation, and unit tests helping you refactor without fear. In this post, I’ll talk about yet another benefit to unit tests: writing better software.

Continue reading “The merits of unit tests — Part 3”

The merits of unit tests — Part 2

In the previous post, we saw how unit tests can serve as a reliable source of documentation for your code. There is a lot more that unit tests can do for you. In this post I’ll talk about a fairly obvious, but often ignored, benefit to unit testing: Refactoring.

Continue reading “The merits of unit tests — Part 2”