Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 12

E-Commerce Application Testing

Chapter 7

TESTING

Computer Department 64
E-Commerce Application Testing

Testing is the process carried out on software to detect the differences between its
behavior and the desired behavior as stipulated by the requirements specifications.

Testing is advantageous in several ways. Firstly, the defects found help in the
process of making the software reliable. Secondly, even if the defects found are not
corrected, testing gives an idea as to how reliable the software is. Thirdly, over time, the
record of defects found reveals the most common kinds of defects, which can be used for
developing appropriate preventive measures such as training, proper design and
reviewing.

7.1 TESTING PLAN

The testing sub-process includes the following activities in a phase dependent


manner:

 Create Test Plans.


 Create Test Specifications.
 Review Test Plans and Test Specifications.
 Conduct tests according to the Test Specifications, and log the defects.
 Fix defects, if any.
 When defects are fixed continue from activity.

7.2 TESTING STRATEGY

The development process repeats this testing sub-process a number of times for
the following phases.

 Unit Testing.
 Integration Testing
 System Testing.
 Acceptance Testing.

Unit Testing tests a unit of code (module or program) after coding of that unit is
completed. Integration Testing tests whether the various programs that make up a system,
interface with each other as desired, fit together and whether the interfaces between the
programs are correct. System Testing ensures that the system meets its stated design
specifications. Acceptance Testing is testing by the users to ascertain whether the system
developed is a correct implementation of the Software Requirements Specification.

Testing is carried out in such a hierarchical manner to ensure that each component
is correct and the assembly/combination of components is correct. Merely testing a

Computer Department 65
E-Commerce Application Testing

whole system at the end would most likely throw up errors in components that would be
very costly to trace and fix.

7.3 TESTING METHODS

7.3.1 Black Box and White Box Testing

In black box testing a software item is viewed as a black box, without knowledge
of its internal structure or behavior. Possible input conditions, based on the specifications
(and possible sequences of input conditions), are presented as test cases.

In white-box testing knowledge of internal structure and logic is exploited. Test


cases are presented such that possible paths of control flow through the software item are
traced. Hence more defects than black box testing are likely to be found.

The disadvantages are that exhaustive path testing is infeasible and the logic
might not conform to specification. Instrumentation techniques can be used to determine
the structural system coverage in white box testing. For this purpose tools or compilers
that can insert test probes into the programs can be used.

7.3.2 Code Coverage

The way to make sure that you have got all the control flow covered is to cover all
the paths in the program during the testing (via white-box testing). This implies that both
branches are exercised for and if’ statement, all branches are exercised for a case
statement, the loop is taken once or multiple times as well as ignored for a while
statement, and all components of complicated logical expressions are exercised. This is
called Path Testing. Branch Testing reports whether entire Boolean expression tested in
control structures evaluated to both true and false.

Additionally it includes coverage of switch statement cases, exception handlers


and interrupts handlers. Path testing includes branch testing as it considers all possible
combination of individual branch conditions. A simpler version is Statement Testing,
which determines if each statement in the program has been executed at least once. The
coverage via Path Testing includes the coverage via Statement Testing. Since Path Testing
is extremely comprehensive it is costly, hence a viable minimum should be measuring
Statement Testing coverage.

Computer Department 66
E-Commerce Application Testing

7.4 TESTING PRINCIPLES

 While deciding on the focus of testing activities, study project priorities. For example,
for an on-line system, pay more attention to response time. Spend more time on the
features used frequently.
 Decide on the effort required for testing based on the usage of the system. If the
system is to be used by a large number of users, evaluate the impact on users due to a
system failure before deciding on the effort.

 A necessary part of the test case is a definition of the expected result.

 Write test cases for invalid and unexpected as well as valid and expected input
conditions.

 Thoroughly inspect the results of each test.

We have performed both Unit Testing and System Testing on WIMS to detect and
fix errors. A brief description of both is given below.

Unit Testing

Objective

The objective of Unit Testing is to test a unit of code (program or set of programs) using
the Unit Test Specifications, after coding is completed. Since the testing will depend on
the completeness and correctness of test specifications, it is important to subject these to
quality and verification reviews.

Input

Unit Test Specifications

Code to be tested.

Testing Process

• Checking for availability of Code Walk-thru reports which have documented the
existence of and conformance to coding standards.

• Review of Unit Test Specifications

- Verify the Unit Test Specifications conform to the program specifications.

- Verify that all boundary and null data conditions are included.

Techniques

Computer Department 67
E-Commerce Application Testing

 Test Walk-through

This method of reviewing modules, a check for testability, is done by mentally


executing the code with example test cases. The advantage is that the programmer can
ensure that the path taken is always the one intended and that the values of variables are
always sensible. This is not a proven method and can be used only by persons with
knowledge of the particular language or application. It is recommended that a number of
test cases from the Unit Test Specifications be utilized for Test Walk-thru.

Two strategies are defined for testing modules by actual execution: the top down
approach and the bottom-up approach.

