Performance testing

Performance testing is a type of testing where we check how our application is performing with an expected workload. This is a very essential type of testing for our type of application because performance testing will provide us with an opportunity to improve the performance of our functions, and will also help to improve the speed of scaling. Scaling is a very important feature of functions, but it is our responsibility to code it in a fashion that will help it scale faster. This is where performance testing will help. 

One of the very popular tools for performance testing is Jmeter. It is widely used across the industry. The Jmeter stress test will examine load-testing KPIs, such as the response time, error rate, memory leaks, slowness, security issues, and data corruption. Jmeter requires a performance parameter script. We can start creating the script with the BlazeMeter Chrome extension.  

Another popular tool is Artillery, which can be used for performance testing, load testing, and functional testing. It is an open source tool, and is built over Node.js. It can generate a load for an application and can simulate virtual users. You can run through this simple installation using the following code: 

$ npm install -g artillery
$ artillery quick --count 10 -n 20 https://artillery.io/
Started phase 0, duration: 1s @ 21:13:07(+0100) 2018-08-28
Report @ 21:13:10(+0100) 2018-08-28
Scenarios launched: 10
Scenarios completed: 10
Requests completed: 200
RPS sent: 69.44
Request latency:
min: 28.3
max: 248.4
median: 41.9
p95: 127.1
p99: 191.7
Codes:
200: 200
All virtual users finished
Summary report @ 21:13:10(+0100) 2018-08-28
Scenarios launched: 10
Scenarios completed: 10
Requests completed: 200
RPS sent: 69.44
Request latency:
min: 28.3
max: 248.4
median: 41.9
p95: 127.1
p99: 191.7
Scenario counts:
0: 10 (100%)
Codes:
200: 200

There is also a combination of Serverless Framework and Artillery, called serverless-artillery. This package will help us to deploy the function and run the performance test through a single Node.js package, and makes it easier to integrate it into our CI/CD pipeline. More information can be found at//github.com/Nordstrom/serverless-artillery.

Testing is very important in order to weed out defects and errors in the early stages of development, but we have to make sure that it is introduced very early in the development cycle, and should be performed until production. But it is equally important to automate it, and it should be integrated with the continuous integration and continuous delivery cycle. But serverless testing has its challenges, as follows: