We want to decide what tests to run to test the following function using path coverage. In this example, branch and path testing are the same. First we should list the paths through this function. One path, for someone who had an ACT of 17, for example would be: lines 1-2-8List the other two paths through the function:
Now determine values of ACT and MATH that would cause each of the 3 paths to be executed once. Fill in test case input and the expected "output" resulting from the input in the table below.
What is output when "Test 1" is executed in TestCSCI( )?
In the CSCI( ) function , give values for 3 boundary tests.
Copy inlabl4 to your account and run this run-unit by typing
Use input partitioning to design 4 test cases. You are to choose valid and invalid values of A, B, and C. Write your choices in the table on the answer sheet. Predict what the values of X1 and X2 will be and then fill in the "Expected Results". If you give values of A, B, and C that cause a runtime error you should write that under "Error Messages." The rest of the table will be filled in in Exercise 7.
In the last part of this lab on testing, you should gain experience in testing a unit (actually a function). Copy the source file inlabl4b.cc to your account and after studying the code for the function which it contains, decide on the tests that should be run to adequately test 5 paths in the given function. Place your choices for test data and your expected results in the table in the answer sheet. Run the program using the test data chosen and record the actual results in the table.Turn in a script file containing the source file and the results from your test runs. If your actual results are different from the expected results then you found errors in the code.