Apache Jmeter Tool-article

Integration Project Testing Using the Apache Jmeter Tool

The Apache JMeter application is an open source software – a 100% pure Java application – designed to load test functional behaviour and measure the performance of web applications. Whilst originally designed for web applications, it can also be used for other test purposes, such as the testing that is required during integration projects.

Because we carry out many integration projects at Mitra on behalf of our clients, we’d like to share our knowledge of the tool and explain how it can be used throughout a continuous integration process.

The need for integration

In today’s day and age, companies that want to stay ahead of the game need all their systems to work in sync. Systems could include accounting software, CRM systems, HR systems etc. Systems that are not integrated result in significant increases in cost and resource consumption, and integration is the process of bringing together these smaller, often disparate components/subsystems into a single, larger and more comprehensive system that functions and communicates as one.

Integration testing

software-testing-training

When software solutions are integrated, developers must ensure – during the software engineering process – that any new functionalities or modifications introduced do not disrupt the designed flow and must work as the business analysts expect. As software moves closer to deployment, integration testing helps to expose any problems or faults with the interfaces among program components before trouble occurs in real-world program execution.

Integration testing follows on from unit testing in which two or more units that have already been tested are combined into a component and the interface between them is tested. A component, in this sense, refers to an integrated aggregate of more than one unit. In a realistic scenario, many units are combined into components, which are in turn aggregated into even larger parts of the program. The idea is to test combinations of pieces and eventually expand the process to test the modules with those of other groups. Eventually all the modules making up a process are tested together.

Testing types:

Continuous Integration (CI)

Continuous integration is the process of ensuring all developers working on a project upload their work to a shared mainline several times a day. Each upload is verified by an automated rapid feedback tool, which enables developers to spot – and correct – any development errors quickly before they are added to a larger code base.

Regression Testing

Regression testing is a fundamental part of the CI process. In CI development environments, engineers merge code that is under development with the mainline codebase at frequent time intervals. The merged code is then regression tested to help ensure the codebase remains stable and continuing engineering efforts can be performed more reliably. This is an advantageous approach because it can reduce the amount of code rework that is needed in later phases of development, and speed up overall development time.

Organisations that create software are increasingly using integration processes such as CI and Regression Testing to improve their product development, and tools – such as Apache Jmeter – for supporting these processes are increasingly common.

Integration Testing with the Apache Jmeter Tool

At Mitra Innovation, integration testing is an important aspect of software development. There are several challenges inherent to this kind of testing due to the diverse back ends and functionalities that integration projects tend to have. The testing challenges may include:

  • Different file transferring mechanisms
  • Scheduled jobs
  • Different listeners
  • API’s
  • Different security protocols

As part of our development work we have can achieve almost all the above aspects of integration testing using the Apache Jmeter tool.

What is Apache Jmeter? The tech bit…

JMeter is a software that can perform load testing, performance-oriented business (functional) testing, regression testing, etc. on different protocols or technologies. It was written to primarily test the performance of Apache JServ (now known as Apache Tomcat project) but Apache later redesigned JMeter to enhance the GUI and to add functional testing capabilities (e.g. regression tests, operational tests).

JMeter is a Java desktop application with a graphical interface that uses the Swing graphical API. It can run on any environment / workstation that accepts a Java virtual machine, for example − Windows, Linux, Mac, etc. The protocols supported by JMeter are:

  • Web − HTTP, HTTPS sites ‘web 1.0′ web 2.0 (ajax, flex and flex-ws-amf)
  • Web Services − SOAP / XML-RPC
  • Database via JDBC drivers
  • Directory − LDAP
  • Messaging Oriented service via JMS
  • Service − POP3, IMAP, SMTP
  • FTP Service

The following are some of Jmeter’s features:

  • As an open source software, it is freely available
  • It has a simple and intuitive GUI
  • JMeter can conduct load and performance tests for many different server types − Web – HTTP, HTTPS, SOAP, Database via JDBC, LDAP, JMS, Mail – POP3, etc.
  • It is a platform-independent tool. On Linux/Unix, JMeter can be invoked by clicking on a JMeter shell script. On Windows, it can be invoked by starting the jmeter.bat file
  • It has full Swing and lightweight component support (precompiled JAR uses packages javax.swing.* )
  • JMeter store its test plans in XML format. This means you can generate a test plan using a text editor
  • Its full multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups
  • It is highly extensible
  • It can also be used to perform automated and functional testing of the applications.

The Jmeter tool is limitless and we use it at Mitra to write our own custom development features and to fill in the gaps in a continuous integration process.

Here is an example of how we use Jmeter:

The image below demonstrates the usual flow of any integration project that we run at Mitra.

Apache-Jmeter-blog

We set everything up in accordance with a continuous integration process, and we use the Apache Jmeter tool for the most difficult and complex parts of development and the execution of test suites. For example, testing the file listeners on different servers like SFTP, becomes a very easy task with Jmeter, as the tool supports scripting languages. It is also very easy to accomplish file operations for test files in SFTP servers and to test the email listeners too.

We use Jenkins as the build server, and after Jmeter’s results have verified that all code change tests have passed, Jenkins then deploys the corresponding artifacts to the relevant environments and inform the managers, leads and developers that this has been completed.

 We recommend Apache Jmeter…

Mitra Innovation recommends Apache Jmeter to developers who need a functional testing tool that can be adapted to their needs. Jmeter makes it possible to create tests as soon as the development work starts and helps to avoid dependencies where developers are waiting weeks for a solution to their testing needs. It can be used as a primary functional testing tool, as it enables users to extend it to meet their needs, and it can also be incorporated into the Continuous Integration (CI) process and has several plugins that can help automate its execution.

We use Jenkins as the build server, and after Jmeter’s results have verified that all code change tests have passed, Jenkins then deploys the corresponding artifacts to the relevant environments and inform the managers, leads and developers that this has been completed.

mitrai-isuru

About the author 

Isuru Gunawardana is a Technical Lead at Mitra Innovation, a technology company that specialises in product and company incubation, systems integration, and digital innovation and transformation. Find out how Isuru and the rest of the Mitra team can help you make the most out of integration testing using the Apache Jmeter tool.