Test Plan

SQL Query Testing Step One:
Test INSERT by inserting values into the tables using the following INSERT statements:

insert into BUSINESS
values (null,null,'Top of the Hill','101 Franklin Street','Chapel Hill','NC',
'27514','9199141234','toh.com','23','3');

insert into BUSINESS
values (null,null,'Cosmic Cantina','300-b Franklin','Chapel Hill','NC',
'27514','9199141334',null,'25','3');

insert into BUSINESS
values (null,null,'Cosmic Cantina','21 Roscoe Blvd','Durham','NC',
'27000','9199140004',null,'25','3');

insert into BUSINESS
values (null,null,'NY Pizza','Franklin St','Chapel Hill','NC',
'27514','9199981334',null,'23','3');

insert into BUSINESS
values (null,null,'Med Grill','Rosemary','Chapel Hill','NC',
'27514','9199000034',null,'21','3');

insert into BUSINESS
values (null,null,'Bruegger\'s','Estes Drive','Chapel Hill','NC',
'27514','9198141334',null,'18','3');

insert into COMMENT
values( '1',null,'3','This is average',null,null);

insert into COMMENT
values( '2',null,'4.5','This is wonderful. And this is only the
second one. I am bored.','genie','gdawg@');

insert into COMMENT
values( '3',null,'1.5','Puke.','gee-knee',null);

insert into COMMENT
values( '4',null,'2','Eh. I would recommend this place if
you usually eat at State!',null,null);

insert into COMMENT
values( '6',null,'2','There\'s no place like home *click click*',
'Dotty','oz@wizard.com');

insert into COMMENT
values( '7',null,'5','Best food since sliced bread!',null,null);

insert into COMMENT
values( '8',null,'4.5','YUUUUUUUUUUUUUM',null,null);

insert into COMMENT
values( '9',null,'4.5','Pretty Darn Good','Caps','dot.com');



STEP TWO:
Begin testing the rest of the queries. Strategic test values were chosen in order to verify the results efficiently.

Testing Advanced Search

Test with just one field as criteria. Expectation: Result set is not empty.

SELECT name,AVG(rating) AS avg_rating
FROM BUSINESS, CATEGORY, SUBCATEGORY, COMMENT
WHERE BUSINESS.business_id=COMMENT.business_id
AND CATEGORY.category_id=BUSINESS.category_id
AND SUBCATEGORY.subcategory_id=BUSINESS.subcategory_id
AND (category_name='Restaurants' OR 'Restaurants' IS NULL)
GROUP BY name
ORDER BY name;



Test with just one field as criteria. Expectation: Result set is empty, because request is not in database.

SELECT name,AVG(rating) AS avg_rating
FROM BUSINESS, CATEGORY, SUBCATEGORY, COMMENT
WHERE BUSINESS.business_id=COMMENT.business_id
AND CATEGORY.category_id=BUSINESS.category_id
AND SUBCATEGORY.subcategory_id=BUSINESS.subcategory_id
AND (category_name='Auto' OR 'Auto' IS NULL)
GROUP BY name
ORDER BY name;



Test with two fields as criteria; if two fields work, then more than two fields will work as well. Expectation: Result set is not empty.

SELECT name,street,category_name,AVG(rating) AS avg_rating
FROM BUSINESS, CATEGORY, SUBCATEGORY, COMMENT
WHERE BUSINESS.business_id=COMMENT.business_id
AND CATEGORY.category_id=BUSINESS.category_id
AND SUBCATEGORY.subcategory_id=BUSINESS.subcategory_id
AND (category_name='Restaurants' OR 'Restaurants' IS NULL)
AND (street LIKE '%Franklin%' OR 'Franklin' IS NULL)
GROUP BY name
ORDER BY name;



Test with two fields as criteria. Expectation: Result set is empty, because request is not in database.

SELECT name,street,category_name
FROM BUSINESS, CATEGORY, SUBCATEGORY, COMMENT
WHERE BUSINESS.business_id=COMMENT.business_id
AND CATEGORY.category_id=BUSINESS.category_id
AND SUBCATEGORY.subcategory_id=BUSINESS.subcategory_id
AND (category_name='Auto' OR 'Auto' IS NULL)
AND (street LIKE '%Ford%' OR 'Ford' IS NULL)
GROUP BY name
ORDER BY name;



Test with two fields as criteria. Expectation: Result set is empty, because one of the search values is not in database.

SELECT name,street,category_name
FROM BUSINESS, CATEGORY, SUBCATEGORY, COMMENT
WHERE BUSINESS.business_id=COMMENT.business_id
AND CATEGORY.category_id=BUSINESS.category_id
AND SUBCATEGORY.subcategory_id=BUSINESS.subcategory_id
AND (category_name='Auto' OR 'Auto' IS NULL)
AND (street LIKE '%Franklin%' OR 'Franklin' IS NULL)
GROUP BY name
ORDER BY name;




Testing Keyword Search

Test with one field as criteria. Expectation: Result set is not empty.

SELECT name,street,AVG(rating) AS avg_rating
FROM BUSINESS,CATEGORY,SUBCATEGORY,COMMENT
WHERE BUSINESS.business_id=COMMENT.business_id
AND CATEGORY.category_id=BUSINESS.category_id
AND SUBCATEGORY.subcategory_id=BUSINESS.subcategory_id
AND category_name LIKE '%Restaurants%'
GROUP BY name
ORDER BY name;



Test with one field as criteria. Expectation: Result set is empty, because search value is not in database.

SELECT name,street,AVG(rating) AS avg_rating
FROM BUSINESS,CATEGORY,SUBCATEGORY,COMMENT
WHERE BUSINESS.business_id=COMMENT.business_id
AND CATEGORY.category_id=BUSINESS.category_id
AND SUBCATEGORY.subcategory_id=BUSINESS.subcategory_id
AND category_name LIKE '%Auto%'
GROUP BY name
ORDER BY name;




Testing Retrieving a Business

Test with any 'business_id' which is in the database.

SELECT name
FROM BUSINESS,CATEGORY,SUBCATEGORY,COMMENT
WHERE BUSINESS.business_id=COMMENT.business_id
AND CATEGORY.category_id=BUSINESS.category_id
AND SUBCATEGORY.subcategory_id=BUSINESS.subcategory_id
AND BUSINESS.business_id='1'
GROUP BY name
ORDER BY rating;




Testing Retrieving a Subcategory Page

Test with any 'category_name' which is in the database.

SELECT business_id,category_name,subcategory_name
FROM CATEGORY,SUBCATEGORY,BUSINESS
WHERE BUSINESS.subcategory_id=SUBCATEGORY.subcategory_id
AND CATEGORY.category_id=SUBCATEGORY.category_id
AND BUSINESS.category_id=CATEGORY.category_id
AND category_name='Restaurants'
ORDER BY category_name, subcategory_name;




Testing Retrieving a Subcategory Selection Box

Test with any 'category_name' which is in the database.

SELECT subcategory_name
FROM CATEGORY,SUBCATEGORY
WHERE CATEGORY.category_id=SUBCATEGORY.category_id
AND category_name='Restaurants'
ORDER BY category_name, subcategory_name;




Testing Deleting a Business

Generate table of all businesses in database (not shown here), choose appropriate 'business_id' to delete, and perform deletion.

SELECT business_id,name,street
FROM BUSINESS
ORDER BY name;

DELETE FROM BUSINESS
WHERE business_id='1';




Testing Deleting a Comment

Insert an extra comment into the database, generate table of all businesses in database (not shown here), choose appropriate 'business_id' and 'date_time_stamp' to delete, and perform deletion.

insert into COMMENT
values( '2',null,'3','This is very average',null,null);

SELECT BUSINESS.business_id,COMMENT.date_time_stamp
FROM BUSINESS,COMMENT
WHERE BUSINESS.business_ID=COMMENT.business_id
ORDER BY name;

DELETE FROM COMMENT
WHERE business_id='2' AND date_time_stamp='20000409154015';



Back to top


Java Servlet/GUI Testing
Home Page

  • Click on all the links at the top and bottom of the page. Make sure they link to the appropriate pages.
  • Check that "Help" links to the User Manual.
  • Test Search:
    Search for business name, business type/category, subcategory, address,city, zip code.
    Use wild card characters ( * and ?). Make sure they return appropriate results.

  • Click on all the category and subcategorylinks.



    Add a New Business

  • Click on all the links at the top and bottom of the page. Make sure they link to the appropriate pages.
  • Make sure the "Help" links to the "Add a New Business" section in the user manual.
  • Hit "Submit" button without filling in any fields. Make sure appropriate error message comes up.
  • Fill in each field one at a time and hit "Submit" to check for appropriate error message.
  • Use wild card characters  *,  ?  and  \  to make sure that they are not accepted as valid inputs.
  • Fill in all fields with valid inputs and make sure all inputs are displayed on the business home page.
  • Test Zip Code with invalid characters (letters and special characters).
  • Use different phone number formats ( 1-area code-111-1111, 919-111-1111, 111-1111, 1234567, 19191234567,1(919)1112233). Test to make sure that letters are not accepted. Make sure for all types of input formats, the format on the business home page appears as (area code)-111-2233.



    Add a New Recommendation

  • Click on all the links at the top and bottom of the page. Make sure they link to the appropriate pages.
  • Make sure the "Help" links to the User Manual.
  • Click on Business type and Subcategory links and verify correctness ( > Business Type > Subcategory > Business Name).
  • Click on "Add a New Comment/Recommendation" link and make sure the "Add a New Comment" section is brought up on the screen.
  • Check for error messages when submitting empty mandatory fields.
  • Click on the business web page.
  • Click on the comment provider's name to test that a window for e-mail comes up.



    Advanced Search

  • Click on all the links at the top and bottom of the page. Make sure they link to the appropriate pages.
  • Make sure the "Help" links to the "Advanced Seaching" section in the user manual.
  • Hit Submit without filling in any fields. It should return all entries.
  • Fill in fields one at a time. Check validity of output.
  • Test for wild card and special characters.



    Search Results Page

  • Click on all the links at the top and bottom of the page. Make sure they link to the appropriate pages.
  • Make sure the "Help" links to the User Manual.
  • Test Search:
    Search for business name, business type/category, subcategory, address, city, zipcode.
    Use wild card characters ( * and ? ). Make sure they return appropriate results.
  • Click on business names to check that they link to the appropriate web pages.



    Deleting

  • Login
  • Click on all the links at the top and bottom of the page. Make sure they link to the appropriate pages.
  • Click Delete Comment button and click Delete Business button. Verify that alert messages appear.
  • Research for deleted business and verify that result is empty.
  • Back to top



    < Back * Contents * Next >