Unit testing

The aim of unit testing is to test each feature of your application in isolation to make sure it works as expected.

The Ghost Client provides a framework for unit tests. You can develop these tests via a Scenario interface.

What is unit testing?

A good unit test should provide you with the correct responses to a given set of anticipated user input, showing that the feature is able to handle correct as well as incorrect input. As a developer approaching unit testing for the first time, the following is recommended as good practice when designing unit tests:
  • It is recommended that 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.