Test Types

The Genero Ghost Client can assist with unit, load, and performance testing.

Unit Tests

Unit testing is a method of testing each feature of your application in isolation to make sure it works as expected.

A unit test should provide you with the anticipated responses to a given set of user input, showing that the feature is able to handle both correct and incorrect input. The following good practices are recommended when designing unit tests:
  • Each 4gl application should have its own scenario.
  • Make a complete list of the application features, from the smallest (for example, displaying the About... screen), to the biggest and / or the most important ones.
  • For each feature in this list, write a single test that will test one (and only one) feature.
  • If a primary feature implies a secondary feature (for example, to register a new customer, you need to fill out a form), the secondary feature's test should take place before the primary feature's test in the test sequence.

Load Tests

Load testing describes a testing strategy that simulates a specified number of users using your application at the same time and at normal human speed.

Load testing your application during development allows you to see how it will behave under similar conditions in a production environment. Load testing can help you identify server and network requirements based on the number of anticipated users: how many servers, how much memory is needed, and so on. Observations made under these test conditions can also show an application's weaknesses and allow you to fix them before release.

The GGC allows you to specify several options through the Launcher class for load testing:

  • The thread_number option allows you to set the number of users to simulate. One thread represents one user.
  • The thread_delay option allows you to set a delay between each user's connection. For example, in a real life situation where a thousand users could potentially launch an application, the likelihood of them all connecting at the exact same time is quite remote. The thread delay option helps you to recreate a more realistic simulation.

    You can specify the number of threads (users) and the thread delay using the command line switches when launching tests. As shown in the example below, the GGC will launch the IntegrityTestsSessionManager with 3 users, allowing a 3 second delay between each launch.

    java com.fourjs.ggc.Launcher -s com.fourjs.ggc.testcases.IntegrityTestsSessionManager -u http://localhost:6394/ua/r/gwc-demo -t 3 -td 3

The Scenario for load testing needs to reflect how a real user would use an application. For example, the setDelay() method can be set to make the GhostRunner instance wait for a specified number of seconds between each action. This allows you to try to reproduce the human speed of interaction with an application, which is usually much slower than computer speed. Any interaction a user would normally do on an application can be played.

Performance Tests

Performance testing is similar to load testing as it also consists of simulating a significant number of users, however the aim of the test differs. Performance testing can determine when the system's performance will start to degrade. To performance test, you specify increased numbers of simulated users so as to observe at what number of users the request/response delay is affected.