Unit Testing

With unit testing, you can monitor the health of your application and detect errors in individual flows or Activity levels.

While designing an application with multiple flows and activities, it becomes cumbersome to detect runtime errors at the flow and Activity levels. Using unit testing the errors at micro level are easily handled. You can run unit testing at any phase of the development cycle to verify whether activities in the process are working as expected. Using testing processes in the development stage (before you push the application to the production environment), helps detect errors and identify issues at an early stage.

Terminologies in Unit Testing
  1. Test case: A test case is the individual unit for testing a flow. For a given set of inputs, the test case checks for a specific output for an Activity or the flow output. The expected versus actual output is compared by adding assertions to the test case.A test case can have multiple assertions added on activities and flow output. The test case is considered as passed when all the assertions in that test case pass.

  2. Assertion: An assertion is a logical expression that evaluates to a boolean value. The expected versus actual output is compared by using an assertion expression. For the passed assertion, the expression evaluates to true. A non-boolean expression always evaluates to false.

  3. Flow Input: Flow input is a set of input data used to run the test on the given flow. Each test case has its own set of inputs.

  4. Flow Output: Flow output is the output generated for the given flow for the given set of inputs. Flow output can have one or more assertions.

  5. Test Suite: A group of test cases make a test suite. An app can have multiple test suites. The test suite is considered as passed when all the tests in the test suite are successfully run.

  6. Test Suite file: A test suite file is an exported file that contains all the test suites for a given Flogo app. The file has .flogotest as its extension and can be exported from the studio as well as the platform API. The test suite file along with the Flogo app binary can be used to run the test cases in the stand-alone environment outside TCI.

  7. Test Result File: A test result file with extension .testresult has the detailed execution result of the test suites, the test cases under that test suite and the assertion execution result for each test case. The test result file is generated after running the tests on the exported binary.

Role Requirements