Skip to content

Category: Building future-proof software

Future-proof software. For the longest time, I thought that future-proof software consisted in writing software so good you never need to change it. Over the years, I learned that it is actually software you should be able to change easily. Software that would adapt to future requirements while satisfying the current. Testing is a massive part of that. So is refactoring. Here are some blog posts around these topics.

If you are to embrace new requirements, you must design software so that you can refactor it. If you want to refactor your code, you need to have a way to test its current behaviour no matter how. For a web API, you may even go as far as using Postman to build a test suite.

And remember, whenever you build new production code. Write failing tests. Make the failing tests pass. Push to production. That way you never write unneeded code and if a refactoring is needed you have less to worry about. Yet you have enough to be confident while writing changes.

Trying to provide helpful pull request reviews

Posted in Building future-proof software

How I unblocked a frozen pull request

A few weeks ago, I saw a pull request to modify one of our web jobs which codebase is pretty old and had no tests. The pull request had no tests either. The thing is that we decided to make unit testing mandatory for any pull requests a couple of weeks before.

I started reviewing the code when I noticed someone else already posted a review. A pretty laconic “please add tests”. Not a bad nor a mean review but not a really helpful one. Proof of it is that it was posted about an hour before and the pull request was blocked. Indeed we do not untested logic to enter or remain in our software. Yes, it is aligned with our new policy about tests. That being said, the web job code was tightly coupled and pretty impossible to test as it was.

My Musketeers for DotNet Test driven development

Posted in Building future-proof software, and Productivity

Test, four letters, one meaning and for some people a struggle. Getting people around you to write tests is easy only when everyone already agrees with you. As often, there are instances where some people show resistance to writing tests. Here is the stuff I hear the most from them:

D: I don’t have time to write tests.

A: I don’t need to test this.

B: I can’t write a test for this.

Simple continuous integration with Appveyor and Newman

Posted in Building future-proof software, Productivity, and Tutorials

Last month, I posted about Postman enabling you to test your APIs with little effort so that you can build future-proof software. Here we are going to cover setting up continuous integration for a simple project by using Newman to run your Postman collections. You may have heard about continuous integration in the past. Most commonly, continuous integration will build software from one’s changes before or after merging them into the main codebase. Even though there is an infinity of tools that allow implementing continuous integration, I will focus on Appveyor CI. In order to make things simple, I will create a very basic web API project and will host it on GitHub.

Postman collections: Making API testing great again!

Posted in Building future-proof software, Development, and Tutorials

Turning shaky code into future-proof software

Over the past years, we moved more and more towards web-oriented architectures, connecting to services in order to provide information. Along with the evolution of testing tools and development methodologies we can build crazily robust software. However, it happens that sometimes we will not build unit tests because of project constraints. Those reasons often go from time pressure on a project to laziness but I am not here to judge.