SOFT8026 – Testing Lab
With the complexity of cloud/microservice-based systems growing seemingly exponentially, the
topic of testing has become very important. This lab covered two types of test: functional and non-
functional. Functional tests are primarily about binary results: data goes in, gets processed, and an
expected result should come out. Non-functional tests are more subjective: for example, you set
what you think is a bar for performance / latency and you expect that to be met; if latency should be
20ms or less, but it takes 50ms for a response, then it might be functional, but not to the expected
quality.
Functional Testing Example
Postman is a very useful testing tool for APIs / endpoints. It is most often used for testing web
services and web APIs, such as those using REST, but support for gRPC has been added.
See the following web-page for details on the addition of gRPC support:
[Link]
Step 1: Make sure you have installed Postman
Step 2: Run the greeter_server.py file from previous lab documents (no need for docker or
kubernetes, just plain old python will do). Make sure it is the original version from the repository
that does a simple, single response and doesn’t loop/yield.
Step 3: In Postman, click into your workspace or select the default one as in the image below
Step 4: Click on “new” and select “gRPC Request”:
Step 5: Add local ip and port number, then import the proto file so that Postman can discover the
API / endpoint. Click on “Select a method” and then click on “import a .proto file”. Find the file
and then click Next, followed by “Add a New API”.
Step 6: Select your method from the drop-down
Step 7: Make a simple request using JSON, adding the following under the “Message” tab:
{
"name": "Eminem"
}
Step 8: Click on “Invoke” and you should see a response in JSON format:
{
"message": "Hello, Eminem!"
}
Final Result:
Non-functional Test Example
We will use Gatling to perform stress / load testing on a web site. Begin by visiting the Gatling
open-source web-site at [Link] and reading the information there.
Click on the Download button on that page. Extract the bundle somewhere.
Read the Quickstart guide at [Link] and follow the
instructions.
The Quickstart links to the following page:
[Link]
It is important that you configure your browser as a proxy so that it can capture your traffic, such as
header information, page content, response times, etc. Firefox instructions are included.
Alternatively, you may have to research how to do it for your browser / OS. For example, with Edge
on Windows 11, you will be prompted to create a proxy via Windows 11 settings, e.g.:
Make sure the port number matches the one in the Gatling GUI.
Note: you will be unable to browse the rest of the Internet while that proxy is enabled, so disable it
once you are done using Gatling.