0% found this document useful (0 votes)
67 views6 pages

White Box Testing Basis Path Testing:: Module Selected

The document describes basis path testing of a module that selects an outlet based on a user's location and cuisine preferences. It contains 12 nodes that are analyzed to calculate the cyclomatic complexity and identify 5 basis paths. Loop testing found indefinite looping due to incorrect table end detection, and condition testing found syntax errors and issues with location input. Boundary value analysis led to changing the data structure from linked list to B-Tree to improve search performance.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views6 pages

White Box Testing Basis Path Testing:: Module Selected

The document describes basis path testing of a module that selects an outlet based on a user's location and cuisine preferences. It contains 12 nodes that are analyzed to calculate the cyclomatic complexity and identify 5 basis paths. Loop testing found indefinite looping due to incorrect table end detection, and condition testing found syntax errors and issues with location input. Boundary value analysis led to changing the data structure from linked list to B-Tree to improve search performance.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

WHITE BOX TESTING BASIS PATH TESTING:

Module selected:
Selection of the outlet according to the location preference and the cuisine preference of the user

Pseudocode :
select!outlet"# $egin: if"location%%N&''# then input location!preference fro( the user) else continue) end if) input cuisine!preference fro( the user) *hile rec in location!ta$le do *hile rec+ in cuisine!ta$le do if "rec id%%rec+ id# then if"rec+ cuisine%%cuisine!preference ,, rec location %% location!preference# then output - outlet!na(e selected. else output -no such outlets/. end if) end if) end) done) end)

Assumptions:
0ata$ase ta$les: + 'ocation!ta$le : contains the na(e of outlet1 location and id 2 3uisine!ta$le: contains the na(e of cuisine1 na(e of outlet1id id of the location!ta$le is the foreign 4e5 "id# of the cuisine!ta$le 'ocation 6aria$le is initiall5 set to N&'' If the location is set auto(aticall5 $5 the GPS1 then the 6alue is not N&'' But1 if it is still N&''1 then the location has to $e inputted fro( the user (anuall5

Steps and conditions Covered by the Nodes: Node 1:


$egin: if"location%%N&''#

Node 2:
then input location!preference fro( the user)

Node 3:
else continue) end if)

Node 4:
input cuisine!preference fro( the user)

Node 5:
rec in location!ta$le

Node :
rec+ in cuisine!ta$le

Node !:
rec id%%rec+ id

Node ":
rec location %% location!preference

Node # rec cuisine%%cuisine!preference Node 1$:


then output - outlet!na(e selected.

Node 11:
else output -no such outlets/. end if)

Node 12:
end)

%asis Set &lo' (raph:

Calculation o) the Cyclical Comple*ity: 7"G#% E8N92 7"G#% No of :egions E% No of Edges %+; N% No of Node

%++ 7"G#% E8N92 % +;8++92 %< Hence the nu($er of $asis paths: < Paths: Path 1: +828=8++ Path 2: +8>8=8++ Path 3: +8>8=8;8<8?8@8A8+B8<8;8+2 Path 4: +8>8=8;8<8?8@8A8++8<8;8+2 Path 5: +828=8;8<8?8@8A8+B8<8;8+2 Path : +828=8;8<8?8@8A8++8<8;8+2 +est Cases: +est ,1 0Path 11 -escription .*pected /utput Ta$le Goes to the end of location!ta$le is the progra( not populated and *ithout selecting location is null an5 outlet But ta4es location fro( user as input Ta$le Goes to the end of location!ta$le is the progra( not populated and *ithout selecting location is not null an5 outlet An outlet is It prints the na(e (atched according of the outlet to the specification of the user *hen the location is entered $5 the user No outlet is It prints that no (atched to the such outlet specifications of a6aila$le Actual /utput Goes to the end of the progra( *ithout selecting an5 outlet But ta4es location fro( user as input Goes to the end of the progra( *ithout selecting an5 outlet It prints the na(e of the outlet

2 0path 21

3 0Path 51

4 0Path 1

It prints that no such outlet a6aila$le

5 0Path 31

0Path 41

the user *hen the location is entered $5 the user An outlet is (atched according to the specification of the user *hen the location is o$tained $5 the GPS No outlet is (atched to the specifications of the user *hen the location is o$tained $5 the GPS

It prints the na(e It prints the na(e of the outlet of the outlet

It prints that no It prints that no such outlet such outlet a6aila$le a6aila$le

'OOP TESTING:
Error 0etected: 'ooping occurred indefinitel5 due to incorrect detection of end of ta$le $5 the -red. 6aria$le Error :ectification: 3ondition inserted - loop until rec in Cta$le!na(eD.

3ON0ITION TESTING:
+ Error detected: S5ntaE error: un(atched parenthesis Error rectification: 3hec4ing the code to (atch the parenthesis 2 Error detected: 'ocation o$tained fro( the G&I e6en *hen location%N&'' Error rectified: 'ocation inputs fro( the user if location%N&'' till a specified a(ount of ti(e

B'A3F BOX TESTING


+est ,+ -escription Interface Error: GPS testing .*pected /utput Actual /utput GPS finds the GPS fails current location of the user and updates the location 6aria$le

Interface Error: Input is the Gun4 :ead input of preferred location stored location and and cuisine of the cuisine fro( the user user

6alue

is

Boundar5 6alue anal5sis:


In the $eginning of the proHect *e had thought of lin4ed!list as our (ain data structure Ho*e6er on doing $oundar5 6alue anal5sis at high 6alues for lin4ed list *e found that the search through the list *as $eco(ing tedious and slo* Thus *e changed to B8Tree as B8Tree supports $inar5 search *hich speeds up the search 'ater *e s*itched to B98tree as it further si(plifies the *uer5ing for the data 6alues

You might also like