Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is my code please create the test plan with comments and answer the reflection questions if j *********** 5 def count_type (map_data, map_type): 6

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedHere is my code please create the test plan with comments and answer the reflection questions

if j *********** 5 def count_type (map_data, map_type): 6 count = 0 7 for i in map_data: 8 for j in i: 9 == map_type: 10 count += 1 11 return count 12 #For this function I am using nested loops and inside the inner loop I am checking if the element is equal to map 13 14 #******** ********* 15 # Write your classify_map function below: (4 marks) 16 #******************************************** 17 18 def classify_map (map_data): 19 for i in map_data: 20 if count_type(i, "R") > (len(map_data)*len(i))/2: 21 return "Suburban" 22 elif count_type(i, "A") > (len(map_data)*len(i))/2: 23 return "Farmland" 24 elif (count_type(i, "U") + count_type(i, "U")) > (len(map_data) *len(i))/2: 25 return "Conversation" 26 elif (count_type(i, "C") > (len(map_data) *len(i)/2)) and (count_type(i, "U") + count_type(i, "A")) >= 0.1 27 return "City" 28 else: 29 return "Mixed" 20 6 7 def isolate_type (map_data, map_type): 8 new_list = map_data.copy ( ) 9 idx_i = 0 0 for i in new list: 1 idx_j = 0 2 for j in i: 3 if j != map_type: 4 new_list[idx_i][idx_j] 5 idx_j += 1 6 idx_i += 11 7 return new_list 8 9 #1 firstly create a copy of the original list, then I loop through the copied list and check if the element 0 1 #*************** *********************** 2 # Write your commercially_buildable function below: (2 marks) 3 #******************************************** 4 def commercially_buildable(map_data,i,j): 5 # some condition check 6 if(map_data[i][j]): 7 return True 8 else: 9 return false 0 1 MAP = I'A' '' ' 'A' '' 'I' '' "IT' 1 Test Plan Develop a test plan for your program. Your test plan should have at least three test cases: one normal case, one boundary case, and one abnormal case. You can test any function but you must test at least two different functions. Please use the following format for your test cases: Function: Input: Output: Expected Output: Pass/Fail: An example test case is shown below: 'T' , 'A'), Function: count_type (map_data, map_type) Input: map_data = [['U', 'U','A'], ['R','T', 'W', ['U','T','A', 'W']] map_type = 'U' Output: 3 Expected Output: 3 Pass/Fail: Pass Implement your testing plan in the cell below! 1. Which functions did you use a nested structure (nested loops, nested conditionals, etc) to implement the requirements? Would it have been possible to implement them without using a nested structure? Which functions did you not use a nested structure? Would it have been possible to implement them with a nested structure? 2. Suppose we wanted to create an additional map classification called 'Urban City' which is indicated by the number of 'R' cells plus the number of 'C' cells being between 60% and 80%. Can we do this? How might this affect our classify_map() function? 3. How many test cases would you need to confirm that your classify_map() function correctly identifies a "Farmland" map? Explain what your test cases would be

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago