you need to fill in the table with the inputs you choose for testing and justify your selection. You need to write only seven different/distinct test cases and explain why you have chosen the inputs for these cases.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 28SA
icon
Related questions
Question

You are given the following JavaDoc and asked to write the test cases for this method. You do not need to write the java code (JUnit); instead, you need to fill in the table with the inputs you choose for testing and justify your selection. You need to write only seven different/distinct test cases and explain why you have chosen the inputs for these cases.

Note that no redundant or duplicate test cases are acceptable.

 

 

 
 
Table for JUnit test Cases
Expected
Output
Description and Justification
for the JUnit Test
a fromlndex tolndex key
Transcribed Image Text:Table for JUnit test Cases Expected Output Description and Justification for the JUnit Test a fromlndex tolndex key
You are given the following JavaDoc and asked to write the test cases for this method. You do not
need to write the java code (JUnit); instead, you need to fill in the table with the inputs you
choose for testing and justify your selection. You need to write only seven different/distinct
test cases and explain why you have chosen the inputs for these cases.
Note that no redundant or duplicate test cases are acceptable.
Searches a range of the specified array of longs for the specified value using the binary search
algorithm. The range must be sorted before making this call. If it is not sorted, the results are
undefined. If the range contains multiple elements with the specified value, there is no
guarantee which one will be found.
Parameters:
a - the array to be searched
fromIndex - the index of the first element (inclusive) to be searched
toIndex - the index of the last element (exclusive) to be searched
key - the value to be searched for
Returns:
Index of the search key, if it is contained in the array within the specified range;
otherwise, (- (insertion point) - 1). The insertion point is defined as the point at
which the key would be inserted into the array: the index of the first element in the
range greater than the key, or toIndex if all elements in the range are less than the
specified key. Note that this guarantees that the return value will be >= 0 if and only if
the key is found.
Throws:
IllegalArgumentException - if fromIndex > toIndex
ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
Transcribed Image Text:You are given the following JavaDoc and asked to write the test cases for this method. You do not need to write the java code (JUnit); instead, you need to fill in the table with the inputs you choose for testing and justify your selection. You need to write only seven different/distinct test cases and explain why you have chosen the inputs for these cases. Note that no redundant or duplicate test cases are acceptable. Searches a range of the specified array of longs for the specified value using the binary search algorithm. The range must be sorted before making this call. If it is not sorted, the results are undefined. If the range contains multiple elements with the specified value, there is no guarantee which one will be found. Parameters: a - the array to be searched fromIndex - the index of the first element (inclusive) to be searched toIndex - the index of the last element (exclusive) to be searched key - the value to be searched for Returns: Index of the search key, if it is contained in the array within the specified range; otherwise, (- (insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found. Throws: IllegalArgumentException - if fromIndex > toIndex ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
System Model Approaches
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning