Just filling in the chart for black box testing. Main.cpp #include <iostream> #i
ID: 3897512 • Letter: J
Question
Just filling in the chart for black box testing. Main.cpp #include <iostream> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string>using namespace std;
int main() { int numPasswords = 0; int randNum = 0; int originalLength = 0; int month = 0; int day = 0; char trash = ' '; char firstLetter = ' '; string inputInt = ""; string inputString = ""; string allInput = ""; string tmpInput = ""; string password = ""; string lastName = "";
cout << "Please enter your last name" << endl; cin >> lastName; cout << "Please enter the month and day i.e.(1/25)" << endl; cin >> month >> trash >> day;
firstLetter = lastName[0];
if((firstLetter > 64 && firstLetter < 78) || (firstLetter > 96 && firstLetter < 110)) { if(day > 14 && day < 21) cout << "Date Verified" << endl; else { cout << "Error: Names that begin with A-M register between the 15th and the 20th!" << endl; return 1; } } else if((firstLetter > 77 && firstLetter < 91) || (firstLetter > 108 && firstLetter < 123)) { if(day > 19 && day < 26) cout << "Date Verified" << endl; else { cout << "Error: Names that begin with N-Z register between the 20th and the 25th!" << endl; return 1; } } else { cout << "Invalid last name!" << endl; return 1; }
cout << "Please enter a multi-digit integer" << endl; cin >> inputInt; cout << "Please enter a string" << endl; cin >> inputString; cout << "How many passwords would you like to generate?" << endl; cin >> numPasswords; cout << " ";
allInput = inputInt + inputString; tmpInput = inputInt + inputString;
srand (time(NULL)); for(int i = 0; i < numPasswords; i++) { originalLength = tmpInput.length(); for (int j = 0; j < originalLength; j++) { randNum = rand() % tmpInput.length(); password += tmpInput[randNum]; tmpInput.erase (tmpInput.begin()+randNum); } cout << "Password " << i << ": " << password << endl; password = ""; tmpInput = allInput; }
return 0; }
AT&T; 2:44 PM 36% . Assignment3.pdf Assignment3.pdf Assignment #3 Prolem Solving and Progranmin in C++ Department of Computer Sclenc ld Dominion Eniversity Obiectivess The main objective o this assignment is to assess the student's abilny soprovide a complete Black-Box testing plan foe a computer program Description: In this assignment you will need to design a complete Black-Box testing plan for the following program At Old Dominion University, students and faculty are forcod to chang their passwords every semester. This process is noeded to ensure that all university proliles are secure. ODU would bke to modity this process to create a more secure environment Instead of changing passwords every semester, si dents will now change passwords …?? ortunaely, the school has realized that many students are bad at picking their passwonds Ideally, passwoeds altermate between letters, numbers, and symbels. However, most students and faculty pick passwords such as 1234Spasswond". To make matters wonse, when students and faculty are forced to change their password usally only a single character is added to the end of their previous password. Due to this peoblem, the University has created a program to help students and faculty crealle strong, new passwords. Although the program has beon crcated, it has not becn tested. You are tasked with created a complctc Black-Box testing plan for the peogram The password gencration program is somewhat simple. First, the user willl entertheir last name. In this peogram, students that have last names beginning with A-M will change their passwords between the 15 and the 20 of every month. Students that have last names beginning with N-Z will change their passwords between the 20 and the 25 of every month Next the user will ingut a multi-digit integer. Aflerwards, the user will input a string Lastly the ser will select how many passwords they would like to generate with this information The programhen uses this information to randomly gencrate passweeds using this data The program will not escoute if the current date is not cerect. Using this infoemation please create a Black-Box testing plan for the program Task: You must design a complete Black-Box testing plan for the given program Your esk ist
Explanation / Answer
Representative Input Tests
Test#
Test Description
Test Data
Expected Result
Actual Result
Pass/Fail
Give input in normal range
12345, hello, 5
5 randomly generated passwords of length 10
5 randomly generated passwords of length 10
pass
Enter a last name starting with A-M and day between 15-20
Chad, 5/17
Date Verified
Date Verified
pass
Enter a last name starting with N-Z and day between 20-25
Sam, 1/24
Date Verified
Date Verified
pass
Give last name starting with N-Z but day should not be between 20-25
Sam, 1/14
Error: Names that begin with N-Z register between the 20th and the 25th!
Error: Names that begin with N-Z register between the 20th and the 25th!
pass
Give last name starting with A-M but day should not be between 15-20
Brad, 3/45
Error: Names that begin with A-M register between the 15th and the 20th!
Error: Names that begin with A-M register between the 15th and the 20th!
pass
Functional Coverage Tests
Test#
Test Description
Test Data
Expected Result
Actual Result
Pass/Fail
Tests that generating 10 passwords works correctly
123, hi, 10
10 randomly generated passwords of length 5
10 randomly generated passwords of length 5
pass
Tests that entering a valid name and day in valid range works correctly
Sam, 1/24
Date is Verified and user is asked for further inputs to generate passwords.
Date is Verified and user is asked for further inputs to generate passwords.
pass
Tests that entering an invalid name and day combination stops the execution further.
Brad, 3/45
Error: Names that begin with A-M register between the 15th and the 20th!
Above message is displayed and program execution stops.
Error: Names that begin with A-M register between the 15th and the 20th!
Above message is displayed and program execution stops.
pass
Boundary Values Tests
Test#
Test Description
Test Data
Expected Result
Actual Result
Pass/Fail
Test a 1 digit integer
1, hello, 5
5 randomly generated passwords of length 6
5 randomly generated passwords of length 6
pass
Test a 1 character string
123, g, 10
10 randomly generated passwords of length 4
10 randomly generated passwords of length 4
pass
Give number of passwords to be generated as 0
123, hello, 0
Nothing should be generated
Nothing should be generated
pass
Give last name as an integer and day should be between 15-20
1, 1/14
Invalid last name!
Invalid last name!
pass
Give last name starting with A and day should be between 15-20
Ash, 1/17
Date Verified
Date Verified
pass
Give last name starting with A and day should be 14
Ash, 1/14
Error: Names that begin with A-M register between the 15th and the 20th!
Error: Names that begin with A-M register between the 15th and the 20th!
pass
Give last name starting with A and day should be 20
Ash, 1/20
Date Verified
Date Verified
pass
Give last name starting with A and day should be 21
Ash, 1/21
Error: Names that begin with A-M register between the 15th and the 20th!
Error: Names that begin with A-M register between the 15th and the 20th!
pass
Give last name starting with M and day should be between 15-20
Mamoa, 1/17
Date Verified
Date Verified
pass
Give last name starting with M and day should be 14
Mamoa, 1/14
Error: Names that begin with A-M register between the 15th and the 20th!
Error: Names that begin with A-M register between the 15th and the 20th!
pass
Give last name starting with M and day should be 20
Mamoa, 1/20
Date Verified
Date Verified
pass
Give last name starting with M and day should be 21
Mamoa, 1/21
Error: Names that begin with A-M register between the 15th and the 20th!
Error: Names that begin with A-M register between the 15th and the 20th!
pass
Give last name starting with N and day should be 19
Nandy, 1/19
Error: Names that begin with N-Z register between the 20th and the 25th!
Error: Names that begin with N-Z register between the 20th and the 25th!
pass
Give last name starting with N and day should be 20
Nandy, 1/20
Date Verified
Date Verified
pass
Give last name starting with N and day should be 25
Nandy, 1/25
Date Verified
Date Verified
pass
Give last name starting with N and day should be 26
Nandy, 1/26
Error: Names that begin with N-Z register between the 20th and the 25th!
Error: Names that begin with N-Z register between the 20th and the 25th!
pass
Give last name starting with Z and day should be 19
Zach, 1/19
Error: Names that begin with N-Z register between the 20th and the 25th!
Error: Names that begin with N-Z register between the 20th and the 25th!
pass
Give last name starting with Z and day should be 20
Zach, 1/20
Date Verified
Date Verified
pass
Give last name starting with Z and day should be 25
Nandy, 1/25
Date Verified
Date Verified
pass
Give last name starting with Z and day should be between 20-26
Zach, 1/26
Error: Names that begin with N-Z register between the 20th and the 25th!
Error: Names that begin with N-Z register between the 20th and the 25th!
pass
Special Values Tests
Test#
Test Description
Test Data
Expected Result
Actual Result
Pass/Fail
Test generation of 0 passwords
12345, hello, 0
Program will end without orienting anything
Program will end without orienting anything
pass
Testing for a last name not starting with character A-Z or a-z
@gd, 1/23
Invalid last name!
Invalid last name!
pass
Testing for a day value which is not an integer
Hisoka, 1/@3
Error: Names that begin with A-M register between the 15th and the 20th!
Error: Names that begin with A-M register between the 15th and the 20th!
pass
Testing for entering a string value as multi digit integer
S, hello, 2
2 randomly generated passwords of length 6
2 randomly generated passwords of length 6
pass
Testing for entering an integer value as a string
123, 99, 2
2 randomly generated passwords of length 5
2 randomly generated passwords of length 5
pass
Testing for entering a string value as number of passwords to be generated
123, hello, s
Program will end without orienting anything
Program will end without orienting anything
pass
Representative Input Tests
Test#
Test Description
Test Data
Expected Result
Actual Result
Pass/Fail
Give input in normal range
12345, hello, 5
5 randomly generated passwords of length 10
5 randomly generated passwords of length 10
pass
Enter a last name starting with A-M and day between 15-20
Chad, 5/17
Date Verified
Date Verified
pass
Enter a last name starting with N-Z and day between 20-25
Sam, 1/24
Date Verified
Date Verified
pass
Give last name starting with N-Z but day should not be between 20-25
Sam, 1/14
Error: Names that begin with N-Z register between the 20th and the 25th!
Error: Names that begin with N-Z register between the 20th and the 25th!
pass
Give last name starting with A-M but day should not be between 15-20
Brad, 3/45
Error: Names that begin with A-M register between the 15th and the 20th!
Error: Names that begin with A-M register between the 15th and the 20th!
pass
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.