To test a function, the programmer has to write a _________, which calls the function to be tested and passes it test data.

  1. Stub

  2. Driver

  3. Proxy

  4. None of the above


Correct Option: B
Explanation:

To solve this question, the user needs to know about software testing techniques, specifically unit testing. The user must identify the correct term for a program that calls a function with test data to test its functionality.

Now, let's go through each option and explain why it is right or wrong:

A. Stub: A stub is a piece of code that simulates the behavior of a function or module. It is used in place of the actual function or module during testing. While a stub can be used in testing, it is not the correct term for a program that calls a function with test data to test its functionality.

B. Driver: A driver is a program that calls a function with test data to test its functionality. It is used to test functions that rely on input from other functions or modules. This option is correct.

C. Proxy: A proxy is an intermediary between two systems that allows them to communicate with each other. It is not the correct term for a program that calls a function with test data to test its functionality.

D. None of the above: This option is incorrect because option B, Driver, is the correct answer.

The Answer is: B

Find more quizzes: