The fundamental rule for testing functions requires that every function be tested in an already fully tested and debugged program. How can this be accomplished? Give a testing scenario for testing a program with main function that calls several functions.

What will be an ideal response?

The main function is tested with stub functions replacing each` function.
Stubs should be small enough that their correctness is assured. Stubs return enough
information to let the main function compile and run, so that it can be tested. Then
test the main function. Having done this, each function in turn can be tested.
An alternative is to test the functions with driver functions. Drivers are functions that
call the function to be tested. Drivers, like stubs, should be simple enough that their
correctness is assured. Then the function is called and tested. Clearly the assumptions
of ‘small enough’ that ‘correctness is assured’ are really questionable. However, this
procedure is better than writing a 200 line program or worse a 2000 line program and
then testing it.

Computer Science & Information Technology

You might also like to view...

A macro can create and send a report via e-mail by exporting the report to ________

A) Microsoft Outlook B) Yahoo!Mail C) Gmail D) any e-mail server

Computer Science & Information Technology

A data type thatdescribes numbers that represent a quantity and may be used in calculations

a. Short Number b. Number c. AutoNumber

Computer Science & Information Technology