Performance Testing is easy. The hard part is to design tests that mimic live conditions as close as possible. In some cases, you’ll find that all of the effort that goes into developing these use cases doesn’t match up to real production use cases. While Apache JMeter does a pretty good job in designing tests that can do load, stress and spike testing, GoReplay can accurately mimic production traffic and replay them to Test/Staging environment with ease.

GoReplay shadows live user traffic and mirrors it to a test environment either in realtime, or asynchronously via Apache Kafka, filesystem etc.

GoReplay Shadowing Technique

Steps:


With large APIs, it becomes difficult to automate each and every request. This makes API tests difficult to maintain, with greater risk of bugs on live systems.

As the complexity of a system grows, it very quickly becomes impossible to get adequate coverage using hand-written tests, and there’s a need for more advanced automated techniques that require minimal effort. Diffy is one such application that can be used.

Diffy behaves as a proxy and multicasts request to Staging and live application and compares the response between the two. …


Better (and effective) Assertions on JSON API response

Most API tests inspect the response body, typically a JSON object, for some expected result.If the response fails to match the expected criteria, the tests fail. Which parts of JSON response should be tested though? Take the following JSON for example:

{
"result": [{
"id": 123,
"name": "ABC",
"timestamp": 3838291839013981
}, {
"id": 456,
"name": "DEF",
"timestamp": 3838291839013982
}]
}

A sample assert (In Java) would be as follows:

JSONObject data = getData("/sample/sample.json");Assert.assertTrue(data.has("result"));
Object resultObj = data.get("result");
Assert.assertTrue(resultObj instanceof JSONArray);
JSONArray result = (JSONArray) resultObj;
Assert.assertEquals(2, data.length());JSONObject firstObj = result.getJSONObject(data.get(0));Assert.true(firstObj.has("id"))…

Reshadat Ali

QA Specialist @ Sophos

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store