Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You can identify the branches with the program's line numbers. Alternatively, you can include a control flow graph, either generated manually or using a tool
You can identify the branches with the program's line numbers.
Alternatively, you can include a control flow graph, either generated
manually or using a tool such as Control Flow Graph Factory for
example Eclispse Control Flow Graph Factory and refer to this graph
to identify
branches.The aim of this problem is to develop a test suite that achieves a coverage of
coverage of the branches of the ISBNValidate class methods. Write a test sequence that achieves coverage of the branches of each of the methods of the ISBNValidate class. Your test suite will be evaluated on the number of test cases it contains try to have the smallest possible number of test cases to ensure branch coverage Provide a table showing the links between your test cases, test data and branches covered. branches covered. This table should have the following format:
Here's what's inside the ISBNValidate class: ### Summary
The ISBNValidate class is a utility library designed to validate and format ISBNs International Standard Book Numbers It includes methods for appending check digits, validating ISBNs, converting between ISBN and ISBN formats, and tidying up ISBNs by inserting or removing dashes.
### Key Components
Constants and Fields:
DEBUGGING: A flag to control debugging output.
BANDS: Defines ranges for different formatting patterns.
VALIDGROUPS: Lists valid group numbers.
groupValidLookup: A BitSet to validate groups, initialized by buildGroupValidLookup
Public Methods:
Appending Check Digits:
appendCheckDigitToISBN: Adds a check digit to a digit ISBN to form a valid ISBN
appendCheckDigitToISBN: Adds a check digit to a digit ISBN to form a valid ISBN
Validation:
ensureISBNValid: Validates a digit ISBN.
ensureISBNValid: Validates a digit ISBN.
isISBNCheckDigitValid: Checks if an ISBNs check digit is correct.
isISBNCheckDigitValid: Checks if an ISBNs check digit is correct.
Conversion:
isbnTo: Converts an ISBN to ISBN
isbnTo: Converts an ISBN to ISBN if possible.
Tidying ISBNs:
tidyISBNorInsertingDashes: Cleans up and formats ISBNs by inserting appropriate dashes.
tidyISBNorRemovingDashes: Cleans up ISBNs by removing extraneous characters and dashes.
Private Methods:
buildGroupValidLookup: Initializes the groupValidLookupBitSet
calcISBNCheckDigit: Calculates the check digit for a digit ISBN to form an ISBN
calcISBNCheckDigit: Calculates the check digit for a digit ISBN to form an ISBN
ensureISBNGroupValid: Ensures the group part of an ISBN is valid.
ensureISBNPublisherValid: Ensures the publisher part of an ISBN is valid.
insertDashesInISBNor: Inserts dashes in an ISBN based on formatting rules.
strip: Removes extraneous characters from an ISBN, leaving only digits and the check digit.
Main Method:
When DEBUGGING is enabled, it runs tests on various methods to ensure their correctness.
### Main Functions
Validation: Ensures ISBNs are of correct length and structure, checks the validity of group and publisher numbers, and verifies check digits.
Formatting: Adds or removes dashes to present ISBNs in standard formats.
Conversion: Converts ISBN to ISBN and vice versa.
The class provides robust tools to handle ISBN data, ensuring they are correctly formatted and valid for use.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started