Tally has been a robust client running within the Windows platform on its own without the need to connect to other systems for a long period of time. However, with the evolving market and business landscape, Tally is transforming and providing capabilities that require it connect to third companies. A few of these are e-invoice bill generation as well as sending payment links using WhatsApp, GST upload/download and filing tax returns and many more.
This article is written to be read by people who are both technical and non-technical so you might see certain information in abstract form or in a bird’s-eye view. Contact us directly for further information regarding the technical aspects of implementation.
Notice: Sandbox is an example of a server created by a 3rd party to emulate the production server.
Requirements and challenges during testing of the linked features
During the initial development phase (where the connection with 3rd party is not yet ready), where we have the required specifications from the 3rd party; we have some of the following challenges/requirements to sign off the initial releases:
Does the client create the request in accordance with the specification of the third party?
Are all headers that are required are valid?
Does the payload meet the correct specifications?
Does encryption of the payload occur properly?
The way forward for the future of
There are two options to ensure quality control:
Go to the 3rd sandbox. try only the scenarios that you can test by using the sandbox.
Make our Sandbox.
To overcome the issues of integration with third party providers To address the issues with integration from 3rd party vendors, at Tally we decided to create the personal Mock server (a type of sandbox which is designed specifically to be used by Tally Solutions by the Tally QA team). This allowed us to conquer all of the issues previously mentioned and also helped us to improve our automation.
The challenges of Sandbox
Integration with a third party is not without its difficulties However, in this post we will be focusing on the problems facing the QA team has to overcome in order to test and validate the features the Tally client must communicate to third party entities. Below are a few of the issues:
3rd Party Sandbox availability.
Sandbox performance is not great, therefore QA team can’t test performance using it.
The simulation of most negative scenarios isn’t possible which is a sign of Sandbox. For instance, sending a negative responses if mandatory headers aren’t present or encrypted in error, for example.
Simulating exceptions like that the server closes the connection in a strange manner or responds after a time, etc.
Different 3rd party providers have different Sandboxes.
Challenges using mock servers
Making our sandbox work has its own challenge and/or requirements:
A mock server should be standard for NFR and function testing
Answer all the challenges under the “Challenges with Sandbox” section
Most test script writers lack proficiency in programming and are unable to comprehend the language of code
Making different mock servers available for different projects can result in an expense in maintenance
The concept behind mock servers is the design which is being developed.
The Mock server that was developed uses the following basic mechanism:
Here are a few of the elements that Mock Server needs to support:
- Multi-Threading The expected response should not be defined at the global level. This could limit the capabilities that Mock server. Mock server when looking to simulate a multi-threading situation in which two requests are made by two different clients simultaneously.
- Performance: Because the mock code is commonly used for Functional as well as NFR testing, there shouldn’t be too many loops. Likewise, the mock code must be light.
- Available This Mock will be accessible throughout the day.
- Reliability: The Mock should be able to determine whether the headers of requests received and payloads, headers and so on. conform to the specifications.
- Scalability The mock server must be able of supporting horizontal scaling in order to handle an enormous amount of users.
Technical specifications for this mock server Technical details of the mock server
Here are a few of the finer aspects about how a mock server gets constructed:
- The expected response will be set in relation to these parameters
- The type of request (Example Examples: Put, Post and Get, etc. )
- Request End Point
- Header/Payload key
- Header/Payload Value
When an request is received by the mock server the mock server extracts the request the endpoint, type, keys and other information from the request, and then compares them to the information that is already in place. It chooses the most compatible response and will respond using that payment status and response code.
- It is created using Node JS. When setting the desired response, we create an JSON structure and keep it in memory. To get the appropriate response we first index and then get the response code required and payload, so that there are no loops and that the mock server is able to be run at a high speed.
- To resolve the issue of availability the mock server has been designed capable of running on a local computer.
- In making the expected response, the mock server can be used to define the expected headers, the exception headers (headers which aren’t intended to be accepted) and also the expected payload. When a matching request is received, prior to making the anticipated response the mock server will also check whether the request contains all of the headers required in addition to determining if the request includes any headers that are not required and whether the payload of the request is in line with the expected.
- Mock server comes with an optional encryption and decryption mechanisms that can be activated in a dynamic manner based on the specific project requirements.
The advantages of having an untrusted server The benefits of using a mock server
The use of an in-house mock server offers the following benefits:
- Aids in identifying any issues in the client prior to joining with the 3rd entity in the initial phases. This helps to reduce any potential integration issues that may arise when integrating with third parties.
- The mock server function is able to be upgraded or modified according to evolving requirements of the business.
- Always accessible with very low latency.
- Ability to simulate situations that could be unexpected, for instance, connection breakdown servers down, connection breakage and so on. are simple to manage. The simulation of most scenarios using the Sandbox isn’t possible.
Read More