Why does Component Testing matter?

A common term mentioned in testing circles over the last few years is the concept of ‘Shift Left’, more precisely it is the idea that testing should be done earlier in the software development life cycle. The ‘Shift left’ concept is nothing new, starting with iterative development and now with the rise in popularity of Agile, modern applications these days typically consist of more and more building blocks, small self-contained components developed, tested and delivered every few weeks.

Developing an application in small bite-size morsels means that testing is no longer waiting on development to finish, as each user story is developed, it can be tested, meaning that any issues can be uncovered early and are cheaper and easier to resolve.

So, how is it done?

A popular approach used with Agile development is the idea of Continuous Integration and/or Continuous Delivery. The terms are interchangeable but the approach typically consists of a source code repository and the ability to deploy code to its appropriate home. For example, a development team might check-in code changes during the day and an automated build process (based on a set of rules) checks-out the code, compiles it and deploys it within an application server.

Because of the frequency of deployment, successful component testing relies heavily on test automation. This is incorporated into the build process to ensure deployed code functions correctly by executing a series of tests against it and reporting the result.

It functions, but does it Scale?

These self-contained, bite size pieces of code could be thought of as functions, that when provided with the appropriate parameters, could return the answer to a question. An everyday example could be searching for directions based on postcode, these types of functions provide a service to the thing that called them. A few years ago, functions or services similar to these were mostly used to integrate internal systems, they formed part of the Application Programmers Interface (or API).

Modern APIs often form the core of an organisation intellectual property and are usually available for consumption by external clients such as businesses, partners and end customers.

The growth of these public APIs is increasingly pervasive (http://nordicapis.com/tracking-the-growth-of-the-api-economy), a company could be doing something simple like using another companies Map API to show office locations to using a third-party API to authentic users and grant them access to services.

Performance of these shared services is becoming critical as it has a direct impact on end-user experience. The popularity of mobile applications has taken this further, exposing the public APIs of these companies to a huge number of users, meaning high visibility should they fail.

For this very reason, organisations adopting component-based architectures not only need to ensure the services they provide function but that they are capable of supporting the large volumes of consumers that will be accessing them. Having non-functional test strategies in place for component and integration testing reduces the risk of unexpected performance issues later in the development life cycle. Consider the analogy of an engine, if we tune each and every component, when we assemble (or integrate) the various parts of the engine together and turn it over, it should be running at maximum efficiency.

For Web technologies, Web services were one of the first examples of these shared services, while the current trend is to rely on REST APIs. These micro services are becoming mainstream for new application development.

Let’s test it and find out

Like traditional load testing, component testing still requires support for specific protocols. The key difference is the ability to test early and test often, no longer waiting for an application presentation layer to become available but testing those services below the waterline as soon as they are ready.

NeoLoad supports testing Web and mobile applications based on or around the HTTP protocol, these range from bespoke applications and COTS packages such as Siebel or SAP to advanced features such as databases and messaging queues (via our JMS support). Details of these and other supported technologies can be found here.

Below you will find a few examples of how NeoLoad can be used in a typical continuous delivery pipeline to component test different technologies.

So what’s next…

Once we have a set of working component tests, these can be incorporated as part of a development teams continuous integration and delivery pipeline. NeoLoad integrates with tools such as Jenkins, Bamboo and Team City as well as having a comprehensive command line and runtime APIs.