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.
You might also like to view...
Write a function definition called even that takes one argument of type int and returns a bool value. The function returns true if its one argument is an even number; otherwise it returns false.
What will be an ideal response?
What are the three broad approaches available to the systems analyst for attaining quality in newly developed systems?
What will be an ideal response?
Describe the characteristics of a detail report.
What will be an ideal response?
When you no longer need a file or a folder you can use the ________ command to remove it from your drive.
A. install B. backup C. delete D. cleanup