
Originally published in Towards Data Science on 13 December 2025.
When developing code, you often need to test it before pushing to the development or production environment. However, waiting for a deploy with GitHub actions, or CDK stack deploys with CDK, is time-consuming.
Such time-consuming tasks kill iteration speed, which is a critical factor if you want to develop code effectively. This is because you need to test your implementations properly to ensure they work. Then, after each change, you need to test it again.
With the latest coding agents, developing full local testing scripts is super fast, and something I do every day as I write code as a data scientist.
In this article, I’ll take you through why you need to create an efficient local testing setup by running a Docker image and sending test events. I’ll also show how I do it myself, and how it helps me become a more efficient engineer.
I’ll mostly be talking about how to work with Infrastructure as Code (IaC), because that’s mostly what I’m working with on a day-to-day basis. However, the concept of efficiently running your code locally applies to all programming.

Why you need to run code locally
Firstly, I want to cover why we need to run code locally. The simple answer is that:
Iteration speed is one of the most important aspects for efficiently getting working code to production
The faster you can iterate on your code, the better. When you develop new functionality (or fix old functionality), you want to quickly test if it works, and then iteratively fix the code until it works as intended.


