Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi there! Please give me the answers of these questions. And make sure to answer all of its parts. Please Solve it only if you're

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Hi there! Please give me the answers of these questions. And make sure to answer all of its parts.

Please Solve it only if you're sure that your answer is 100% correct otherwise let any other person to solve it.

I need the Correct answet please otherwise I'll give dislike and report it to the Chegg authorities. Sorry for these words but I'm tired of getting lots of wrong answers lately.

Please answer it as soon as possible and thank you so much for your time and effort! Quick please. No explanation is needed

Question 7 Consider the function interface documentation (the code is not shown because we don't need it) def check_row (row): Purpose: Checks whether the given list contains all the integers 1,,N, where N is the length of the list. Pre-Condition(s): row: a list of numbers Post-Condition(s): None Return(s): True if the list has all the numbers 1,,N False otherwise Now consider the following test case: inputs =[1,2,3] expected = True reason = "Valid row 1 " result = check_row(inputs) if result != expected: print( Error in \{\} : expected \{\} but obtained \{\}{}. format(test_item, expected, result, reason)) Which of the following statements is true for this test case? This is not a test case. This is ONLY a black-box test case. No answer text provided. It could be either white-box or black box. row: a list of numbers Post-Condition(s): None Return(s): True if the list has all the numbers 1,,N False otherwise Now consider the following test case: inputs =[1,2,3] expected = True reason = "Valid row 1 " result = check_row(inputs) if result ! = expected: print ('Error in \{\} : expected \{\} but obtained \{\}{} '. format(test_item, expected, result, reason)) Which of the following statements is true for this test case? This is not a test case. This is ONLY a black-box test case. No answer text provided. It could be either white-box or black box. This is ONLY a white-box test case. Consider the function selection_sort() that we looked at in lecture. def selection_sort(unsorted): Purpose: To onder the values in increasing onder. Pre-conditions: :param unsorted: a list of numbers Post-conditions: A1l values are removed from unsorted. Return: a list of all the values from unsorted, but in increasing order. sorted = list() while len(unsorted) > : out = min(unsorted) unsorted. remove (out) sorted.append(out) return sorted We saw several test cases that focussed on the return value, but we did not check the post-conditions. Which of the following test cases checks the post-condition for selection_sort()? data_1 - [0,1,4] expected =[0,1,4] reason = "check post-conditions for a short list" \# call the operation result = selection(data_1) if result I = expected: print("Error in \{\}: expected \{\} but obtained \{\}{}. format(test_item, expected, result, reason) data_1= [0,1,4] expected = [] reason = "check post-conditions for a short list" \# call the operation selection(data_1) result = unsorted if result != expected: print('Error in \{\} : expected \{\} but obtained \{\}{} 'format(test_item, expected, result, reason)) data_1 = [0,1,4] expected = [] reason = "check post-conditions for a short list" \# call the operation selection(data_1) result = data_1 if result != expected: print('Error in \{\} : expected \{\} but obtained \{\}{} ' format(test_item, expected, result, reason)) In the general case, how many test cases does a function need to pass in order to prove that it is correct? It depends on the number of lines of code in the function. 1 5 10 In general, it is not possible to prove that a function is correct Question 10 In the context of testing, an equivalence class is: A set of inputs that are close to a boundary case. A set of numbers or strings that will reveal faults. A set of inputs that are similar with regard to the properties of their expected outputs. A set of numbers that are close together in value. A set of inputs that together provide broad testing coverage of a function

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

What are some of the possible scenes from our future?

Answered: 1 week ago