Question: More practice writing test-cases and implementing test-drivers Degree of Difficulty: In the document allq2_functions.py you'll find the function merge(): Given 2 lists whose elements are
More practice writing test-cases and implementing test-drivers Degree of Difficulty: In the document allq2_functions.py you'll find the function merge(): Given 2 lists whose elements are in increasing order merge them into one list of elements in increasing order. The code is below. The idea is to step through both lists one element at a time. Compare two elements one from each list, and put the smaller into the merged listed. If you reach the end of either list. add the rest of the other list to the end of the merged result. This function errors. Your task will be to find the errors using testing. You'll hand in an explanation of what the errors are, and how you fixed them, but you will not hand in the corrected code. Write white-box and black-box tests for the function merge(). You should do this without Python either on paper, or in a simple document. Don't worry about running your tests until you have thought about which tests you want. Make sure you have at least 3 black-box tests and 3 white-box tests as a minimum. More tests may be useful. Implement your test cases in a document named allq2_testing. py. This can be done using the techniques given in the textbook. Chapter 15 or as demonstrated in the Lab B. Run your tests and copy/paste the console output to a document named allq2_output.txt. The console output you hand in should come from the program before you try to fix it. Try to deduce the problems with the merge() function from the output of your testing. Then fix the errors in the function, so that your test driver does not indicated any faults. In the document allq2_output.txt. describe the error(s) you found and you fixed it them. You do not need to write a lot a sentence or two for each error is all we want. Write your explanation as if you are explaining the error to a colleague of yours who wrote the function. Remember, for this question, you do not need to hand in the fixed code A document called allq2_testing-py containing your testing code as described above. A document called allq2_output.txt. and pdf formats are also allowable with the output of your testing copy/pasted into it, and the explanations of the errors you found. Be sure to include your name, NSO, student number, course number and lecture section and laboratory section at the top of all documents. Evaluation Your test-driver for merge() contains at least 6 test cases. The output of your test driver reveals faults in the given function. Your correctly identified four errors in merge(). and explained briefly how fixed them. More practice writing test-cases and implementing test-drivers Degree of Difficulty: In the document allq2_functions.py you'll find the function merge(): Given 2 lists whose elements are in increasing order merge them into one list of elements in increasing order. The code is below. The idea is to step through both lists one element at a time. Compare two elements one from each list, and put the smaller into the merged listed. If you reach the end of either list. add the rest of the other list to the end of the merged result. This function errors. Your task will be to find the errors using testing. You'll hand in an explanation of what the errors are, and how you fixed them, but you will not hand in the corrected code. Write white-box and black-box tests for the function merge(). You should do this without Python either on paper, or in a simple document. Don't worry about running your tests until you have thought about which tests you want. Make sure you have at least 3 black-box tests and 3 white-box tests as a minimum. More tests may be useful. Implement your test cases in a document named allq2_testing. py. This can be done using the techniques given in the textbook. Chapter 15 or as demonstrated in the Lab B. Run your tests and copy/paste the console output to a document named allq2_output.txt. The console output you hand in should come from the program before you try to fix it. Try to deduce the problems with the merge() function from the output of your testing. Then fix the errors in the function, so that your test driver does not indicated any faults. In the document allq2_output.txt. describe the error(s) you found and you fixed it them. You do not need to write a lot a sentence or two for each error is all we want. Write your explanation as if you are explaining the error to a colleague of yours who wrote the function. Remember, for this question, you do not need to hand in the fixed code A document called allq2_testing-py containing your testing code as described above. A document called allq2_output.txt. and pdf formats are also allowable with the output of your testing copy/pasted into it, and the explanations of the errors you found. Be sure to include your name, NSO, student number, course number and lecture section and laboratory section at the top of all documents. Evaluation Your test-driver for merge() contains at least 6 test cases. The output of your test driver reveals faults in the given function. Your correctly identified four errors in merge(). and explained briefly how fixed them
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
