Question: Question 2 . 1 ( 2 5 % ) From the description of the ISBN validation and formatting rules as well as the method signature

Question 2.1(25%)
From the description of the ISBN validation and formatting rules as well as the method signature above, provide a black-box test plan for the tidyISBN10or13InsertingDashes method using the category partitioning approach. Your test plan should clearly show the parameters, environment conditions, categories, choices and constraints of the problem. Please create a table to report the results with the headers being Parameter/Environmental conditions, Categories, Choice, and Constraints. Here is the code for the method:/**
* Tidies up an ISBN by first removing stray dashes and
* non-numerics. Validates checksum, checks publisher number, and inserts dashes
* where they belong. Discards
* whatever it finds before or after the ISBN.
*
* @param rawISBN10or13 rawISBN text to be tidied, possibly with extra dashes,
* spaces or other junk chars.
*
* @return tidied dashed ISBN with lead and trail junk discarded. or an error
* message if the ISBN is invalid.
*/
public static String tidyISBN10or13InsertingDashes(String rawISBN10or13){
if (rawISBN10or13== null || rawISBN10or13.length()==0){
throw new IllegalArgumentException("no ISBN");
}
// strip lead, trail and embedded junk including dashes
final String dashlessISBN = strip(rawISBN10or13);
final int length = dashlessISBN.length();
switch (length){
case 10:
ensureISBN10Valid(dashlessISBN);
return insertDashesInISBN10or13(dashlessISBN);
case 13:
ensureISBN13Valid(dashlessISBN);
return insertDashesInISBN10or13(dashlessISBN);
default:
throw new IllegalArgumentException(
"ISBN must be 10 or 13 digits long.");
}
}
 Question 2.1(25%) From the description of the ISBN validation and formatting

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!