
Answer-first summary for fast verification
Answer: Unit testing
### Explanation **Unit testing** is the practice of testing small, isolated, and self-contained pieces of code, such as a single function or method. Databricks defines unit testing as an approach to testing self-contained units of code early and often. Verifying the logic of a specific mathematical routine in isolation is a classic example of a unit test. ### Why the other options are incorrect: * **Manual testing** involves human execution and observation without automated assertions; the scenario describes a line of code (automated). * **Functional testing** validates an application's behavior against user-facing requirements, typically involving multiple units working together. * **Integration testing** focuses on the interaction between different components or systems (e.g., how a function interacts with a database), rather than a numeric routine in isolation. * **End-to-end testing** validates the entire data pipeline or application workflow from input to output, which is much broader than testing a single algorithm.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Suppose you are writing a test for a specific mathematical function that calculates the area under a curve. Which type of testing does this represent?
A
Manual testing
B
Integration testing
C
Unit testing
D
Functional testing
E
End-to-end testing
No comments yet.