Question: (the example from Programming Assignment 2 with a duplicate entry in line 4), the program should yield the same outputs as before. Write at least

 (the example from Programming Assignment 2 with a duplicate entry in

(the example from Programming Assignment 2 with a duplicate entry in line 4), the program should yield the same outputs as before. Write at least one test case for each scenario. Fix the code if the test fails. Notes: 1. Put the test cases in a separate file. It is a good programming practice to separate the test code so it eventually does not get pulled into the production code. 2. You will need to read ahead to the chapter on unit testing which will be covered in Reading Assignment 10. 3. To simplify your work, you don't have to worry about complete code coverage (exercising every statement in the program). For example, scenario 2 has several different situations - just test for one of them. 4. As you reexamine your code in Programming Assignment 2, consider also opportunities to make the code more Pythonic by making use of comprehensions and iterables. Conceivably, you can use a generator to create some random test data also. These are all optional improvements, and good practice as a Python programmer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!