Good practices and considerations

BFlow is a powerful tool and offers a lot of freedom.

To keep the test scripts and test cases maintainable, follow these guidelines:

  1. Data management.

    Many sessions strongly depend on the data present in the different companies.

    Think about what master data is required. Other data is probably more volatile, and created and deleted during the execution of the tests.

    Cleanup data after tests have run.

  2. Test scripts perform small tasks.

    Keep reusability in mind! For example, create purchase order, add purchase order line.

    The tasks can be validated and a result can be returned to the caller.

    The test script should operate standalone and its actions are potentially driven by data provided by the input arguments.

  3. Test cases add complexity and are used to construct the business flows.

    Good practice is to have a single test case for each test scenario. This reduces impact when new test scenarios are implemented, or when existing scenarios must be adapted.

    Test cases cannot interact with sessions. Test cases are used to chain the test script or test cases together and form a business flow. Data exchange between the scripts is achieved by using the arguments of the test scripts and test cases that can have a different scope: In, In/Out, or Out. This allows a test case to feed the result value of one script as input to another script. Also the test case can validate these intermediate values and take appropriate actions if required.

  4. Prefer the use of variables over fixed values.

    Do not 'hide' fixed values inside test scripts or test cases. These are notoriously hard to find!

  5. Check results against predicted values whenever possible, that is, use ExpectedValue.
  6. Check return values of scripts before proceeding with the next step.

    A test scenario that fails at some point, but is allowed to continue, can cause data corruption and may make cleanup unnecessary complex. If something unexpected happens, terminate the script quickly and display a proper error message to help analysis of the problem.

  7. Use EasyFilter to locate a record that has time/date in the index field.