Icon

01.Testing Component Calculate Scores - Exercise

<p>This workflow performs a unit test on a shared component, captures some metadata and potential component errors, and then compiles this information so that it can be easily used in an execution report, for example.</p>
Annotations and comments
  • Part 4 - Testing Exercise 01 Testing Component Calculate Scores
  • Learning objective: In this exercise you'll practice the creation of unit tests in a structured way for future reports. Workflow description: This workflow performs a unit test on a shared component, captures some metadata and potential component errors, and then compiles this information so that it can be easily used in an execution report, for example. You'll find the instructions to the exercises in the yellow annotations.
  • Step 1. Check the differences between the actual and expected output of the component Drag a Table Difference Finder to this part of the workflow. Connect it to the output of both Domain Calculator nodes. In the configuration menu, select only Sentiment Score and Sentiment Prediction columns to test the differences Let the node fail if values differ between the tables Connect the output flow variable port of the Table Difference Finder to the upper input port of the Catch Errors (Var Ports) node. Reset and execute the whole workflow. The test should pass. Save this workflow and move it to folder "L3-DA Productionizing Data Apps/Part 4/Unit Tests"
  • Predict sentiment based on score (#Positive-#Negative)/ (#Positive+#Negative)
  • Export status and metadata
  • Sample of processed real-world data
  • Golden data for what is expected as the output of the component
  • Alternative input in case the test fails
  • Capture information related to test execution
  • Timestamp
  • User
  • Default status variables 0 - success 1 - error
  • Workflow execution status and metadata

Nodes

Extensions

Links