QuestionQ183

VerifiedDebugging and Deploying

You are testing a set of mathematical functions, including one that computes the area beneath a curve defined by another function.

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

What type of test does the line above represent?

Explanation

This is a unit test: it checks the behavior of myIntegrate for a specific input by asserting that its first returned value equals the expected integral of x squared from 0 to 3, which is 9. The lambda supplies a simple test function. Computing a mathematical integral does not make the test a software integration test; the assertion targets the behavior of an individual function.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!