Implementing stubs

When you implement stubs, you want to consider a few points such as naming conventions and folder structure.

As the number of stubs grows, it is important to be able to differentiate between stubs. If you can deduce information from the stub name, you avoid wasting time while searching for a specific stub.

Consider the following points:
  • Use good naming conventions to name your stubs.
  • Create logical folder structures to store your stubs.
  • Use the Business View to add meaningful descriptions of what each action in a stub does.
  • Use the Comment action to describe difficult steps in a stub and to offer clarity.
  • Use the Documentation tab of the stub to add a description of the function of the stub.
  • Create data-driven stubs. The data that is defined in spreadsheets or any other data sources can cover as many test cases as possible, reducing the number of stubs to implement. When recording events, the data fields that are promoted to the events table are used to create the data source.
  • Sift and pass-through: If there are no live systems or if you are not permitted to access a live system, sift and pass-through is irrelevant. However, if a live system must be accessed, set up the stubs up to look for identifiers within messages, and pass-through to the live system any messages that do not contain those identifiers.