Professional Documents
Culture Documents
th
April 2013
Submitted By:
Submitted By:
Niro Thakur
PT0981149
Module Lecturer
APIIT SD INDIA
Page 1
ACKNOWLEDGMENT
It was a great experience working on the Computing and Concurrent Systems Design module
assignment Automated Online Shopping Mall System. It is a pleasure to be able to thank all
those people who helped me in making this project successfully. First of all, I want to thank my
module lecturer Ms. Kirti Arora who guided me very well throughout the development. She has
given me the required guidance as and when I have approached her.
I am also thankful to the library staff for providing me necessary books related to my project. I
would like to thank APIIT SD INDIA, Panipat for giving me the opportunity to work in a
friendly environment and also supporting me directly or indirectly.
Lastly, I would like to thank all those whose names may not have appeared here but whose
contribution has not gone unnoticed. I would like to thank all of them, for their help in various
ways.
Niro Thakur
PT0981149
APIIT SD INDIA
Page 2
TABLE OF CONTENTS
Contents
Acknowledgment........................................................................................................ 2
Table of Contents........................................................................................................ 3
Introduction.................................................................................................................... 4
Assumption.................................................................................................................... 6
1.1.
SYSTEM MODELING........................................................................................ 6
1.2.
SYSTEM REQUIREMENTS................................................................................7
1.3.
1.4.
Structure Diagram................................................................................................... 13
4.0
5.0
APIIT SD INDIA
Page 3
CRITICAL APPRAISAL...................................................................................... 50
CONCLUSIONS................................................................................................. 50
14 References............................................................................................................... 51
APIIT SD INDIA
Page 4
INTRODUCTION
With advancement in the computing era, the expectations of users from an Information System
increases substantially .Automated Online Shopping Mall systems based on client/server
architecture it means the systems allow for multiple clients to interact with a server at once, and
hence require the server to be safe when operating concurrently.
The Automated Online Shopping Mall System will service multiple customers at a time. The
system provides following services to the customer Sign Up: - A customer must register with system before accessing the functionality. After
registration the customer get user id and password with the help of user id and password
the customer login with the system and used functionality.
Searching the products based on their brand: - The customer can search the product
availability based on brand by selecting the brand a pop up window will open which
contains all information about the product like product name, product quantity, product
id, date of uploading the product and product price.
Check the availability of the products:- The customer can also search the product
quantity of specific product by entering the product name .If the product are not
available a simple message will display Product unavailable and if the product are
available then the product quantity will be display.
Discounts details: - In automated online shopping mall system the customer get discount
based on the purchase amount. If the purchase amount is greater than Rs.5000/- then
customer get 5% discount otherwise no discount.
Placing an order: - A customer can purchase the available product. The system should
get the customer details such as name, age, address, phone, mode of payment, product
name he/she wants to buy and the quantity of the product.
Cancelling an order: - Customer can cancel the order of product by pressing the cancel
button. After pressing the cancel button the product are deleted from the customer order
and the quantity are updated in the product detail.
Bill-Generation: - The customer can get the bill details after successfully paying the
product amount.
Check Status: - A customer can check the status of product after successfully paying the
product amount.
Pay-Bill: - A customer can make a payment by entering a 16-digits code from his/her
account. If the pay bill is successfully received then the product quantity of the products
are updated.
APIIT SD INDIA
Page 5
ASSUMPTION
1.1.
The proposed system is not using internet connection while purchasing or searching the
product.
16-digit verification code are assumed corresponding to the specific customer. Because in
this system purchasing the products only after when customer enters verification code.
Assumed that the system provide computer product.
Price and Discount are assumed for these products according the purchase amount. In the
Automated Online shopping Mall System the discount is only be credited when the
customer purchase more then 5000/-.
SYSTEM MODELING
The Online Shopping Mall System should be implemented in Java by strictly stay to the
modeling approach and converted into an executable Java application. The following diagram
shows how the entire system was designed and developed.
The very first stage of system modeling is gathering and analyzing the requirements.
After that, the requirements were translated into a structure diagram, FSP and LTS. Eventually,
the system was built in Java with greater use of Java concurrency features.
APIIT SD INDIA
Page 6
1.2.
S
Y
S
T
E
M
REQUIREMENTS
The requirement of the assignment is to develop Automated Online Shopping Mall System, A
main interface to carry all the options available to customer containing features like: Sign Up: - A customer must register with system before accessing the functionality. After
registration the customer get user id and password with the help of user id and password
the customer login with the system and used functionality.
Searching the products based on their brand: - The customer can search the product
availability based on brand by selecting the brand a pop up window will open which
contains all information about the product like product name, product quantity, product
id, date of uploading the product and product price.
Check the availability of the products:- The customer can also search the product
quantity of specific product by entering the product name .If the product are not
available a simple message will display Product unavailable and if the product are
available then the product quantity will be display.
Discounts details: - In automated online shopping mall system the customer get discount
based on the purchase amount. If the purchase amount is greater than Rs.5000/- then
customer get 5% discount otherwise no discount.
Placing an order: - A customer can purchase the available product. The system should
get the customer details such as name, age, address, phone, mode of payment, product
name he/she wants to buy and the quantity of the product.
APIIT SD INDIA
Page 7
APIIT SD INDIA
Page 8
1.4.
Serial
1.
2.
3.
4.
5.
6.
7.
8.
9.
Page 9
1.7
SYSTEM MODELING
After analyzing all basic requirements, basic functionality and special requirement of the system
modeling is started. System modeling will help us to recognize how to improving and
understanding of a situation, how to identifying problems or how to formulating opportunities
and supporting decision making.
Different models present the system from different perspectives. For modeling the system we
have to go further steps first of all we identifying following things
Main events, actions and interactions.
Identify main processes.
Identify main properties.
Define and structure each process
Then after we go for creating Model outline design, Model system in FSP then accordingly
generates LTSA. Implements safety and Liveliness property and then we evaluate and test the
traces.
1.8 MODELING
S.no
1.
2.
3.
4.
5.
6.
7.
Modeling:
Create model outline design.
Model the system in FSP.
Generate LTS.
Implement Safety and Liveliness property.
Evaluate and test the traces.
Identify the main activities -> to be implemented as threads.
Identify the main shared entities ->to be implemented as monitors.
1.9 IMPLEMENTATION
S.no
1.
Implementation:
Create the Class Diagram.
APIIT SD INDIA
Page 10
1.9.1 ENTITIES
Entity
LOGIN
Description
After registration Customer get user id and password for login into the system
CUSTOMER
Customer who will use the System. It includes all the information of the
registered user.
When Customer orders the products the information about the ordered product
and whom these products are ordered are stored here. Order can be ordered or
cancelled.
Product is an entity containing all the products information with unique product
code.
For getting payment from customer after purchasing products includes Bank
information which is stored in this entity.
To generate bill report.
To generate user log maintenance. It is for rollback in case of any interruption
in the process
CUSTOMER
ORDER
PRODUCT
ACCOUNT
BILL
LOG
1.9.2 EVENTS
Events
Login
Description
When a random user wants to login for
accessing functionalities.
Product Search Customer searches details of the products based
on their brand
Check
Customer selects a particular product and
Availability
checks for availability of product
Payment
After giving order give payment.
Three tries for As making payment is confidential resource
payment
and the developer is not allowing customers to
make any no. of fake tries.
Give Order
customer can give order if products are
available
Cancelation
The customer can cancel the order.
View Status
To display the status of a purchased product.
Bill Generation View billing of all purchased or cancelled
order.
Discount Detail
Payment Code
APIIT SD INDIA
Entities Required
CUSTOMER
PRODUCT,CUSTOMER
PRODUCT,CUSTOMER
ORDER,PRODUCT,BANK
BANK
CUSTOMER,ORDER,
PRODUCT
ORDER, PRODUCT
ORDER
ORDER
1.9.3 INTERACTIONS
Number
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
Customer can check for status of Order Details with Customers Details for each
successful paid bill.
And at last the customer will logged out from AOSMS.
A log file of each transaction will be maintained for the Administrative use.
16
17
1.9.4 ACTIONS
Process
LOGIN
CUSTOMER
ORDER
PRODUCT
BANK
BILL
LOG
Action
userid, password,match, nomatch
userid,password,checkproduct,giveorder,checkdiscount,verificationcode,
givepayment
orderid, giveorder, verificationcode, givepayment
availableproduct, productdetail, checkbrand, discountdetail
Accountnumber, verificationcode
Displaybill,printbill
Displaylog
User cannot enter the main page without login to the system with incorrect password.
User can enter the verification code number only for 3 times only the can order the
product otherwise it will cancel.
Multiple users cannot allow purchasing the same products at the same time.
Page 12
1 STRUCTURE DIAGRAM
1. LOGIN
APIIT SD INDIA
Page 13
2. SEARCH_PRODUCT
3. PRODUCT_AVAILABILITY
APIIT SD INDIA
Page 14
5. MAKE_PAYMENT
APIIT SD INDIA
Page 15
6. CANCEL_ORDER
7. VIEW_STATUS
APIIT SD INDIA
Page 16
APIIT SD INDIA
Page 17
For understanding purpose comments are very helpful. If any third party user want to
understand what is happening in these codes then proper comments give them ideas.
Comments are given to the methods, any logic applied then their would be provides
comments. Following are the code where I have applied proper comments.
Page 18
Page 19
APIIT SD INDIA
Page 20
Page 21
Thread
Explanation
public class login extends JFrame implements The idea behind using threads in login is to
ActionListener,Runnable
allow multiple users to login into the system at
{
the same time.
void callThread()
This is the main class from where the project
{
starts and this class instantiate the login, so to
new Thread().start();
maintain multiple logins, the login is
}
instantiated with the help of Threads.
public void run()
{
setVisible(true);
}
APIIT SD INDIA
Page 22
Explanation
Method updateData() is called only when
the users ordering the same item at the
same time that is ordered by other.
Synchronized is used so that only one
customer can buy same item at a time and
after updating the record it is released for
other customer.
3. For handling the issue of deadlock this system provides locks in which multiple clients
can lock on multiple resources at one time. Eg. At one time more than one person
updating thing by providing proper locks on of the database.
APIIT SD INDIA
Page 23
6.1.5
LTSA
&
TRACES
APIIT SD INDIA
Page 24
11.1.6
Safety
Progress
Description
No deadlocks/errors
Progress Check...
-- States: 36 Transitions: 84 Memory used: 15274K
No progress violations detected.
Progress Check in: 0ms
APIIT SD INDIA
Page 25
6.2.6
Safety
6.2.7
Progress
Description
Composition:
DEFAULT = PRODUCT_AVAILABILITY
State Space:
5 = 2 ** 3
Analysing...
Depth 5 -- States: 5 Transitions: 4 Memory used: 17241K
Trace to DEADLOCK:
tau
enter_ProductName
check_Availability
tau
Analysed in: 0ms
Composition:
DEFAULT = PRODUCT_AVAILABILITY
State Space:
5 = 2 ** 3
Progress Check...
-- States: 5 Transitions: 4 Memory used: 18281K
Finding trace to cycle...
Depth 4 -- States: 4 Transitions: 4 Memory used: 18681K
Finding trace in cycle...
Progress violation for actions:
{check_Availability, enter_ProductName}
Trace to terminal set of states:
tau
enter_ProductName
check_Availability
tau
Cycle in terminal set:
Actions in terminal set:
{}
Progress Check in: 0ms
Page 26
brand of product
6.3.2
Assumption
6.3.3
FSP
6.3.4
JAVA Code
6.3.5
LTSA
&
TRACES
6.3.6
Safety
6.3.7
Progress
Description
Composition:
DEFAULT = SEARCH_PRODUCT
State Space:
6 = 2 ** 3
Analysing...
Depth 6 -- States: 6 Transitions: 5 Memory used: 17384K
Trace to DEADLOCK:
tau
request
tau
tau
release
Analysed in: 0ms
Composition:
DEFAULT = SEARCH_PRODUCT
State Space:
6 = 2 ** 3
Progress Check...
-- States: 6 Transitions: 5 Memory used: 18837K
APIIT SD INDIA
Page 27
Page 28
||
Customer::PRODUCTS||
6.3.4
JAVA Code
APIIT SD INDIA
Page 29
6.3.6
Safety
6.3.7
Progress
Description
Compiled: CUSTOMER
Compiled: ITEM
Compiled: LOCK
Composition:
ORDER = a:CUSTOMER || b:CUSTOMER || {a,b}::PRODUCTS.item.0:ITEM ||
{a,b}::PRODUCTS.item.1:ITEM || {a,b}::LOCK
State Space:
8 * 8 * 4 * 4 * 2 = 2 ** 11
Analysing...
Depth 9 -- States: 30 Transitions: 39 Memory used: 9446K
Trace to property violation in {a,b}::PRODUCTS.item.0:ITEM:
a.acquire
a.choose.0
a.item.0.check
a.item.0.giveOrder
a.release
a.acquire
a.choose.0
a.item.0.check
a.item.0.giveOrder
Analysed in: 0ms
Composition:
ORDER = a:CUSTOMER || b:CUSTOMER || {a,b}::PRODUCTS.item.0:ITEM ||
{a,b}::PRODUCTS.item.1:ITEM || {a,b}::LOCK
State Space:
8 * 8 * 4 * 4 * 2 = 2 ** 11
Progress Check...
Safety property violation detected - check safety.
Progress Check in: 0ms
Page 30
6.2.4
JAVA Code
APIIT SD INDIA
Page 31
6.5.6
Safety
Composition:
DEFAULT = PAYMENT
State Space:
9 = 2 ** 4
Analysing...
Depth 6 -- States: 9 Transitions: 10 Memory used: 14221K
No deadlocks/errors
Analysed in: 0ms
6.5.7Progress Composition:
Description
DEFAULT = PAYMENT
State Space:
9 = 2 ** 4
Progress Check...
-- States: 7 Transitions: 8 Memory used: 18444K
Finding trace to cycle...
Depth 3 -- States: 4 Transitions: 5 Memory used: 18844K
Finding trace in cycle...
Progress violation for actions:
APIIT SD INDIA
Page 32
items.release,
payment[1..2],
Page 33
6.6.6
Safety
6.6.7
Progress
Description
Composition:
DEFAULT = CANCELLING
State Space:
6 = 2 ** 3
Analysing...
Depth 4 -- States: 6 Transitions: 7 Memory used: 9485K
No deadlocks/errors
Analysed in: 0ms
Composition:
DEFAULT = CANCELLING
State Space:
6 = 2 ** 3
APIIT SD INDIA
Page 34
Page 35
6.7.6
Safety
Composition:
DEFAULT = VIEWORDERSTATUS
State Space:
7 = 2 ** 3
APIIT SD INDIA
Page 36
6.7.7
Progress
Description
Analysing...
Depth 4 -- States: 7 Transitions: 10 Memory used: 18772K
No deadlocks/errors
Analysed in: 0ms
Composition:
DEFAULT = VIEWORDERSTATUS
State Space:
7 = 2 ** 3
Progress Check...
-- States: 5 Transitions: 7 Memory used: 20022K
Finding trace to cycle...
Depth 3 -- States: 3 Transitions: 4 Memory used: 20422K
Finding trace in cycle...
Progress violation for actions:
{exit, orderid[1..2], {request_order_status, show_ORDER_status,
unavailable}}
Trace to terminal set of states:
request_order_status
orderid.1
show_ORDER_status
Cycle in terminal set:
homepage
Actions in terminal set:
homepage
Progress Check in: 0ms
7. CLASS DIAGRAM
APIIT SD INDIA
Page 37
APIIT SD INDIA
Page 38
JAVA CODE:
connection.open();
//this is for checking valid user name and
password
connection.rs=connection.stm.executeQuery("S
ELECT email,password,name from registration
where email='" + txt1.getText() + "'");
while(connection.rs.next())
8.2 Registration
Registration Module: - The customer must register before using the any functionality of
Automated Online Shopping Mall System.
Auto-generated ID
Auto-generated
Date
APIIT SD INDIA
Page 39
connection.open();
connection.stm.executeUpdate("Insert into cust_order values('" + txtcname.getText() +
"','"
+txtadd.getText()+
"','"
+txtphone.getText()+
"','"
+txtpri.getText()+
"','"
+jmode.getSelectedItem()+ "','" +txtcode.getText()+ "','" +pn + "','" +co + "','" +pp + "','" +tq +
"','" + c_pid+ "','" +txtdate.getText()+ "')");
connection.close();
APIIT SD INDIA
Page 40
Page 41
JAVA CODE
QUERY
//Selecting discount detatil from Product table
CreateConnection.open();
Statement stm=CreateConnection.con.createStatement();
String sql="select product_id,product_name,product_price,product_discount from product";
ResultSet rs3=stm.executeQuery(sql);
ResultSetMetaData rsmd = rs3.getMetaData();
APIIT SD INDIA
Page 42
APIIT SD INDIA
Page 43
APIIT SD INDIA
Page 44
Automated
Online Testing
Shopping Mall System
Date
Register
Description
Test
ID
8/5/2013
Case ID:02
No
Steps
Result
Expected
1.1
Not
Required
1.2
New
ID
will
be
displayed in
ID field
Not
Required
1.2
User should
New user Pass
be
added
APIIT SD INDIA
Page 45
Outputs
from
Module
Result
Corrective
(Pass/Fail) Actions
New
ID Pass
successfully
displayed in
ID field
Name
should be
registered
successfully
successfully
in
text,
Phone
number in
9
digit
number
and
age
should be
Integer
Conclusion: After all corrective actions, the Registration module worked correctly.
Project Title
8/5/2013
Add Product
ID:03
Description
Test Case ID
No Steps
Result
Expected
Outputs
from
Module
Result
(Pass/Fail
)
Corrective
Actions
1.
2
Not
Required
1.
2
Product
New Pass
should
be product
registered
added
successfully
successfull
y
Products
name
should be
in
text,
Product
Quantity in
number
Conclusion: After all corrective actions, the Add Product module worked correctly.
Project Title
8/5/2013
ID:04
Description
No Steps
APIIT SD INDIA
Result
Expected
Page 46
Test Case ID
Outputs
from
Result
(Pass/Fail
Corrective
Actions
1.
2
Not
Required
1.
2
Product would
Product Pass
be displayed
successfull
y displayed
Not
Required
Conclusion: After all corrective actions, the Find Product module worked correctly.
Project Title
8/5/2013
Check availability
ID:05
Description
No Steps
Result
Expected
Test Case ID
Outputs
from
Module
Result
(Pass/Fail
)
Corrective
Actions
1.
2
Not
Required
1.
2
Enter name
product
Not
Required
of
Message
Box
successfull
y displayed
Pass
Conclusion: After all corrective actions, the Check availability module worked
correctly.
Project Title
Automated
Online Testing Date
Shopping Mall System
8/5/2013
ID:06
Description
This module deals with user to give order and pay bill
APIIT SD INDIA
Page 47
Test Case ID
Result
Expected
Outputs
from
Module
Result
(Pass/Fail
)
1.
2
1.
3
Not Required
1.
4
Payment
Screen
successfully
displayed
Not Required
1.
5
Payment
Pass
Successfull
y message
box would
have
to
displayed
Pass
Corrective
Actions
Not Required
User have to
enter
code
only
three
time
otherwise
order will be
canceled
Conclusion: After all corrective actions, the Make Payment module worked
correctly.
Project Title
Automated
Online Testing Date
Shopping Mall System
8/5/2013
ID:07
Description
No Steps
1.
2
Result
Expected
Test Case ID
Outputs
from
Module
Result
(Pass/Fail
)
APIIT SD INDIA
Page 48
Corrective
Actions
Not Required
Order
Pass
successfully
cancel and
displayed
message
If product are
ordered
Conclusion: After all corrective actions, the cancel module worked correctly.
Project Title
Automated
Online Testing Date
8/5/2013
Shopping Mall System
Test Case Name
Display status
Test Case ID
ID:08
Description
This module deals with user to display status of canceled order or
buy product
No Steps
Result
Outputs
Result
Corrective
Expected
from
(Pass/Fail Actions
Module
)
1.
pass
pass
Pass
Not Required
1
Click the button view
status
1. A pop up window pass
pass
Pass
If product are
2
will open and display
ordered
the status of the
product
Conclusion: After all corrective actions, the cancel module worked correctly.
10.
DEPTH OF DISCUSSION
Under this section, the developer is going to discuss the listings of sections that did not meet
the requirements and the code/extracts of the sections that successfully accomplish the
requirements. And also giving the complex part of the system
Sections that meet the requirements
Systems basic Functionality that is discussed above is successfully meeting the requirement and
Special Functionality is also trying to achieve it.
Serial
1.
2.
3.
4.
5.
6.
7.
APIIT SD INDIA
Basic Functionality
Customer registration
Customer login and logout
Achieved
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Page 49
Yes
Special Functionality
Achieved
payment code of 16 digit with only 3 Yes
tries
abort transaction
Yes
3.
Maintain log
No
4.
Concurrency
Yes
5.
Deadlock
Yes
Sections that did not meet the requirements
The developer tried to maintain all the requirements of the system but failed to maintain the log
file of the system.
11.
CRITICAL APPRAISAL
Page 50
13 CONCLUSIONS
The developer was able to apply appropriate concurrent program design methods. The second
tough job successfully completed was the implementation concurrent programming concepts
using Java. The modeling of requirements into Finite State Processes (FSPs) and Labeled
Transition Systems was also a challenging task to perform. Developer has delved into advanced
Javas facilities including multi-threading, Exception Handling, Inheritance, interface and
polymorphism, semaphore. As the developer was totally new to swings so it a challenge for her
to implement the system using swings. Swings are one of the great features provided by Java for
easy designing.
14 REFERENCES
BOOK
1. Jean B (1998). , Concurrent Systems Operating Systems, Database and Distributed
Systems: An Integrated Approach, Harlow 2nd Edition, Addison-Wesley page 167
2. Jeff M & Jeff K (2006) , Concurrency State Models & Java Programming , England,
1st Edition John Wiley & sons, Chapter-1 page 1-16, 2 page 1-20
WEBSITE
1. Corky
Cartwright.
(2007).
What
is
Concurrent
Programming?.
Available:
APIIT SD INDIA
Page 51