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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education