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...
A(n) ____ anomaly occurs when a user deletes data from a database and unintentionally deletes the only occurrence of that data in the database.
A. update B. deletion C. append D. purging
Prove that a graph G is regular
Hint: Use Equation 8.3.1 for a regular graph.
Links that are underlined or highlighted only when the mouse pointer hovers over the linked text display what is known as the hover over effect.
Answer the following statement true (T) or false (F)
Case AC 3-1Danielle is a Sales Manager and is troubleshooting why profits are down.Danielle wants to see which items are the least profitable. She chooses the Profitability field of her product datasheet and clicks the ____ button.
A. Ascending B. Descending C. Selection D. Advanced