Answered step by step
Verified Expert Solution
Link Copied!

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
100% coverage of the branches of the ISBNValidate class methods. Write a test sequence that achieves 100% 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 100% 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-10 and ISBN-13 formats, and tidying up ISBNs by inserting or removing dashes.
### Key Components
1.**Constants and Fields**:
-`DEBUGGING`: A flag to control debugging output.
-`BANDS`: Defines ranges for different formatting patterns.
-`VALID_GROUPS`: Lists valid group numbers.
-`groupValidLookup`: A `BitSet` to validate groups, initialized by `buildGroupValidLookup`.
2.**Public Methods**:
-**Appending Check Digits**:
-`appendCheckDigitToISBN12`: Adds a check digit to a 12-digit ISBN to form a valid ISBN-13.
-`appendCheckDigitToISBN9`: Adds a check digit to a 9-digit ISBN to form a valid ISBN-10.
-**Validation**:
-`ensureISBN10Valid`: Validates a 10-digit ISBN.
-`ensureISBN13Valid`: Validates a 13-digit ISBN.
-`isISBN10CheckDigitValid`: Checks if an ISBN-10's check digit is correct.
-`isISBN13CheckDigitValid`: Checks if an ISBN-13's check digit is correct.
-**Conversion**:
-`isbn10To13`: Converts an ISBN-10 to ISBN-13.
-`isbn13To10`: Converts an ISBN-13 to ISBN-10 if possible.
-**Tidying ISBNs**:
-`tidyISBN10or13InsertingDashes`: Cleans up and formats ISBNs by inserting appropriate dashes.
-`tidyISBN10or13RemovingDashes`: Cleans up ISBNs by removing extraneous characters and dashes.
3.**Private Methods**:
-`buildGroupValidLookup`: Initializes the `groupValidLookup``BitSet`.
-`calcISBN10CheckDigit`: Calculates the check digit for a 9-digit ISBN to form an ISBN-10.
-`calcISBN13CheckDigit`: Calculates the check digit for a 12-digit ISBN to form an ISBN-13.
-`ensureISBN10GroupValid`: Ensures the group part of an ISBN-10 is valid.
-`ensureISBN10PublisherValid`: Ensures the publisher part of an ISBN-10 is valid.
-`insertDashesInISBN10or13`: Inserts dashes in an ISBN based on formatting rules.
-`strip`: Removes extraneous characters from an ISBN, leaving only digits and the check digit.
4.**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-10 to ISBN-13 and vice versa.
The class provides robust tools to handle ISBN data, ensuring they are correctly formatted and valid for use.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

ISBN: 0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

=+ How about one you felt had acted in a hypocritical way?

Answered: 1 week ago