Beruflich Dokumente
Kultur Dokumente
The name of the business is Green Finger Gardening Supplies. It is a small company. It has been in business for over ten years and currently employs two office workers. It is located on James Street opposite Lewis Pharmacy. As the name may suggest, they specify in the selling of gardening products herbicides, insecticide, fungicides and also spray cans. When the customer enters the store they ask for the good desired and if it is in stock it is sold to them. Customers can also ask to have their goods delivered for an extra charge of $5.00 or have goods reserved until they are ready to come for it for an extra charge of $3.00. Their sales are recorded after every working day in a note book. They subtract the sold and reserved goods from their current stock to know the remaining stock but doing this is very timely on a daily basis. When the stock reaches less than one hundred units and order is placed, but doing this manually has proven to be faulty as wrong stock figures have been recorded and sometimes stock is ordered too late and thus they run out of stock. The manual system was not only inefficient and unproductive but, it was time consuming, some information was lost and ever since the expansion data was difficult to record and keep track of as space was quickly depleting. The new computerized system promises to increase the reliability and accuracy of data. It has a registry which makes data input easier and faster.
Narrative
Create a structure called current_stock, with attributes: Item_name stored as a character array with size of 25 Item_cases stored as an integer array with size of 3 Item_units stored as and integer array with size of 4 With instances array with size of 10 called items. START_main 1. Assign the integer variable pass to the value 4649. 2. Call function welcome. 3. Ask the user for password. 4. Accept from the user the password prompted for in step 2. 5. If pass is not equal to 1010: a. Ask the user for password. b. Accept from the user the password. c. Repeat step 4. 6. Call function menu. 7. END. START_welcome 1. Display to the screen welcome message 2. END. START_menu 1. Ask the user for option. 2. Accept from the user the option and store it in the integer variable opt. 3. If opt is equal to 1 then call function current_stock_report, if not, but option is equal to edit_stock, if not, but option is not equal to 1 or 2 then display to the screen Invalid task and call function menu. 4. END. START_current_stock_report
1. Open file in Read mode and display to the screen the value of the variables item_name, cases and units from the instance items of the struct current_stock. 2. Call function menu2. 3. END. START_edit_stock 1. Initialize u to 0. 2. If u is less than 5 then: a. Ask user for option b. Accept from the user option and store it in the integer variable opt1. c. If opt1 is equal to 1 then call function fungicides, if not, but opt1 is equal to 2 then call function insecticides, if not, but opt1 is equal to 3 then call function herbicides, if not, but opt1 is equal to 4 then call function sprayers, if not then display to the screen The type of item you chose is not valid. d. Repeat Step 2, Increment by 1. 3. END. START_fungicides 1. Initialize I to 0 2. If I is less than 3 then: a. Open file fungicide stock in Read Mode and display to the screen the value of the variables item_name, cases and units from the instance items of the struct current_stock. b. Ask the user for the amount of sales. c. Accept from the user the amount of sales prompted for above and store it in the integer variable sales. d. If sales is more than the value of the variable units of the instance items then ask the user for amount of sales and accept from the user amount of sales, if not, the value of the variable newstock is equal to the subtraction of the value of the variable sales from the value of the variable units of the instance items. e. If newstock is less than or equal to 10 then display to the screen The new amount of the value of the variables newstock and item_name of the instance items ATTENTION! Stock is low., if not, display to the screen The new amount of the value of the variables newstock and item_name of the instance items. f. Assign the value of the variable units of the instance items to the variable newstock.
g. Close File h. Repeat Step 2. 3. Call function menu2. 4. END. START_insecticides 1. Initialize I to 0 2. If I is less than 3 then: a. Open file insecticide stock in Read Mode and display to the screen the value of the variables item_name, cases and units from the instance items of the struct current_stock. b. Ask the user for the amount of sales. c. Accept from the user the amount of sales prompted for above and store it in the integer variable sales. d. If sales is more than the value of the variable units of the instance items then ask the user for amount of sales and accept from the user amount of sales, if not, the value of the variable newstock is equal to the subtraction of the value of the variable sales from the value of the variable units of the instance items. e. If newstock is less than or equal to 10 then display to the screen The new amount of the value of the variables newstock and item_name of the instance items ATTENTION! Stock is low., if not, display to the screen The new amount of the value of the variables newstock and item_name of the instance items. f. Assign the value of the variable units of the instance items to the variable newstock. g. Close File h. Repeat Step 2. 3. Call function menu2. 4. END. START_herbicides 1. Initialize I to 0 2. If I is less than 3 then: a. Open file herb stock in Read Mode and display to the screen the value of the variables item_name, cases and units from the instance items of the struct current_stock.
b. Ask the user for the amount of sales. c. Accept from the user the amount of sales prompted for above and store it in the integer variable sales. d. If sales is more than the value of the variable units of the instance items then ask the user for amount of sales and accept from the user amount of sales, if not, the value of the variable newstock is equal to the subtraction of the value of the variable sales from the value of the variable units of the instance items. e. If newstock is less than or equal to 10 then display to the screen The new amount of the value of the variables newstock and item_name of the instance items ATTENTION! Stock is low., if not, display to the screen The new amount of the value of the variables newstock and item_name of the instance items. f. Assign the value of the variable units of the instance items to the variable newstock. g. Close File h. Repeat Step 2. 3. Call function menu2. 4. END. START_sprayers 1. Initialize I to 0 2. If I is less than 3 then: a. Open file sprayer stock in Read Mode and display to the screen the value of the variables item_name, cases and units from the instance items of the struct current_stock. b. Ask the user for the amount of sales. c. Accept from the user the amount of sales prompted for above and store it in the integer variable sales. d. If sales is more than the value of the variable units of the instance items then ask the user for amount of sales and accept from the user amount of sales, if not, the value of the variable newstock is equal to the subtraction of the value of the variable sales from the value of the variable units of the instance items. e. If newstock is less than or equal to 10 then display to the screen The new amount of the value of the variables newstock and item_name of the instance items ATTENTION! Stock is low., if not, display to the screen The new amount of the value of the variables newstock and item_name of the instance items. f. Assign the value of the variable units of the instance items to the variable newstock.
g. Close File h. Repeat Step 2. 3. Call function menu2. 4. END. START_menu2 1. Ask user to enter choice. 2. Accept from the user the choice. 3. If choice is equal to 1 then call function menu, if not, but choice is equal to 2 then call function edit_stock, if not, but choice is equal to 3 then call function finish, if not, display to the screen The option you chose is invalid., ask user to enter choice and accept from the user the choice. 4. END. START_finish 1. Display to the screen GREEN FINGER GARDEN SUPPLIES. 2. Display to the screen THANK YOU. 3. Display to the screen GOODBYE . 4. END.
START
Pass= 1010
Enter a Password
Yes END
No
Menu
START
Main
Screen
Menu
END
U=0
If u <5
Enter an option
Yes If opt =1
Fungicides
No
Insecticides If opt =2
If opt= 3
Herbicides
If opt =4
Sprayers
u= u +1
END
i=0
If i < 3
Read sales
if newstoc k 10
items[i].units = newstock
i = 1+1
END
i=0
If i < 3
Read sales
if newstoc k 10
items[i].units = newstock
i = 1+1
END
i=0
If i < 3
Read sales
if newstoc k 10
items[i].units = newstock
i = 1+1
END
START
i=0
If i < 3
Read sales
if newstoc k 10
items[i].units = newstock
i = 1+1
END
START
Display GOODBYE
END
Test Criteria
Test Subject
Description
Test Data
Predicted Results
Actual Results
Normal
Opt1
Option 1 will allow the user to view the current stock report.
Extreme
10
Incompatible
one
Normal
Opt2
Extreme
20
Incompatible
two
The file stock reports.txt is displayed to the screen. The task you selected is not valid. Is displayed to the screen. The task you selected is not valid. Is displayed to the screen. Please enter the number that corresponds to the type of stock you would like to edit: is displayed to the screen The task you selected is not valid. Is displayed to the screen. The task you selected is not valid. Is displayed to the screen.
The file stock reports.txt was displayed to the screen. The task you selected was not valid. Is displayed to the screen. The task you selected was not valid. Is displayed to the screen. Please enter the number that corresponds to the type of stock you would like to edit: is displayed to the screen The task you selected is not valid. Is displayed to the screen. The task you selected is not valid. Is displayed to the screen.
Normal
Extreme
11
Incompatible
eleven
Normal
Opt 2
Extreme
24
Incompatible
Twenty
Normal
Opt 3
Extreme
33
Incompatible
Thirty
Normal
Opt 4
Extreme
44
Incompatible
Forty
How many Ipazine were sold today? is displayed to the screen. The type of item you have selected to edit is not valid is displayed to the screen. The type of item you have selected to edit is not valid is displayed to the screen. How many KillaSpray 2L were sold today? is displayed to the screen. The type of item you have selected to edit is not valid is displayed to the screen. The type of item you have selected to edit is not valid is displayed to the screen.
How many Ipazine were sold today? is displayed to the screen. The type of item you have selected to edit is not valid is displayed to the screen. The type of item you have selected to edit is not valid is displayed to the screen. How many Killaspray 2L were sold today? is displayed to the screen. The type of item you have selected to edit is not valid is displayed to the screen. The type of item you have selected to edit is not valid is displayed to the screen.
Normal
Prosper Stock
48
Extreme
693
Error! Invalid amount entered. Please enter how many prosper were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many prosper were sold today is displayed to the screen.
Incompatible
sixty
Error! Invalid amount entered. Please enter how many prosper were sold today is displayed to the screen. The option you chose is invalid is displayed to the screen.
Normal
Parasol Stock
102
Extreme
4578
Incompatible
One Hundred
Error! Invalid amount entered. Please enter how many Parasol were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many Parasol were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many Parasol were sold today is displayed to the screen. The option you chose is invalid is displayed to the screen.
Normal
Curzate Stock
54
Extreme
1165
Incompatible
Fifty
Error! Invalid amount entered. Please enter how many Curzate were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many Curzate sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many Curzate were sold today is displayed to the screen. The option you chose is invalid is displayed to the screen.
Figure1.8 - User goes through the function fungicide using normal test data.
Normal
Assail Stock
10
Extreme
1000
Incompatible
thousand
Error! Invalid amount entered. Please enter how many Assail were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many Assail were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many Assail were sold today is displayed to the screen. The option you chose is invalid is displayed to the screen.
Normal
Ficam Stock
20
Extreme
2000
Incompatible
Two thousand
Error! Invalid amount entered. Please enter how many Ficam were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many Ficam were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many Ficam were sold today is displayed to the screen. The option you chose is invalid is displayed to the screen.
Normal
Matador Stock
30
Extreme
3000
Incompatible
Three thousand
Error! Invalid amount entered. Please enter how many Matador were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many Matador were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many Matador were sold today is displayed to the screen. The option you chose is invalid is displayed to the screen.
Figure 2.6 - User goes through the insecticide function using normal test data.
Normal
Ipazine Stock
10
Extreme
1000
Incompatible
thousand
Error! Invalid amount entered. Please enter how many Ipazine were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many Ipazine were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many Ipazine were sold today is displayed to the screen. The option you chose is invalid is displayed to the screen.
Normal
Sesone Stock
30
Extreme
3000
Incompatible
Three
Error! Invalid amount entered. Please enter how many Sesone were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many Sesone were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many Sesone were sold today is displayed to the screen.. The option you chose is invalid is displayed to the screen.
Normal
Tritac Stock
50
Extreme
3055
Incompatible
Three thousand
Error! Invalid amount entered. Please enter how many Tritac were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many Tritac were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many Tritac were sold today is displayed to the screen. The option you chose is invalid is displayed to the screen.
Figure 3.2 User goes through the herbicide function using normal test data.
Normal
KillaSpray2L Stock
45
Extreme
4500
Error! Invalid amount entered. Please enter how many KillaSpray2L were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many KillaSpray2L were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many KillaSpray2L were sold today is displayed to the screen.. The option you chose is invalid is displayed to the screen.
Incompatible
Four thousand
2 Normal
KillaSpray5L Stock
55
Extreme
5500
Incompatible
Five Hundred
Error! Invalid amount entered. Please enter how many KillaSpray 5L were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many KillaSpray 5L were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many KillaSpray5L were sold today is displayed to the screen..
3 Normal
KillaSpray8.5L Stock
36
Extreme
3066
Error! Invalid amount entered. Please enter how many KillaSpray8.5L were sold today is displayed to the screen. Error! Invalid amount entered. Please enter how many KillaSpray8.5L were sold today is displayed to the screen.
Error! Invalid amount entered. Please enter how many KillaSpray8.5L were sold today is displayed to the screen.. The option you chose is invalid is displayed to the screen.
Incompatible
Six
Figure 3.9 - User goes through the herbicide function using normal test data.
Normal
Option 1
Extreme
Incompatible
The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen
The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen
Normal
Option 2
Extreme
Incompatible
The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen
The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen
Normal
Option 3
Extreme
59
Incompatible
The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen
The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen The option you chose is invalid Select 1 for main menu, 2 to continue updating stock or 3 to end the program is displayed to the screen
Figure 4.6 User selects option 1 and returns to the main menu.
Table testing Function Pass Test Criteria Test Subject Description Test Data Predicted Results Actual Results
Normal
pass
Extreme
This function allows the user to enter the program when the correct password is entered
1010
The menu function is called to the screen. Password Incorrect PLEASE TRY AGAIN PASSWORD: is displayed to the screen Password Incorrect PLEASE TRY AGAIN PASSWORD: is displayed to the screen
The menu function is called to the screen. Password Incorrect PLEASE TRY AGAIN PASSWORD: is displayed to the screen Password Incorrect PLEASE TRY AGAIN PASSWORD: is displayed to the screen
5263
Incompatible
Two hundred