Sie sind auf Seite 1von 56

Problem Definition

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.

Flowchart Showing Welcome Function

START

Pass= 1010

Enter a Password

If passwo rd!= pass

Yes END

No

Menu

Flowchart showing Menu Function

START

Main

Screen

Menu

END

Flowchart Showing Menu2 Function


START

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

Display The type of item you chose is not valid.

u= u +1

END

Flowchart Showing Fungicides Function


START

i=0

If i < 3

Read fungicide stock

Read item_name[i], cases[i] and units[i] current_stock.

Display "How many items[i].item_name were sold today?

Read sales

newstock = items[i].units - sales;

if newstoc k 10

Display The new amount of item_name[i] is newstock ATTENTION Stock is low.

Display "The new amount of items[i].item_ name is newstock

items[i].units = newstock

i = 1+1

END

Flowchart Showing Insecticide Function


START

i=0

If i < 3

Read insecticide stock

Read item_name[i], cases[i] and units[i] current_stock.

Display "How many items[i].item_name were sold today?

Read sales

newstock = items[i].units - sales;

if newstoc k 10

Display The new amount of item_name[i] is newstock ATTENTION Stock is low.

Display "The new amount of items[i].item_ name is newstock

items[i].units = newstock

i = 1+1

END

Flowchart Showing Herbicide Function


START

i=0

If i < 3

Read Herbicide stock

Read item_name[i], cases[i] and units[i] current_stock.

Display "How many items[i].item_name were sold today?

Read sales

newstock = items[i].units - sales;

if newstoc k 10

Display The new amount of item_name[i] is newstock ATTENTION Stock is low.

Display "The new amount of items[i].item_ name is newstock

items[i].units = newstock

i = 1+1

END

Flowchart Showing Sprayers Function

START

i=0

If i < 3

Read Sprayer stock

Read item_name[i], cases[i] and units[i] current_stock.

Display "How many items[i].item_name were sold today?

Read sales

newstock = items[i].units - sales;

if newstoc k 10

Display The new amount of item_name[i] is newstock ATTENTION Stock is low.

Display "The new amount of items[i].item_ name is newstock

items[i].units = newstock

i = 1+1

END

Flowchart Showing Finishing Function

START

Display VINCYGARDENING CO.LTD

Display THANK YOU

Display GOODBYE

END

Test Plan and Test Results

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

Option 2 will allow the user to edit different types of stock.

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.

Table 1: Testing function (menu)

Figure 1.0 Option 1 is selected

Figure 1.1 Option 2 is selected

Figure 1.2 - Menu is reloaded after inputting an extreme or incompatible option.

Test plan for function edit_stock


1 Test Criteria Test Subject Opt 1 Description Test Data Predicted Results How many Prosper 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 Assail 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. Actual Results How many Prosper 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 Assail 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

Option 1 allows the user to edit the fungicide stock individually.

Extreme

11

Incompatible

eleven

Normal

Opt 2

Option 2 allows the user to edit the insecticide stock individually

Extreme

24

Incompatible

Twenty

Normal

Opt 3

Option 3 allows the user to edit the herbicide stock individually

Extreme

33

Incompatible

Thirty

Normal

Opt 4

Option 4 allows the user to edit the sprayer stock individually

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.

Table 1.1 : testing function (edit_stock)

Figure 1.3 Option 1 is chosen from edit stock

Figure 1.4 Option 2 is chosen from edit stock

Figure 1.5 Option 3 is chosen from edit stock

Figure 1.6 Option 4 is chosen from edit stock

Figure 1.7 Menu is reloaded after inputting an extreme or incompatible option

Test plan for function (fungicides)


1 Test Criteria Test Subject Description Test Data Predicted Results Actual Results

Normal

Prosper Stock

This allows the user to enter the amount of prosper sold

48

The new amount of Prosper is 312 is displayed to the screen.

The new amount of Prosper is 312 is displayed to the screen.

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

This allows the user to enter the amount of Parasol sold

102

The new amount of Parasol is 178 is displayed to the screen.

The new amount of Parasol is 178 is displayed to the screen.

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

This allows the user to enter the amount of Curzate sold

54

The new amount of Curzate is 321 is displayed to the screen.

The new amount of Curzate is 321 displayed to the screen.

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.

Table 1.2 testing function (Fungicides)

Figure1.8 - User goes through the function fungicide using normal test data.

Figure 1.9 - User enters extreme prosper sales amount.

Figure 2.0 - User enters incompatible prosper sales amount

Figure 2.1 - User enters extreme parasol sales amount.

Figure 2.2 - User enters incompatible parasol sales amount.

Figure 2.3 - User enters extreme curzate sales amount.

Figure 2.4 - User enters incompatible curzate sales amount.

Test plan for function insecticides


1 Test Criteria Test Subject Description Test Data Predicted Results Actual Results

Normal

Assail Stock

This allows the user to enter the amount of Assail sold.

10

The new amount of Assail is 740 is displayed to the screen.

The new amount of Assail is 740 is displayed to the screen.

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

This allows the user to enter the amount of Ficam sold .

20

The new amount of Ficam is 772 is displayed to the screen.

The new amount of Ficam is 772 is displayed to the screen.

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

This allows the user to enter the amount of Matador sold.

30

The new amount of Matador is 250 is displayed to the screen.

The new amount of Matador is 250 is displayed to the screen

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.

Table 1.3 testing function (Insecticides)

Figure 2.6 - User goes through the insecticide function using normal test data.

Figure 2.7 - User enters extreme Assail sales amount.

Figure 2.8 User enters incompatible Assail sales amount.

Figure 2.8 User enters extreme Ficam sales amount.

Figure 2.9 User enters incompatible Ficam sales amount.

Figure 3.0- User enters extreme Matador sales amount.

Figure 3.1 User enters incompatible Matador sales amount.

Test plan for function (herbicides)


1 Test Criteria Test Subject Description Test Data Predicted Results Actual Results

Normal

Ipazine Stock

This allows the user to enter the amount of Ipazine sold.

10

The new amount of Ipazine is 230 is displayed to the screen.

The new amount of Ipazine is 230 is displayed to the screen.

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

This allows the user to enter the amount of Sesone sold.

30

The new amount of Sesone is 366 is displayed to the screen.

The new amount of Sesone is 366 is displayed to the screen

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

This allows the user to enter the amount of Tritac sold.

50

The new amount of Tritac is 340 is displayed to the screen.

The new amount of Tritac is 340 is displayed to the screen

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.

Table 1.4 testing function (Herbicides)

Figure 3.2 User goes through the herbicide function using normal test data.

Figure 3.3 User enters extreme Ipazine sales amount.

Figure 3.4 User enters incompatible Ipazine sales amount.

Figure 3.5 User enters extreme Sesone sales amount.

Figure 3.6 User enters incompatible Sesone sales amount.

Figure 3.7 User enters extreme Tritac sales amount.

Figure 3.8 User enter incompatible Tritac sales amount.

Test plan for function (sprayers)


1 Test Criteria Test Subject Description Test Data Predicted Results Actual Results

Normal

KillaSpray2L Stock

This allows the user to enter the amount of KillaSpray2L sold.

45

The new amount of KillaSpray2L is 115 is displayed to the screen.

The new amount of KillaSpray2L is 115 is displayed to the screen

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

This allows the user to enter the amount of KillaSpray5L sold.

55

The new amount of KillaSpray 5L is 11 is displayed to the screen.

The new amount of KillaSpray5L is 11 is displayed to the screen

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..

The option you chose is invalid is displayed to the screen.

3 Normal

KillaSpray8.5L Stock

This allows the user to enter the amount of KillaSpray8.5L sold.

36

The new amount of KillaSpray8.5L is 54 is displayed to the screen.

The new amount of KillaSpray8.5L is 54 is displayed to the screen

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

Table 1.5 testing function (Sprayers)

Figure 3.9 - User goes through the herbicide function using normal test data.

Figure 4.0 User enters extreme KillaSpray2L sales amount.

Figure 4.1 User enters incompatible Killaspray2L sales amount.

Figure 4.2 User enter extreme KillaSpray5L sales amount.

Figure 4.3 User enters incompatible KillaSpray5L sales amount.

Figure 4.4 User enter extreme KillaSpray8.5L sales amount.

Figure 4.5 User enters incompatible KillaSpray8.5L sales amount.

Table testing Function Menu 2


1 Test Criteria Test Subject Description Test Data Predicted Results Actual Results

Normal

Option 1

Option 1 allows the user to view the main menu

The menu function is displayed to the screen

The menu function is displayed to the screen

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

Option 2 allows the user to continue updating stock

The function edit_stock is called

The function edit_stock is called

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

Option 3 allows the user to end the program

The function finish is called

The function finish is called

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.

Figure 4.7 - User selects option 2 and returns to edit_stock.

Figure 4.8 - User selects option 3 and ends the program.

Figure 4.9 - User enters extreme or incompatible option.

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

Table 1.7 testing function (pass)

Figure 5.0 User enters the correct password

Figure 5.1 User enters an extreme or incompatible password.

Figure 5.2- Print screen fungicide stock.txt

Figure 5.3 - Print screen herbicide stock.txt

Figure 5.4- Print screen insecticide stock.txt

Figure 5.5- Print screen sprayer stock.txt

Figure 5.6 Print screen stock reports.txt

Das könnte Ihnen auch gefallen