In the top-down approach, the main routine is tested first, with the subroutines
being substituted by dummy or null routines called stubs. As testing progresses, the stubs
are replaced by real routines that in turn may call further stubs representing lower-level
modules in the module hierarchy. In the figure below, main program A is tested with stubs
for B and C; then B is tested with stubs for D, E and F, and, C is tested with stub for G,
etc.

In the bottom-up approach, testing starts at the lowermost level and then proceeds
to higher-level programs or modules. The testing team directly calls the module to be
tested, which may call other pre-tested modules. In the figure above, D is tested with a
dummy driver for B. The same is done for E and F. Then B is tested with a dummy driver
for A.

The bottom-up approach does not allow you to have complete control over the test data.

 Integration Test

Computer Department 68
E-Commerce Application Testing

After completion of our module along with testing, modular coding strategy was
used. After integrating the module with the complete application, time was given to our
team to test their part of module completely and thoroughly.
As the whole application is divided into several modules, there were a lot of
variable names and function names, which were common to all the modules. There
existed a lot of session variables, which we had to incorporate into our module, but as
different modules were being developed simultaneously we had to hard code things in
place of the session variables in our module. So at the time of integration a lot of hard
coded things had to be removed and session variables were replaced.

7.5 Test Cases

7.5.1 Test Case for Admin Side

Project Name E-Commerce Application


Test Spec Id SYS001 Version No. 1.0
Test Item Admin Side of E-Commerce
Environment Windows XP Professional
Bhavik Chauhan
Prepared By & Jay Prepared Date 05/04/2007
Contractor
Bhavik Chauhan
Spec Reviewed By & Jay Review Date 15/04/2007
Contractor
Spec Review Passed Yes

Sr. Test Case Expected Result Actual Remarks


No Description Result
1. Correct User Name The Admin Home Page Same as
and Password should be displayed. expected.
2. Incorrect User The error message telling Same as
Name and Password incorrect username and expected.
password should be
displayed.
3. Fill the fields of The message-displaying Same as
Categories and then category added successfully expected.
click on the Submit should be displayed and the
button. fields should be cleared.
4. Fill the fields of The message-displaying Same as
Products and then product added successfully expected.
click on the Submit should be displayed and the
button. fields should be cleared
5. On Change The message telling Same as

Computer Department 69
E-Commerce Application Testing

Password form Incorrect current password expected.


enters Incorrect should be displayed.
current password
and new password
& confirm
password.
6. On Change The message-displaying Same as
Password form password changed expected.
enters Correct successfully should be
current password displayed.
and new password
& confirm
password.
7. On Feedback Page The page displaying the Same as
click on the subject whole message should be expected.
field of the feedback displayed.
message.
8. On Order Master All the orders placed by the Same as
Page select the selected user should be expected.
username from displayed.
drop-down list and
then click of Show
Orders button.
9. On Order Master The Order Details page Same as
Page Click on the displaying the detail of expected.
Order Id. particular order should be
displayed.
10. On Payment Master The Payment Mode for all Same as
Page select the the Order Placed should be expected.
username from displayed for selected user.
drop-down list and
then click of Show
Payment Mode
button.
11. On Update The Category Selected Same as
Categories Page should be deleted expected.
Click on Delete link successfully.
of Particular
Category.
12. On Update Two links Update and Same as
Categories Page Cancel appears. TextBoxes expected.
Click on Edit link of will replace the Labels.
Particular Category.
13. On Update The Editing of Category Same as
Categories Page will be Canceled. expected.
Click on Cancel link

Computer Department 70
E-Commerce Application Testing

of Particular
Category.
14. On Update The Category should be Same as First you
Categories Page updated. expected. need to
Click on Update change data
link of Particular in the fields
Category. of category.
15. On Update Products The Product as per the Same as
Page select the parameter given by expected.
Category from drop- administrator should be
down list and Enter displayed.
full product name
and then click on
Search button.
16. On Update Products The Product Selected Same as
Page Click on should be deleted expected.
Delete link of successfully.
Particular Product.
17. On Update Products Two links Update and Same as
Page Click on Edit Cancel appears. TextBoxes expected.
link of Particular will replace the Labels.
Product.
18. On Update Products The Editing of Product will Same as
Page Click on be Canceled. expected.
Cancel link of
Particular Product.
19. On Update Products The Product should be Same as First you
Page Click on updated. expected. need to
Update link of change data
Particular Product. in the fields
of Product.
20. On Featured The Product Ids of the Same as
Product Master selected Category should be expected.
Page select the displayed in drop-down list.
Category from drop-
down list.
21. On Featured The Product with its Image Same as First you
Product Master and Name should be expected. have to
Page select the displayed. apply case
Product Id from no 20
drop-down list.
22. On Featured The message-displaying Same as First you
Product Master Featured Updated expected. have to
Page select the Successfully should be apply case
position on which displayed and the images of no 20 & 21.
the Product’s Image selected product should be

Computer Department 71
E-Commerce Application Testing

to be displayed. displayed in Current


Products.
23. Click on the menu’s The Sign Out Page should Same as
Log Out Item. be displayed. expected.
24. On Sign Out Page The Login Page should be Same as
click on Return to displayed. expected.
Home Page Link.

