is Valid Phone Number(): ReturnsTrue if the provided phone number (represented as a string) is cor-rectly formatted, otherwiseFalse. To be considered correctly formatted, phone numbers must bewritten as###-###-####, where#is a digit between 0 and 9 .•validatePhoneBook(): A phone book is a list where each entry is a phone book record (represented asa dictionary; see below for more details). This function checks each phone book record in the phonebook for correctly formatted phone numbers.A phone book record is a dictionary which initially has two keys: the key"name"mapped to thecontact’s name (string) and the key"phone number"mapped to that contact’s phone number (alsoa string).validatePhoneBook()adds a new key"valid"to the record with the valueTrueif the phonenumber is formatted correctly, otherwiseFalse. 1. Write white-box and black-box tests for the function is ValidPhoneNumber(). You should do this with-out Python, either on paper, or in a simple document. Don’t worry about running your tests until youhave thought about which test cases you want. Make sure you haveat least3 black-box tests and 3white-box tests. More tests may be useful. 2.Implement a test driver using your test cases in a document name 9q2_testing. 3. Run your tests and copy/paste the console output to a document named a9q2_output.txt. Theconsole output you hand in should come from the program before you try to fix it! 4.try to deduce the problems with the isValidPhoneNumber() function from the output of your testing.Then fixx the error(s) in the function! 5. In the document a9q2_output.txt, describe the error(s) you found and how you fixed it (them). Youdo not need to write a lot; a sentence or two for each error is all we want. Write your explanation as if you are explaining the error to a colleague of yours who wrote the functions. 6. Repeat the above steps for the second functionvalidatePhoneBook(). The 9q2_testing is below.
•is Valid Phone Number(): ReturnsTrue if the provided phone number (represented as a string) is cor-rectly formatted, otherwiseFalse. To be considered correctly formatted, phone numbers must bewritten as###-###-####, where#is a digit between 0 and 9
.•validatePhoneBook(): A phone book is a list where each entry is a phone book record (represented asa dictionary; see below for more details). This function checks each phone book record in the phonebook for correctly formatted phone numbers.A phone book record is a dictionary which initially has two keys: the key"name"mapped to thecontact’s name (string) and the key"phone number"mapped to that contact’s phone number (alsoa string).validatePhoneBook()adds a new key"valid"to the record with the valueTrueif the phonenumber is formatted correctly, otherwiseFalse.
1. Write white-box and black-box tests for the function is ValidPhoneNumber(). You should do this with-out Python, either on paper, or in a simple document. Don’t worry about running your tests until youhave thought about which test cases you want. Make sure you haveat least3 black-box tests and 3white-box tests. More tests may be useful.
2.Implement a test driver using your test cases in a document name 9q2_testing.
3. Run your tests and copy/paste the console output to a document named a9q2_output.txt. Theconsole output you hand in should come from the
4.try to deduce the problems with the isValidPhoneNumber() function from the output of your testing.Then fixx the error(s) in the function!
5. In the document a9q2_output.txt, describe the error(s) you found and how you fixed it (them). Youdo not need to write a lot; a sentence or two for each error is all we want. Write your explanation as if you are explaining the error to a colleague of yours who wrote the functions.
6. Repeat the above steps for the second functionvalidatePhoneBook().
The 9q2_testing is below.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps