Question: Task: You must design a complete Black-Box testing plan for the given program. Your task is to apply what you have learned about black-box testing
Task: You must design a complete Black-Box testing plan for the given program. Your task is to apply what you have learned about black-box testing techniques to develop a full suite of test data for this program. Use the template file provided in the Instructions and supporting files on BlackBoard to organize your tests and test data.
Submission notes: Submit a single file (text, MS word, or pdf). Name your file Assg3_cslogin, where the cslogin is your login ID for the computers at the Department of Computer Science at ODU.
Your file must include the following four sections with test data for each:
1. Test data that covers representative inputs
2. Test data that provides functional coverage
3.Test data that provides for boundary-values testing
4. Test data that implements special-values testing
CODE:
#include
#include
#include
#include
#include
#include
using namespace std;
struct Animal
{
int x;
int y;
int age;
int health;
int id;
string gender;
};
struct Environment
{ string climate; int num_foxes; int grid_size_x; int grid_size_y; Animal *foxes; };
int GetRandomBetween(int floor, int ceiling); Animal CreateAnimal(int min_age, int max_age, int id, int gridx, int gridy, string climate); string GetGender(); void GeneratePopulations(Environment& env); Environment GenerateEnvironment(); int GetHealth(string climate, int age, int grid_x, int grid_y, int x, int y); void PrintAnimals(Animal *animals, int size);
int main() { srand (time(NULL)); Environment env = GenerateEnvironment(); GeneratePopulations(env); return 0; }
int GetRandomBetween(int floor, int ceiling) { return floor + (rand() % static_cast
animal.y); animal.id = id; animal.gender = GetGender(); return animal; } string GetGender() { int g = GetRandomBetween(0,10); if(g>5) return "f"; else return "m"; } void GeneratePopulations(Environment& env) { int max_age; pop_size: cout< cin>>env.climate; if(env.climate == " " || (env.climate !="temperate" && env.climate ! ="TEMPERATE" && env.climate !="Temperate" && env.climate !="Tundra" && env.climate !="tundra" && env.climate !="TUNDRA" && env.climate != "TROPICAL" && env.climate != "tropical" && env.climate !="Tropical" )){ cout<<"Please select from among specified options"< //extremes are non-existent but older generations are not resilient and will always have good health if(age>5) return GetRandomBetween(1,4); else GetRandomBetween(4,7); } else if(climate == "tropical" || climate == "TROPICAL") { if(y/grid_y <=.2) //extremes are in the south return GetRandomBetween(1,4); else //rest is average health return GetRandomBetween(4, 7); } } void PrintAnimals(Animal *animals, int size) { cout< }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
