Question: Take the given Python file. Analyze the functions provided and determine what inputs could possibly cause a function to crash. Additionally, what would you expect

Take the given Python file. Analyze the functions provided and determine what inputs could possibly cause a function to crash. Additionally, what would you expect given a possible input? All of the functions have at least two distinct ways something could go wrong. This could be due to data type or it could be due to the actual value of the variable. Once you have a correct input, you also need to verify correct things are being done with the input.
Generate a separate Python file with PyTest tests for each of the Python functions. Each function should have FOUR tests AT MINIMUM. Each function should have two distinct items to be tested (then, you could have multiple tests testing that one item; i.e., testing input conversion with an int and a string). For instance, testing for data type crashing and testing that the math is done correctly are technically two distinct types of tests. You'll need 50 tests at minimum for the project as a whole. So, some functions may get more than the required 4 tests. (PyTest when run should register 50 distinct tests.)
(** Keep in mind, you don't have to test every part of a function. If you're testing for functionality, you don't necessarily always have to test for correct outputs at that time.)

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!