Databricks Certified Data Engineer Professional — Question 92

You are testing a collection of mathematical functions, one of which calculates the area under a curve as described by another function.

assert(myIntegrate(lambda x: x*x, 0, 3) [0] == 9)

Which kind of test would the above line exemplify?

Answer options

Correct answer: A

Explanation

The assertion in the line of code is testing a specific function's output against an expected value, which is a characteristic of unit testing. The other types of tests, such as manual or integration tests, do not focus on verifying the output of a single function in isolation, which is why they are not the correct answers.