7.5.2 Test Cases for User Side

Project Name E-Commerce Application


Test Spec Id SYS001 Version No. 1.0
Test Item User Side of E-Commerce
Environment Windows XP Professional
Bhavik Chauhan
Prepared By & Jay Prepared Date 05/04/2007
Contractor
Bhavik Chauhan
Spec Reviewed By & Jay Review Date 15/04/2007
Contractor
Spec Review Passed Yes

Sr. Test Case Expected Result Actual Remarks


No Description Result
1. On Home Page click The Page showing all the Same as
on Particular product of selected expected.
Category. Category should be
displayed.
2. On Home Page click The Page showing the full Same as
on Featured product description with expected.
Products particular image should be displayed.
Product.
3. On Home Page click The Page showing the full Same as
on Special Offers’ product description with expected.
particular Product. image should be displayed.
4. On Home Page click The Shopping Cart should Same as If the user is
on View Cart link. be displayed with contents expected. signed in
if you are Signed In else and there is
displays the warning no content
message. then
message will

Computer Department 72
E-Commerce Application Testing

be displayed.
5. On Home Page click The Sign In Page of user Same as
on Existing User side should be displayed. expected.
Sign In link.
6. On Sign In Page The Sign Up Page for Same as
click on Sign Up Registration should be expected.
Now! Link. displayed.
7. On Sign In Page The Forgot Password page Same as
click on Forgot should be displayed. expected.
Password Click
Here.
8. Enter Incorrect The message-displaying Same as
username and Incorrect Username and expected.
password. Password should be
displayed.
9. Enter Correct The My Account Page Same as
username and should be displayed. expected.
password.
10. On Sign Up Page The pop-up window should Same as
enter username and be displayed telling whether expected.
then click Check username is available or
Availability button. not?
11. On Forgot Password The question should be Same as
Page enter username displayed. expected.
and click Submit
button.
12. On Forgot Password The message displaying the Same as You have to
Page answer the password sent to your expected. apply case
question and click emails address should be no 11 first.
on Submit button. displayed.
13. On Change The message displaying the Same as
Password Page enter Incorrect current password expected.
Incorrect current should be displayed.
Password, new
password and
confirm password.
14. On Change The message displaying the Same as
Password Page enter Password changed expected.
Correct current successfully should be
Password, new displayed.
password and
confirm password.
15. On Favourite Search All the result of that Same as
Page select the selected saved search expected.
name of Search that should be displayed.
you have saved.

Computer Department 73
E-Commerce Application Testing

16. On Order History The Order Details Page Same as


Page click on Order should be displayed with expected.
Id. details of particular order.
17. On any page select The Search Result Page Same as
the Category and should be displayed with expected.
enter the name or Products matching the
keyword for the search parameters or with
particular product message displaying that
and then click on change search criteria to
GO button. find your required product.
18. On the Products The Page displaying the Same as
Page or Search whole product description expected.
Results Page click with its image should be
on the Product displayed.
Name.
19. On the Products The product should be Same as If user is not
Page or Search added to the shopping cart. expected. signed in
Results Page click then Sign In
on Add to Cart link. page will be
displayed.
20. On the Products The Order will be placed Same as If user is not
Page of Search directly and the Check Out expected. signed in
Results Page click Page should be displayed then Sign In
on Buy Now link. showing order no, order page will be
details and shipping displayed.
address.
21. On the Product The product should be Same as If user is not
Description Page added to the shopping cart. expected. signed in
click on the Add to then Sign In
Cart button. page will be
displayed.
22. On the Product The Order will be placed Same as If user is not
Description Page directly and the Check Out expected. signed in
click on the Buy Page should be displayed then Sign In
Now button. showing order no, order page will be
details and shipping displayed.
address.
23. On View Cart Page The user should be Same as
click on Continue Redirected to the previous expected.
Shopping button. page.
24. On View Cart Page The Order will be placed Same as
click on Check Out and the Check Out Page expected.
button. should be displayed
showing order no, order
details and shipping
address.

Computer Department 74
E-Commerce Application Testing

25. On Check Out Page The Payment Mode Page Same as


click on the should be displayed which expected.
Continue with shows different mode of
Payment Page. payment.
26. On Payment Mode The Cheque/DD Payment Same as
Page select the page should be displayed expected.
mode as which shows the instruction
Cheque/DD and for how to do payment with
then click Complete Cheque/DD.
Payment button.
27. On Payment Mode The Payment Information Same as
Page select the Page should be displayed expected.
mode as Visa or which asks for Information
Master Card or necessary for Master Card
American Express or Visa or American
and then click on Express and displays the
Complete Payment Card type.
button.
28. On Payment The Page displaying the Same as
Information Page Thank you to the customer expected.
enter payment for buying product should
information and be displayed.
then click on Submit
button.
29. From Check Out The View Cart Page should Same as
Page go back to the display message showing expected.
View Cart Page. that the shopping cart is
empty.
30. On any page click The Home page should be Same as
on Sign Out link. displayed and the session expected.
should be cleared.

Computer Department 75

You might also like