Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with testing and debugging in python 3. How do i use White Box and Black box tests for this? Question 1 (12
I need help with testing and debugging in python 3. How do i use White Box and Black box tests for this?
Question 1 (12 points) Purpose: To practice testing and debugging code that someone else wrote Degree of Difficulty: Moderate In the document a5q1 functions.py you'll find two functions: findMin(): Returns the smallest value of a given list of numbers. min_lists(): Returns the list containing the smallest value These functions contain errors. Your task will be to find the errors using testing. Ordinarily, you would simply fix the errors, but in this question, you will explain what the errors are. You will not need to hand in the corrected code Part of the exercise is figuring out what the code is supposed to do (based on the documentation)! 1. Write white-box and black-box tests for the function findMin (. You should do this without Python, either on paper, or in a simple document. Don't worry about implementing your tests or test-driver 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. 2. Implement your test cases in a document named a5q1_testing.py. This can be done using the techniques given in the textbook (Chapter 15), or as demonstrated in a Lab 3. Run your tests, and copy/paste the console output to a document named a5q1 output.txt. The console output you hand in should come from the program before you try to fix it! 4. Try to deduce the problem with the findMin () function from the output of your testing. Then fix the error in the function! 5. In the document a5q1_output.txt, describe the error(s) you found, and how 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 functions. 6. Repeat the above steps for the second function, min_lists) What to Hand In Remember, for this question, you do not need to hand in the fixed code! A document called a5q1_testing.py containing your testing code as described above. A document called a5q1_output.txt (rtf and pdf formats are also allowable) with the console output of your test driver copy/pasted into it, and the explanations of the errors you found Be sure to include your name, NSID, student number, course number and lecture section and laboratory section at the top of all documents. Evaluation 3 marks: Your test-driver for findMin() contains at least 6 test cases. 3 marks: Your test-driver for min_lists contains at least 6 test cases. . 2 marks: The output of your test drivers reveal faults in the given functions. 1 mark: You correctly identified one error in findMin(), and explained briefly how you fixed it. 3 marks: You correctly identified three errors in min_lists(), and explained briefly how you fixed them
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started