Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives: The main objective of this assignment is to assess the students ability to provide a complete Black-Box testing plan for a computer program. Description

Objectives: The main objective of this assignment is to assess the students ability to provide a complete Black-Box testing plan for a computer program.

Description: In this assignment, you will need to design a complete Black-Box testing plan for the following program.

Researchers are preparing a simulation of an ecosystem, consisted of foxes evolving in an environment. To initialize the system, a population of foxes with randomly generated attributes must be created. You have been tasked with outputting such a population sample, where foxes have unique ids, starting from 0 and incrementing by 1, x and y coordinates, age, health (1-10), and gender. Furthermore, the population must follow the constraints of the environment, which will have a grid size (x and y scalars) which will be determined by the user.

The environment will also have one of the following climate types: tropical, temperate, or tundra. The health of the foxes will depend on age and climate. All foxes younger than 3 must have health from 7 to 10. Alternatively, the climate becomes the principal factor.

For tundra climates, extreme conditions persist on the northern-most part of the grid (top 20% of y coordinates) resulting in health ratings ranging from 1 to 4. For foxes older than 3 that live on other parts of the grid, health ranges from 4 to 7.

For tropical climates, the same applies but for the southern-most part of the grid(lower 20% of y coordinates).

For temperate climates, there are no extremes, but the animals health tends to deteriorate after 5 years, resulting to health ratings ranging from 1 to 4. Otherwise, 4 to 7 is the standard range.

User must input the following:

Environment: tundra, temperate, or tropical

Grid size x:

Grid size: y

Population size:

Maximum animal age:

Age, gender (50/50 chance split), coordinates, health must be randomly generated without violating any conditions specified above.

Use this information, to create a Black-Box testing plan for the program.

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.

Main.cpp

#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(ceiling - floor + 1)); } Animal CreateAnimal(int max_age, int id, int gridx, int gridy, string climate) { Animal animal; animal.age = GetRandomBetween(1, max_age); animal.x = GetRandomBetween(0, gridx); animal.y = GetRandomBetween(0, gridy); animal.health = GetHealth(climate, animal.age, gridx, gridy, animal.x, 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>env.num_foxes; if(cin.fail()==true || env.num_foxes>max_age; if(cin.fail()==true || max_age>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>env.grid_size_x; if(env.grid_size_x>env.grid_size_y; if(env.grid_size_y=.8) //for tundra the extremes are in the far north so that's where lowest health will be return GetRandomBetween(1,4); else //rest is average health return GetRandomBetween(4, 7); } else if(climate == "temperate" || climate == "TEMPERATE") { //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  

image text in transcribedimage text in transcribed

Assignment 3 Solution Template Fill in the information for cach test that you develop for the 4 tables below. Add more rows as required to list all possible tests for each type. Do not repeat tests which have already been used to test a particular description. Use as many rows as needed to capture all of your tests. Each of the four tables may span more than one page if necessary Representative Input Tests Test # Test Description Test Data Expected Result Actual Result Pass/Fail 2:50 pm Give class time in a normal time range Wednesday 3:25 PM 35 minutes before 2:50 PM pass Functional Coverage Tests Test # Test Description Test Data Expected Result Actual Result Pass/Fail Test that DONE will end progranm DONE Program ends Program Ends Pass Boundary Values Tests Test # Test Description Test Data Expected Result Actual Result Pass Fail 41 minutes before 12:18 PMM Test largest time value Sunday 12:59 PM 12:18 pm Pass Special Values Tests Test # Test Description Test Data Expected Result Actual Result Pass/Fail Test non alphanumeric (*@#%&I 1.00 PM Program will request inputProgram recognized Pass characters for day of week incorrect input. Asked again again Assignment 3 Solution Template Fill in the information for cach test that you develop for the 4 tables below. Add more rows as required to list all possible tests for each type. Do not repeat tests which have already been used to test a particular description. Use as many rows as needed to capture all of your tests. Each of the four tables may span more than one page if necessary Representative Input Tests Test # Test Description Test Data Expected Result Actual Result Pass/Fail 2:50 pm Give class time in a normal time range Wednesday 3:25 PM 35 minutes before 2:50 PM pass Functional Coverage Tests Test # Test Description Test Data Expected Result Actual Result Pass/Fail Test that DONE will end progranm DONE Program ends Program Ends Pass Boundary Values Tests Test # Test Description Test Data Expected Result Actual Result Pass Fail 41 minutes before 12:18 PMM Test largest time value Sunday 12:59 PM 12:18 pm Pass Special Values Tests Test # Test Description Test Data Expected Result Actual Result Pass/Fail Test non alphanumeric (*@#%&I 1.00 PM Program will request inputProgram recognized Pass characters for day of week incorrect input. Asked again again

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions