Question: Using python. On the course Moodle. you'll nd the following lets}: - statistics.py. which is an ADT covered in class and in the readings. For

Using python.

Using python. On the course Moodle. you'll nd the following lets}: -statistics.py. which is an ADT covered in class and in the readings.

On the course Moodle. you'll nd the following lets}: - statistics.py. which is an ADT covered in class and in the readings. For your convenience. we re moved some of the calculations. and operations ie.g.. wart) and ssmpvsri). that were not relevant to this exercise. which would have made testing too onerous - tast_statistics .py. which is a test-script for the Statistics ADT. This test script currently only im plements a few basic tests. In this question you willcomplete the given test script. Study the test script. observing that each operation gets tested. Because each object is differentwe cannot check if an object is created correctly: instead. we will check ifthe initial values are correct. Likewise. methods like midi) cant be tested directly. because the object's attributes are private: all we can really do is check to see if the addii method has the right effect in combination with count (ii and meant}. Design new test cases for the operations. considering: - Whitebox test cases - Blackbox test cases. - Boundary test cases. and test case equivalence classes. a Test coverage. and degrees of testing. a Unit vs. Integration testing. Running your test script on the given ADT should report no errors. and should display nothing except the message 'ttt Test script completed I\" ' . Note: You will have to decide how many tests to include. This is part of the exercise. What to Hand In a A Python script named a4q'2_tasting. py containing your test script Be sure to include your name. NSID. student number. oourse number and section at the top of all docu ments. Evaluation - 5 marks: Your test cases for Statistics . asst} have good coverage. a 5 marks: Your test cases for Statistics . meant} have good coverage. class Statistics (object) : CN def _init_(self) : 4 self. _count = 0 # how many data values seen so far self . _avg = 0 # the running average so far def add (self value): 10 11 self. _count += 1 12 k = self . _count # convenience 13 diff = value - self . _avg # convenience 14 self . _avg += diff / k 15 16 17 def mean (self) : 18 19 return self. _avg 20 21 def count (self) : 22 23 return self.. count

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 Programming Questions!