Question: Question 2 . 1 ( 2 5 % ) From the description of the ISBN validation and formatting rules as well as the method signature
Question
From the description of the ISBN validation and formatting rules as well as the method signature above, provide a blackbox test plan for the tidyISBNorInsertingDashes 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 ParameterEnvironmental conditions, Categories, Choice, and Constraints. Here is the code for the method:
Tidies up an ISBN by first removing stray dashes and
nonnumerics. Validates checksum, checks publisher number, and inserts dashes
where they belong. Discards
whatever it finds before or after the ISBN.
@param rawISBNor 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 tidyISBNorInsertingDashesString rawISBNor
if rawISBNor null rawISBNorlength
throw new IllegalArgumentExceptionno ISBN";
strip lead, trail and embedded junk including dashes
final String dashlessISBN striprawISBNor;
final int length dashlessISBN.length;
switch length
case :
ensureISBNValiddashlessISBN;
return insertDashesInISBNordashlessISBN;
case :
ensureISBNValiddashlessISBN;
return insertDashesInISBNordashlessISBN;
default:
throw new IllegalArgumentException
"ISBN must be or digits long.";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
