Machine Learning

How to increase typing speed

To develop code, you often need to test it before pushing it to development or production. However, waiting for GitHub actions, or CDK Stack Deputation via CDK, is time-consuming.

Such time-consuming tasks are deadly Iteration speed, which is important if you want to develop the code successfully. This is because you need to thoroughly test your implementation to ensure that they work. Then, after each change, you need to check it again.

With the latest coding agents, developing complete local test scripts is very fast, and something I do every day as I code as a data scientist.

In this article, I will take you through when you need to create an efficient local test setup using a docker image and sending test events. I will also show how I did it, and how it helps me to be an efficient developer.

I'll be talking a lot about how I work with infrastructure as code (IAC), because that's mostly what I'm working on these days. However, the concept of optimizing your code applies to every system.

This highlights the main content of this article. I will highlight how fast iTearation can measure your capabilities as a program, and how you can accelerate development by building representative production in your area. I'll also highlight how you can give your coding agent access to iTeration's high-speed local test scripts. Photo by Gemini.

Why you need to use the code in your area

First, I want to cover why we need to use local code. The simple answer is:

Iteration speed is one of the most important factors for getting code to production efficiency

The sooner you can make your code, the better. When developing a new functionality (or modifying an old functionality), you want to quickly test if it works, and then modify the code until it works as intended.

If you have to wait 5-15 minutes for your code to post before testing it, you have a big problem. Every time you can't shoot one problem, you spend 5-15 minutes just waiting to be sent.

Instead, you have to run your own code in your environment. For example, if you work with IAC, such as AWS CDK, you can create and run docker images in your environment, essentially replicating the production environment, but on your computer. This way, the iTeration Loop is simple, and the time it takes to build the docker image and run the code.

Building a docker image is usually very fast, considering the deper caches that are built before. Therefore, most of your time is spent running the code with input testing and making sure the output is expected.

If you're working on a web application, you should (and probably already are), running the application locally, before deploying your code. There should be no difference when working with IAC.

How to Build a Site Like It Was a Manufacturing Facility

An important factor when developing in your area is that you are able to repeat and repeat the successful production environment. If you write IAC, build docker images, and run the docker image locally:

You test with the same code, with the same input methods, and when you look at your .env file in the production .Env file, you also show all the variables. So, Running Docker Images locally is the way to go if you can do that.

Create local scripts with coding agents

Before the release of code agents like the pointer and code Claude, it was often a tedious task to set up the code to run everything in your environment. You need to build the docker image properly, set it up to run with your .env file, and so on. Or you may want to run your code locally as a Fastapi server instead, where you face the same challenges.

This is not a problem either. To start running in the area, I usually provide the following tutorial:

Create a shell script for me to run this code locally. The shell script
should run the docker image, and have an optional --build flag, which builds
the docker image before running it. The docker image should load environment
variables from the .env file.

This creates an executable shell script that you can run. I like the options –– Build it Tag, because sometimes it takes time to build a docker image, and I don't always need to build it before running.

Also, the following things allow me to run the script easily:

  • I never store real secrets in .env. I only store secret indexes, which my code takes from the AWS Secrets manager. So, I can compress my Ev file without the worry of leaking secrets. In addition, this makes it easy for others to run the scripts once they pull the code from github
  • I created another file with test events, where I easily send events to the Running Docker image. This way, I can easily check the input and output
  • I upload test scripts to git, so everyone else has access to them. This includes the NV file as mentioned, because it has no secrets

Now you have the exact setup you need to run and test your code in place. Every time you make changes, rebuild the docker image and send test events, making sure everything works as intended.

I recommend setting up these local test scripts for all your responses and pushing them to get a git share. Access to these documents will make your entire team work as well as the programs.

Some tips for running in your area

I also want to share two additional tips to make them more efficient, given these local test files:

  • Run and test the Docker image with pre-commitment hooks
  • Give your agent access

Pre-commit hooks

Pre-commit hooks are code that run before every git commit. Common commitment hooks include:

  • Run black formatting
  • Run accepted For brand safety
  • Run Pytest test To ensure that all tests pass

To be sure of the pre-verification commit never forget to run any such commands before pushing your code. This is a great help and a great thing. It's hard for me to count the number of times I forgot to run black formatting before engaging, and writing tests keep failing 5 minutes later, costing me a lot of time.

If building, running, and testing on a docker image is not a big time issue, I also recommend adding this to the pre-commit hooks. This way, you make sure that before you push any code, you check that the code works in production, and that you get the expected result of the given input. Starting this as a commitment snooze will save you a lot of time in the future.

Grant Pointer Access to Test Scripts

The second tip is that I always provide a pointer and code access to Claude to run my test scripts. I then told the pointer to run test scripts after making the changes, before ending its current implementation.

Having your own bootable agent and docker images will greatly increase the number of bootable sessions per boot

This will save you a lot of time when your coding agent installs a feature, then you have to manually run and test the dock image. If you now encounter an error, you have to paste that into your code agent, and the cycle repeats until the code works.

This is a waste of time, and something you should work hard to avoid. Giving your agent access to test scripts is essentially like giving your coding agent a tool, which strongly improves performance in software engineering tasks. I can't stress enough how much time it saves me.

Lasting

In this article, I discuss how you can create a realistic production environment by creating build, run, and state-of-the-art documentation for your environment. Doing this Lower Iteration speed, which is a critical part of being an efficient system. In addition, I covered how I do this in practice: By dropping a pointer to create test scripts, and some example events that I can run on the docker image. I then provide pointer and code access to the cloud to use these scripts, which makes my system work very well.

I believe that having a fast iTearation speed is important for almost all software engineering jobs, and it's something you should strive for. Creating local test files and giving your agent access increases the speed of iteration a lot, which is why I believe that doing so myself has greatly increased my productivity as a program.

👉 My free tools

🚀 10x Your Engineering with LLMS (Free 3-Day South Course)

📚 Get my FREE language ebook models

💻 My webinar on visual language models

👉 Find me in the community:

📩 Subscribe to my newsletter

🧑💻 Get in touch

🔗 lickEdin

🐦 X / Twitter

✍️ Medium

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button