Making Performance Testing Less Painful

For most undergrads while getting their CS degrees, pining away at side projects we will often forget how important testing and quality assurance is when we publish our projects. Although to be fair, it makes sense why that is the case. At that time, you just want something that works. That in and on itself is an achievement. With the rise of scripting languages such as JavaScript and Python with the new batch of programmers, it’s not very sexy for us to write load tests with something like JMeter.

To make this all a little less painful for everyone I would recommend k6. You write the performance tests using JavaScript but it actually doesn’t run the tests using NodeJS as it is not very performant for this use case. Instead it utilizes a JavaScript runtime that is embedded within a Go program.

This makes the process of actually writing very complex test cases a breeze as you are writing ES6 JS for making requests and we can scale this to simulate virtually any use case.

At my internship I noticed that our APIs were in severe need for some optimization and in order to quantify the improvements I wrote some k6 tests along with streaming the test results in real time to a InfluxDB instance which was then used to visualize the data using Grafana. The amazing thing was that we were able to get all this setup in the span of an afternoon. I would highly recommend trying out k6 and especially combining it with Grafana to visualize the data.