Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create two python projects app and test . Create your coding file as Lab3_firstname1_firstname2.py and test file as test_Lab3_firstname1_firstname2.py. Program Requirements: An inexperienced coder was
Create two python projects app and test. Create your coding file as Lab3_firstname1_firstname2.py and test file as test_Lab3_firstname1_firstname2.py.
Program Requirements: An inexperienced coder was working on a project of finding the areas of different shapes. He started with finding the area of a circular shape and wrote the following code: from math import pi def circle_area (r): return pi (r2) \# Test function radii = [2,0,3,2+5j, True, "radius"] message = "Area of circles with r={ radius } is \{area\}. for r in radii: A = circle_area(r) print(message.format(radius=r, area=A)) He got weird outputs which were not anticipated. You are required to analyze the output with your partner to understand the mistakes of the coder. Area of circles with r=2 is 12.566379614359172. Area of circles with r=0 is .. Area of circles with r=3 is 28.274333882308138. Area of circles with r=(2+5j) is (65.97344572538566+62.83185307179586j). Area of circles with r= True is 3.141592653589793. Traceback (most recent call last): File " A= circle_area(r) File " return pi * (r2) TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int' Process finished with exit code 1 The project manager got annoyed with him and requested you to complete the project along with best test cases without any failure. Design an application and its test cases file along with fixtures which calculates the areas of four shapes: Circle, Trapezium, Ellipse, and Rhombus. You are required to create a test case document (description of test cases and test case design table- same as ICE2 and Lab2) and submit it along with your project. Your project should execute the test cases of only the concerned shape. The shape option should be selected by the user. The option of selection should work for both uppercase and lowercase. [Hint: Create a test suite which contains a menu-driven options, and individual test cases are added to the suite depending upon the option selection] For e.g., it could look like this: Please enter one of the following options: 'c' for testing area of circle 't' for testing area of trapezium ' e ' for testing area of ellipse - 'r' for testing area of rhombus - ' q ' to quit What would you like to do? c setupclass setup End of test: Test areas when radius of circle >=0 setUp End of test: Exception raised areas when radius of circleStep 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