USING QR CODE TO PREVENT
FAKE PRODUCT

Phan Hồng An
Lê Kiến Trúc
Phan Gia Nhật
Trần Quang Bình

Supervised by Lâm Hữu Khán...
MINISTRY OF EDUCATION AND TRAINING

FPT UNIVERSITY
Capstone Project Document
Using QR Code To Prevent Fake Product
SE04.B ...
Table of Contents
1

Introduction ...........................................................................................
2.3.8

Software User’s Manual ...............................................................................................
4.5.6

Request management ...................................................................................................
6.3.2
7

Dành cho người tiêu dùng – For Consumer ................................................................ 188

App...
1 Introduction
1.1 Project Information
Project name: Using QR Code to prevent fake products
Project name abbreviation: QR ...
codes are far more powerful and can contain much more information. While out current
barcoding system holds information on...
2 Software Project Planning
2.1 Problem Definition
2.1.1 Name of this CapStone Project
The official and formal project nam...


Authenticated users can view reports showing that which product checked at which time
and how many times checking.

The...
2.2.2

Roles and Responsibilities
Name
Roles
Lâm Hữu Khánh Phương Supervisor, Sponsor
Phan Hồng An

Developer, Team leader...
TortoiseSVN: used for committing source code into SVN
VisualSVN: extension for using SVN inside Visual Studio
Microsoft Pr...
Resource needed
Dependencies and
Constraints
Risks
2.3.6 Implementation
Description
Deliverables
Resource needed
Dependenc...
team members
- Review document & correct if necessary
Software Requirement Specification
6 days
- Create use cases for fun...



Remove all unnecessary using in file header
Do not allow empty catch block

15
3 Software Requirement Specifiation
3.1 User Requirement Specification
3.1.1 Overview
As we all know, the counterfeit of g...
3.1.2








Administrator requirements
Administrators could login to the system using their accounts.
Administrat...
The strategy of counterfeit is mass produce as much as possible and reduce cost to make benefit
from risk. They cannot ste...
3.2.2

System Features

QR4AC System
Update profile

Validate Item
Rate product
<<extend>>

<<include>>

Manage products

...
3.2.2.1.2 Use Case-Login Specification

USE CASE- Login SPECIFICATION

Use-case No.

UC101

Use-case Name

Login

Author

...
Alternative Scenario:
Step

Actor Action

1

Enter the website

2

Fills only user name or password

3

Click to “Login” b...
Summary:
This use case allows administrator or producer to logout the system
Goal:
Logout the system
Triggers
Click “Logou...
3.2.2.2 Producer Management
3.2.2.2.1 Use Case-Producer Management Diagram

QR4AC
List all producers

Register new
produce...
Goal:
Add a new producer into the system
Triggers
Click “Add New Producer” on Sidebar
Preconditions:
User logged into the ...
Relationships:
Log in use case
Business Rules:
None
3.2.2.2.3 Use Case-List all Producers Specification

USE CASE-List all...
Step
1

Actor Action
Click on “List all Producers” on Sidebar

System Response
Display the Producer List Page including th...
Triggers
Click on “Update” on a row of the Producer List page
Preconditions:
User logged into the system successfully
Post...
None
3.2.2.2.5 Use Case-Switch Producer Activation Specification

USE CASE-Switch Producer Activation SPECIFICATION

Use-c...
2

Close the message box and refresh the
producer list with the status toggled

Click “Yes”

Alternative Scenario:
Step

A...
3.2.2.3.2 Use Case-Create New Account Specification

USE CASE-Create New Account SPECIFICATION

Use-case No.

UC301

Use-c...
Step

Actor Action

1

Fills all mandatory data fields on “Create
Account” form on Producer Update page

3

Click to “Rese...
Goal:
View all accounts of a producer
Triggers
View Producer Update page
Preconditions:
User logged into the system succes...
Author

BinhTQ

Date

31/05/2012

Priority

Normal

Actor:
Administrator
Summary:
This use case allows administrator to re...
N/A
Relationships:
Update Producer Information use case
Business Rules:
None
3.2.2.3.5 Use Case-Change Password Specificat...
Main Success Scenario:
Step
1

Actor Action

System Response

Click on “Change password” on
Authentication popup on Naviga...
3.2.2.4.2 Use Case-Create New Information Template Specification

USE CASE-Create New Information Template SPECIFICATION

...
Alternative Scenario:
Step

Actor Action

1

Click on “Create New Template” on
Sidebar

2

Fills all mandatory data fields...
Actor:
Producer
Summary:
This use case allows producer to view their all information templates created on the system
Goal:...
3.2.2.4.4 Use Case-Update Information Template Specification

USE CASE-Update Template Information SPECIFICATION

Use-case...
3

Click “Save changes” button

Redirect to Information Template List Page

Alternative Scenario:
Step

Actor Action

1

C...
Date

31/05/2012

Priority

Normal

Actor:
Producer
Summary:
This use case allow producer to remove an information templat...
List all Information Templates use case
Business Rules:
None

3.2.2.5 Product Management
3.2.2.5.1 Use Case-Product Manage...
Producer
Summary:
This use case allows producer to register a new product for its availability in the system
Goal:
Add New...
Fills some mandatory data fields. Some
are skipped

2

Click to “Submit” button

3

Shows all required messages for all mi...
Post Conditions:
List of product is shown on the screen
Main Success Scenario:
Step
1

Actor Action
Click on “List all Pro...
This user case allows producer to update some information of a product
Goal:
Show the most accurate traits of product
Trig...
Relationships:
Log in use case
Business Rules:
None
3.2.2.5.5 Use Case-Switch Product Activation Specification

USE CASE-S...
Step
1

2

Actor Action

System Response

Click on “Deactivate”/”Activate” on
Product List

A confirmation dialog appears
...
3.2.2.5.6 Use Case-View Product Details

QR4AC

Rating and Comment
<<include>>

View Product
Details

Consumer

Figure 7 -...
Select product on “Product List”
Preconditions:
User access to the website
Post Conditions:
Product details displayed
Main...
3.2.2.6.2 Use Case-Create New Category Specification

USE CASE-Create New Category SPECIFICATION

Use-case No.

UC601

Use...
N/A
Exceptions:
N/A
Relationships:
Update Product Information use case
Business Rules:
None
3.2.2.6.3 Use Case-Remove Cate...
Post Conditions:
Category added
Main Success Scenario:
Step

Actor Action

1

Product updated and a category does not
cont...
3.2.2.7 Request Management
3.2.2.7.1 Use Case-Request Management Diagram

QR4AC
List all Request

Create new request
Reque...
Create new request for creating items
Triggers
Click “Create items” on Product Update page or Product List page
Preconditi...
Log in use case
Business Rules:
None
3.2.2.7.3 Use Case-List all Requests Specification

USE CASE-List all Requests SPECIF...
1

Click on “List of Requests” on Sidebar

Display the list of requests

Alternative Scenario:
None
Exceptions:
None
Relat...
Preconditions:
User is logged into system successfully
Post Conditions:
List of items is shown screen
Main Success Scenari...
3.2.2.8 Item Management
3.2.2.8.1 Use Case-Item Management Diagram

QR4AC
List All Items

Add New Items
Item Management

P...
Add new product items and generate unique QR codes for them
Triggers
Request created by producer
Preconditions:
Service is...
Use-case Name

List all Items Specification

Author

NhatPG

Date

31/05/2012

Priority

Normal

Actor:
Producer
Summary:
...
None
3.2.2.8.4 Use Case-Upload QR Codes for Search

USE CASE-Upload QR Codes for Search SPECIFICATION

Use-case No.

UC803...
drop files from Explorer for upload
Alternative Scenario:
Step

Actor Action

1

Click “Upload for Search” on Item List pa...
Activate/Deactivate items from the system
Triggers
Select items on the list of Items and click Activate/Deactivate
Precond...
3.2.2.9 Item Checking
3.2.2.9.1 Use Case-Item Checking Diagram

QR4AC

Check Item

Consumer

Figure 11 - Use Case-Item Che...
Preconditions:
Consumer has a smartphone with an application helping read QR code. Consumer uses
software to read the QR c...
3.2.2.10 Product Rating
3.2.2.10.1 Use Case-Product Rating Diagram

QR4AC

Rate Product

Consumer

Figure 12 - Use Case-Pr...
Preconditions:
N/A
Post Conditions:
System redirects consumer to the page that shows the result
Main Success Scenario:
Ste...
Business Rules:
None
3.2.2.11 Consumer Check Statistic
3.2.2.11.1 Use Case- Consumer Check Statistic Diagram

QR4AC
View c...
View statistic of product checking by consumer
Triggers
Click “View Chart” on Sidebar
Preconditions:
User is logged into t...
Date

01/06/2012

Priority

High

Actor:
Administrator
Producer
Summary:
This use case allow administrator or producer to ...
3.2.2.11.4 Use Case-Export to Excel Specification

USE CASE-Export to Excel SPECIFICATION

Use-case No.

UC1103

Use-case ...
N/A
Relationships:
Log in use case
Business Rules:
None

3.2.2.12 Logging
3.2.2.12.1 Use Case-Logging Check Statistic Diag...
This use case is used for logging all logged-in user (administrator, producer) actions on
system for audit purpose
Goal:
L...
Mean Time To Repair (MTTR): It should take immediately when admin finds out problem or
someone attacks website. The accept...
3.3 Entity Relationship Diagram
This diagram describes all the entities in the system.

Figure 15 - Entity Relationship Di...
4 Software Design Description
4.1 Design Overview
This document describes the technical and UI design of our system. It in...
4.2 System Architectural Design
4.2.1

Choice of System Architecture

Figure 16 - System Architecture
We use ASP.NET MVC 3...
4.3 Component Diagram

Figure 17 - Component Diagram

79
4.4 Detailed Description of Components
4.4.1

CRC Cards (Class-Responsibility-Collaborators)

Figure 18 - Model Classes

8...
Figure 19 - Controller Classes

81
4.4.1.1 Common
1.1.1.1.1 HomeController

Figure 20 - Controller & View for Home
Methods
public ActionResult Index (string ...
1.1.1.1.3 QR4ACDbContext

Figure 22 - Database Context for model classes
Properties
DbSet<AccountProfile AccountProfiles
>...
1.1.1.1.4 HashUtility

Figure 23 - Methods in HashUtility class
Methods
public static string DecryptString (string Message...
4.4.1.2 Account

Figure 25 - Model-View-Controller for Account
1.1.1.1.6 RegisterModel
Properties
string Username [get, se...
password
1.1.1.1.8 ChangePasswordModel
Properties
string OldPassword [get, set]

Current password

string Password [get, s...
4.4.1.3 Producer

Figure 26 - Model-View-Controller for Producer
1.1.1.1.10 Producer
Properties
int ProducerId [get, set]
...
1.1.1.1.11 ProducerController
Properties
QR4ACDbContext db [get, set]

Object used to query or update
data from database

...
4.4.1.4 Product

Figure 27 - Model-View-Controller for Product
1.1.1.1.12 Product
Properties
int ProductId [get, set]

ID ...
string Logo [get, set]

Path of product’s logo

1.1.1.1.13 ProductController
Methods
public ActionResult Create ()
Display...
4.4.1.5 Item

Figure 28 - Model-View-Controller for Item
1.1.1.1.14 Item
Properties
int ItemId [get, set]
DateTime IssueDa...
Methods
public int GetId (string file)
Get Item ID from QR Code Image
public JsonResult GetQRCode (Product product)
Add a ...
int CheckingId [get, set]
string ConsumerId [get, set]
DateTime CheckingDate [get, set]
int ItemId [get, set]
string Locat...
4.4.1.7 Rating

Figure 30 - Model-View-Controller for Rating

1.1.1.1.17 Rating
Properties
int RatingId [get, set]

ID of ...
public JsonResult RateProduct(string productId, string rating)
Rate product
4.4.1.8 Category

Figure 31 - Model-View-Contr...
public ActionResult Search(string searchText)
Search category based on search text
public ActionResult Index()
List all ca...
public ActionResult Create(InfoTemplate template)
Insert template to database
public ActionResult Edit(int id)
Show updati...
int RequestId [get, set]
DateTime CreatedDate [get, set]

ID of request
Request’s created time

int ProducerId [get, set]
...
4.4.1.11 Statistic

Figure 34 - Model-View-Controller for CheckingLogs
1.1.1.1.25 CheckingLogs
Properties
int CheckingId [...
1.1.1.1.26 StatisticController
Methods
public ActionResult ExportToExcel()
Export checking logs to excel file
public JsonR...
4.4.2 Encryption algorithm
We can protect the QR code using a hash string in the URL as security checking string. The hash...
4.5.2.2 Add new Template

Figure 37 - Add new Template sequence diagram
4.5.3

Producers Management

4.5.3.1 List all Prod...
4.5.3.2 Add New Producer

Figure 39 - Add new Producer sequence diagram

4.5.3.3 Update Producer Information

Figure 40 - ...
4.5.3.4 Switch Producer Activation

Figure 41 - Switch Producer Activation sequence diagram
4.5.4

Product Categories Mana...
4.5.4.2 Add new Category

Figure 43 - Add new Category sequence diagram
4.5.4.3 Update Category

Figure 44 - Update Catego...
4.5.4.4 Delete Category

Figure 45 - Delete Category sequence diagram
4.5.5

Products Management

4.5.5.1 List all Product...
4.5.5.2 Add New Product

Figure 47 - Add New Product sequence diagram

4.5.5.3 View Product Details

Figure 48 - View Prod...
4.5.5.4 Update Product Information

Figure 49 - Update Product Information sequence diagram

108
4.5.6

Request management

4.5.6.1 Create request for creating QR Code package

Figure 50 Create request for creating QR C...
4.5.6.3 List all Requests

Figure 52 - List all Requests sequence diagram
4.5.6.4 Download QR Code package

Figure 53 - Do...
4.5.7

Items Management

4.5.7.1 List all Items

Figure 54 - List all Items sequence diagram
4.5.7.2 Switch item’s activat...
4.5.7.3 Product Checking

Figure 56 - Product Checking sequence diagram

4.5.8

Statistic

4.5.8.1 View statistic by chart...
4.5.8.2 View checking log

Figure 58 - View checking log sequence diagram

113
4.6 User Interface Design
4.6.1

Description of the User Interface

4.6.1.1 Screen Images
1.1.1.1.27 Login

Figure 59 - Lo...
1.1.1.1.29 Update profile

Figure 61 - Update profile

115
1.1.1.1.30 Change password

Figure 62 - Change password
1.1.1.1.31 List all Producers

Figure 63 - List all producers UI

...
1.1.1.1.32 Add New Producer

Figure 64 - Add new producer UI

117
1.1.1.1.33 Update Producer

Figure 65 - Update producer UI

118
Figure 66 - Producer's account management
1.1.1.1.34 List all Categories

Figure 67 - List all Categories

119
1.1.1.1.35 Create new Category

Figure 68 - Create new Category
1.1.1.1.36 Update Category

Figure 69 - Update Category
1....
1.1.1.1.38 Add new Information Template

Figure 71 - Add new Information Template

121
1.1.1.1.39 List all Products

Figure 72 - List all products UI
1.1.1.1.40 Create items and QR Code images package

Figure ...
1.1.1.1.41 Add New Products

Figure 74 - Add new products UI

123
1.1.1.1.42 Update Product

Figure 75 - Update product UI

1.1.1.1.43 List all Product (Customer’s perspective)

124
1.1.1.1.44

Figure 76 - List all Products

1.1.1.1.45 List all request

125
Figure 77 - List all Request
1.1.1.1.46 View Statistic

Figure 78 - View statistic

126
1.1.1.1.47 View Checking Logs

Figure 79 - View logging

127
4.8 Database Design
i

Figure 80 - Database design
4.8.1 Producers
Name
Type
ProducerId
int (identity)
ProducerName
nvarch...
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
FPT University - Capstone project - Using QR Code to prevent fake products
Upcoming SlideShare
Loading in …5
×

FPT University - Capstone project - Using QR Code to prevent fake products

1,183 views

Published on

We have chosen this project as our capstone project. The first purpose is to complete the FPT University’s syllabus. The second one is not only to create a software engineering project but also to implement a business idea useful and interesting for our live.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,183
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
48
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

FPT University - Capstone project - Using QR Code to prevent fake products

  1. 1. USING QR CODE TO PREVENT FAKE PRODUCT Phan Hồng An Lê Kiến Trúc Phan Gia Nhật Trần Quang Bình Supervised by Lâm Hữu Khánh Phương No. SE04.B – 004 1
  2. 2. MINISTRY OF EDUCATION AND TRAINING FPT UNIVERSITY Capstone Project Document Using QR Code To Prevent Fake Product SE04.B – 004 Phan Hồng An – 60048 Group Members Lê Kiến Trúc – 60145 Phan Gia Nhật – 00683 Trần Quang Bình – 60137 Supervisor Lâm Hữu Khánh Phương Ext Supervisor Capstone Project QR-AntiFake code - Ho Chi Minh City, 8/2012 - 2
  3. 3. Table of Contents 1 Introduction .................................................................................................................................... 7 1.1 1.2 Purpose ................................................................................................................................... 7 1.3 People ..................................................................................................................................... 7 1.4 Problem ................................................................................................................................... 7 1.5 Why QR Code .......................................................................................................................... 7 1.6 Our Solution ............................................................................................................................ 8 1.7 2 Project Information ................................................................................................................. 7 Existing Systems & Market...................................................................................................... 8 Software Project Planning............................................................................................................... 9 2.1 Problem Definition .................................................................................................................. 9 2.1.1 Name of this CapStone Project ....................................................................................... 9 2.1.2 Problem Abstract ............................................................................................................ 9 2.1.3 Project Overview ............................................................................................................. 9 2.1.4 The Current System......................................................................................................... 9 2.1.5 The Proposed System...................................................................................................... 9 2.1.6 Boundaries of the System ............................................................................................. 10 2.1.7 Development Environment ........................................................................................... 10 2.2 Project organization .............................................................................................................. 10 2.2.1 Software Process Model ............................................................................................... 10 2.2.2 Roles and Responsibilities ............................................................................................. 11 2.2.3 Tools and Techniques.................................................................................................... 11 2.2.4 Tools .............................................................................................................................. 11 2.2.5 Techniques .................................................................................................................... 12 2.3 Project management plan..................................................................................................... 12 2.3.1 Tasks .............................................................................................................................. 12 2.3.2 Ideation ......................................................................................................................... 12 2.3.3 Project Planning ............................................................................................................ 12 2.3.4 Software Requirement Specification ............................................................................ 12 2.3.5 Software Design Description ......................................................................................... 12 2.3.6 Implementation ............................................................................................................ 13 2.3.7 Quality control .............................................................................................................. 13 3
  4. 4. 2.3.8 Software User’s Manual ................................................................................................ 13 2.3.9 Release and Deployment .............................................................................................. 13 2.3.10 Task Sheet: Assignment and Timetable ........................................................................ 13 2.4 Coding Convention ................................................................................................................ 14 2.4.1 2.4.2 Lengths .......................................................................................................................... 14 2.4.3 3 Naming conventions ..................................................................................................... 14 Other convention .......................................................................................................... 14 Software Requirement Specifiation .............................................................................................. 16 3.1 User Requirement Specification ........................................................................................... 16 3.1.1 Overview ....................................................................................................................... 16 3.1.2 Administrator requirements ......................................................................................... 17 3.1.3 Producer requirements ................................................................................................. 17 3.1.4 Consumer requirements ............................................................................................... 17 3.1.5 Item checking requirements ......................................................................................... 17 3.1.6 Out of Scope.................................................................................................................. 18 3.2 System Requirement Specification ....................................................................................... 18 3.2.1 External Interface Requirements .................................................................................. 18 3.2.2 System Features ............................................................................................................ 19 3.3 4 Entity Relationship Diagram.................................................................................................. 76 Software Design Description ......................................................................................................... 77 4.1 Design Overview ................................................................................................................... 77 4.2 System Architectural Design ................................................................................................. 78 4.2.1 Choice of System Architecture ...................................................................................... 78 4.2.2 Discussion of Alternative Designs ................................................................................. 78 4.3 Component Diagram ............................................................................................................. 79 4.4 Detailed Description of Components .................................................................................... 80 4.4.1 CRC Cards (Class-Responsibility-Collaborators) ............................................................ 80 4.4.2 Encryption algorithm .................................................................................................. 101 4.5 Sequence Diagram .............................................................................................................. 101 4.5.1 Login ............................................................................................................................ 101 4.5.2 Template Management .............................................................................................. 101 4.5.3 Producers Management ............................................................................................. 102 4.5.4 Product Categories Management ............................................................................... 104 4.5.5 Products Management................................................................................................ 106 4
  5. 5. 4.5.6 Request management ................................................................................................. 109 4.5.7 Items Management ..................................................................................................... 111 4.5.8 Statistic ........................................................................................................................ 112 4.6 User Interface Design .......................................................................................................... 114 4.6.1 4.8 Description of the User Interface................................................................................ 114 Database Design.................................................................................................................. 128 4.8.1 4.8.2 AccountProfiles ........................................................................................................... 129 4.8.3 Products ...................................................................................................................... 129 4.8.4 Items ........................................................................................................................... 129 4.8.5 CheckingLogs ............................................................................................................... 129 4.8.6 Rating .......................................................................................................................... 129 4.8.7 Requests ...................................................................................................................... 130 4.8.8 Categories ................................................................................................................... 130 4.8.9 5 Producers .................................................................................................................... 128 InfoTemplates ............................................................................................................. 130 Software Test Document ............................................................................................................ 131 5.1 Introduction ........................................................................................................................ 131 5.1.1 System Overview......................................................................................................... 131 5.1.2 Test Approach ............................................................................................................. 131 5.2 Test Plan .............................................................................................................................. 131 5.2.1 GUI .............................................................................................................................. 131 5.2.2 Functions ..................................................................................................................... 131 5.2.3 Features not to be tested ........................................................................................... 132 5.3 Test cases: ........................................................................................................................... 132 5.3.1 GUI .............................................................................................................................. 132 5.3.2 Functions ..................................................................................................................... 151 5.4 4. Checklists......................................................................................................................... 171 5.4.1 5.4.2 6 4.1 Checklist of Validation........................................................................................... 171 4.2 Submission Checklist ............................................................................................. 171 User Manual ................................................................................................................................ 172 6.1 Minimum System Requirements ........................................................................................ 172 6.2 Deployment Manual ........................................................................................................... 172 6.3 Các chức năng và cách sử dụng - Features and how to use ............................................... 173 6.3.1 Dành cho nhà sản xuất – For Producer ....................................................................... 173 5
  6. 6. 6.3.2 7 Dành cho người tiêu dùng – For Consumer ................................................................ 188 Appendix ..................................................................................................................................... 192 6
  7. 7. 1 Introduction 1.1 Project Information Project name: Using QR Code to prevent fake products Project name abbreviation: QR Anti-Counterfeit Project code: QR4AC Timeline: from May 2012 to Aug 2012 1.2 Purpose We have chosen this project as our capstone project. The first purpose is to complete the FPT University’s syllabus. The second one is not only to create a software engineering project but also to implement a business idea useful and interesting for our live. 1.3 People Full Name Phan Hồng An Lê Kiến Trúc Phan Gia Nhật Trần Quang Bình Lâm Hữu Khánh Phương Roles in Group Developer, Team Leader Developer, Business Analyst Developer, Technical Specialist Developer, QA & Tester Supervisor, Sponsor Contact anph60048@fpt.edu.vn truclk60145@fpt.edu.vn nhatpg00683@fpt.edu.vn binhtq60137@fpt.edu.vn phuonglhk@fpt.edu.vn 1.4 Problem Forgery of goods and using known brand names for fake products is a growing phenomenon, and anti-counterfeit has never been an old problem today. Actually, the topic of brand piracy is practically present in almost every area of daily life. It includes consumer goods like fashion, food, beverages, industrial parts for cars, aircraft and other machines and even medications. In 2008, the International Chamber of Commerce argued that counterfeiting accounts for around 5% to 7% of world trade. In the same year, the World Customs Organization estimated trade in ‘fakes’ as US$512 billion. The total loss from the counterfeit goods industry, faced by countries around the world is $600 Billion, with the United States facing the economic impact. It is true that in some cases people want to buy fake products for their lower price, but it is still important that consumers will be able to validate the authenticity of the product they pay for whether fake or not. While many companies lose a lot of money from this phenomenon it may be that with today technology there are means to fight it. We would like to consider in this project the relevance of QR codes for fighting brand piracy. 1.5 Why QR Code Unlike the standard barcode system in use today, QR (abbreviated from Quick Response) 7
  8. 8. codes are far more powerful and can contain much more information. While out current barcoding system holds information only one-way, QR code holds information both vertically and horizontally. QR code is the modern technology helping read and collect digital information accurately, fast and fully. It is also the cheapest method when comparing to some other technologies such as NFC. If you want to know some necessary information for different purposes, all you need is a smartphone armed with a camera for reading the QR code and is able to access to the Internet. One of the main things we mention here is supporting anti-counterfeit. Technically, QR code will include some basic information of an item, a unique number and uncounterfeited confirmation code created based on cryptography algorithms. The only way you can counterfeit is to copy the QR code. QR codes have only really become popular in 2011 because of the rise in the number of smartphone users and the increasing popularity and usability of the mobile web. Plenty of applications are available to read QR codes and in some handsets, this functionality is preinstalled. 1.6 Our Solution The core services we provide are for producers. Our producers who use our services can generate and print unique QR code for their products before those products appear on the stores. A consumer comes to the store. With a smartphone on hand, he or she can validate the authenticity of the product by scanning the QR code stuck on the product and then see the results via our confirmation website. The results we provide for consumers should include some useful information such as “This is a genuine security label”; “You are not in an address of an authorized reseller of us. Please be careful”; “This code is not available on our system”; etc. 1.7 Existing Systems & Market HP has been running Anti-Counterfeit Program using QR Code since 2012. Not every company in the world has enough resources to create a system like HP. Therefore, we believe that if we run fast, we would be able to enter a Blue Ocean where there are no competitors. 8
  9. 9. 2 Software Project Planning 2.1 Problem Definition 2.1.1 Name of this CapStone Project The official and formal project name is “Using QR Code to prevent fake product”. The product name is QR Anti-Counterfeit, and the product code is QR4AC. 2.1.2 Problem Abstract Be fascinated by the idea that QR code can contain more information than traditional barcode and so using QR codes can create more secure solutions for anti-counterfeit problems today, the authors of this project want to find a solution for fighting counterfeit using QR Code. After discussing with many ideas, we choose the best one to implement. The idea we choose in this project is to provide services for companies, which will help them manage their product identification on the websites. Their customers, who want to buy genuine products instead of fake products, can validate the products using smartphone by just scanning QR code stuck on the products and receive the results from our website or the company’s website. 2.1.3 Project Overview 2.1.4 The Current System HP has been running HP Anti-Counterfeit Program, Printing and Personal Systems for their inkjet cartridges in select geographies. HP places a security seal on the packaging of many of its cartridges so that it is easy to distinguish between genuine HP versus fake. Most counterfeit HP cartridges also contain a fake security seal on the packaging. Checking for a security seal is not enough. HP uses an online solution to make sure the security seal performs exactly as described to ensure that you are purchasing a genuine HP cartridge. To check the authentication of a product, you can download a QR code scanner app to your camera-enabled smartphone, and then scan the QR code on the security seal. You will receive instant verification from HP. If your phone does not have a camera lens, you can validate HP security seals online by going to HP.com/go/ok and entering the serial number from the seal. That is HP’s. We should recognize that not every company have enough resources to build a system like HP, even some companies do not have websites. Why do not we create a system that is able to provide services for any companies who want to protect their customers’ interest? 2.1.5 The Proposed System The purpose of this project is to create a product providing services for all companies who want to use QR code for their product identification and better quality of services for their customers. The system will provide the following main features for companies who register our service:     Each company will have one or more authenticated account to login to the system. Authenticated users can register their products and generate QR codes for their product items. Each product item matches with only one QR code. Authenticated users can manage all their products, product items, and QR codes. Authenticated users can download QR code packages for their product items. 9
  10. 10.  Authenticated users can view reports showing that which product checked at which time and how many times checking. The system will provide the following features for consumers, who are customers who want to buy products of the companies using our service:     Consumers can validate the authentication of a product by scanning the QR code stuck on the product and receive the results displayed on mobile phone. Consumers can rate a product after checking an item of that product. Consumers can find related products after checking an item of that product. Consumers can review products registered on websites. 2.1.6 Boundaries of the System The system under development of this Capstone Project will include:   2.1.7 The website complete All the process documents involved Development Environment 2.1.7.1 Hardware  Laptop or desktop with appropriate environment for developing and testing  Smartphones aimed with cameras for testing 2.1.7.2     Software Microsoft Windows 7: OS for developing product Microsoft Visual Studio 2010: used for developing product Microsoft SQL Server 2008: used for database management for product Microsoft Windows Server 2008: used for deploying and testing product 2.2 Project organization 2.2.1 Software Process Model Due to specific characteristics of a Capstone project, the model we use for developing this project is Waterfall model. 10
  11. 11. 2.2.2 Roles and Responsibilities Name Roles Lâm Hữu Khánh Phương Supervisor, Sponsor Phan Hồng An Developer, Team leader Lê Kiến Trúc Developer, Business Analyst, Imagineer Phan Gia Nhật Developer, Technical Specialist Trần Quang Bình 2.2.3 Developer, Tester, QC - Responsibilities Advise idea & solutions Suggest & support technologies Manage, control the project Create coding framework Code Test Take the responsibility for any success or failure of the project Imagine, brainstorm Analyze business & system Code Test Research new techniques and technologies Fix technical issues Code Test Control the quality of project Code Test Tools and Techniques 2.2.4 Tools Assembla (www.assembla.com): subversion (SVN) repository 11
  12. 12. TortoiseSVN: used for committing source code into SVN VisualSVN: extension for using SVN inside Visual Studio Microsoft Project: for team leader to manage project Gantter (gantter.com): like a web-based Microsoft Project for all team members to access easily Asana (www.asana.com): for task management Google Drive: for storing all documents include official documents for report and draft documents Google Cloud Connect: connect and synchronize the documents Google+ Hangout: for team meetings 2.2.5 Techniques ASP.NET MVC 3.0, C# .NET, HTML & CSS, JavaScript & jQuery, AJAX, LINQ 2.3 Project management plan 2.3.1 Tasks 2.3.2 Ideation Description Deliverables Resource needed Dependencies and Constraints Risks 2.3.3 Project Planning Description Deliverables Resource needed Dependencies and Constraints Risks Study QR code, research market, brainstorm solutions for anticounterfeit using QR code, define project scope Introduction document, 32 man-days Using QR Code to prevent fake products Bad business idea can make the produce useless in the market Plan the project, assign tasks to members Software Project Management Plan document, Coding conventions FPT’s templates, 20 man-days Bad leadership or management skills Overestimate or underestimate can make a unqualified project 2.3.4 Software Requirement Specification Description Specify software requirements Deliverables Software Requirement Specification document Resource needed FPT’s templates, 24 man-days Dependencies and Constraints Risks Bad analysis might make the product difficult to maintain in future 2.3.5 Software Design Description Description Describe software design Deliverables Software Design Description document, Prototype 12
  13. 13. Resource needed Dependencies and Constraints Risks 2.3.6 Implementation Description Deliverables Resource needed Dependencies and Constraints Risks 2.3.7 Quality control Description Deliverables Resource needed Dependencies and Constraints Risks FPT’s templates, 40 man-days Bad analysis might make the product difficult to maintain in future GUI is not friendly Develop the product Complete product Visual Studio 2010, SQL Server 2008, .NET Framework 4, 80 mandays MVC3, Coding convention Not all the functions can be done be deadline Decrease of members during implementation Control the quality of the product & testing Software Test Documentation FPT’s templates, 40 man-days The product does not work properly as expect 2.3.8 Software User’s Manual Description Write user’s manual Deliverables Software User’s Manual Resource needed FPT’s templates, 20 man-days Dependencies and English Constraints Risks Dry words make user confuse 2.3.9 Release and Deployment Description Release the complete product and deploy it to the server Deliverables Complete product installation on server Resource needed Server, 40 man-days Dependencies and Constraints Risks The application does not run properly when going live 2.3.10 Task Sheet: Assignment and Timetable Task Duration Start - Finish Ideation 8 days 8/5  17/5 - Imagine, brainstorm, analyze business & research market - Study QR code and some other technologies involved - Write document - Finalize business idea & define project scope Project Planning 5 days 18/5  24/5 - Analyze the current systems on market & propose a new system with specific characteristics - Write software project management plan & assign tasks to Resources TrucLK NhatPG BinhTQ AnPH TrucLK AnPH 13
  14. 14. team members - Review document & correct if necessary Software Requirement Specification 6 days - Create use cases for functional requirements - Write non-functional requirements - Finalize document Software Design Description 2 weeks - Write document - Draw diagrams - Design database - Create prototype - Integrate, finalize document Implementation 4 weeks - Create coding framework - Code server-side - Code client-side Quality Control 6 weeks - Create test plan - Create test cases - Unit Test - System Test - Complete Software Test Document (STD) Software User’s Manual 1 week - Write installation guide - Write user guide Release and Deployment 3 weeks - Input initial data - Go live - Prepare for final presentation BinhTQ, NhatPG 25/5  1/6 AnPH, TrucLK, BinhTQ, NhatPG TrucLK AnPH 4/6  15/6 BinhTQ, TrucLK TrucLK, BinhTQ, NhatPG AnPH AnPH, NhatPG AnPH 18/6  13/7 AnPH NhatPG, AnPH, BinhTQ AnPH, TrucLK, NhatPG 18/6  27/7 18/6  22/6 25/6  29/6 16/7  20/7 23/7  27/7 23/7  27/7 30/7  3/8 BinhTQ BinhTQ, NhatPG, TrucLK BinhTQ, NhatPG, AnPH AnPH, TrucLK BinhTQ, NhatPG NhatPG, AnPH TrucLK, BinhTQ 30/7  17/8 BinhTQ, NhatPG AnPH, TrucLK AnPH, TrucLK, BinhTQ, NhatPG 2.4 Coding Convention 2.4.1      Naming conventions Private Fields: underscore followed by lowerCamelCase Non-private Fields and properties: UpperCamelCase Local variables: lowerCamelCase Do not use consecutive underscores in name Do not use Hungarian style 2.4.2   Lengths Public name should not be longer than 32 characters or 7 words Methods should contain no more than 70 lines of code (if it is, it must be divided into methods) Methods should contain no more than 5 levels of indentation (if it is, it must be divided into methods) A line of code should contain no more than 80 characters   2.4.3  Other convention Use var keyword whenever possible 14
  15. 15.   Remove all unnecessary using in file header Do not allow empty catch block 15
  16. 16. 3 Software Requirement Specifiation 3.1 User Requirement Specification 3.1.1 Overview As we all know, the counterfeit of goods, especially famous brand names, has grown significantly year after year and there is no sign that it will decrease in the near future. So how can we fight it? How can we overcome it? Actually now there is no way to absolutely stop it. However, we can reduce its development. We can make life more difficult for the ones who just earn money from people’s hardworking, diligent results. Therefore, we in this project introduce you one way for decrease your risk at taking fake product. Using QR code, our system will support you in determining whether a product is a fake or not. For producers, who are the ones losing the most money due to counterfeit, they can use our system to somewhat reduce their loss. The process is very simple. First, we can start negotiating. After that, we sign contract. Then we provide an account for you to generate QR code. From that, you can stick it to your product. For consumers, they can use our system to gain guarantee degree for a product on which they will spend a lot of money. 16
  17. 17. 3.1.2        Administrator requirements Administrators could login to the system using their accounts. Administrators could add producers into the system. Administrators could view and search producers on the system. Administrators could deactivate or reactivate producers. Administrators could create accounts for producers. Administrators could view all the accounts of a specific producer. Administrators could remove producer accounts. 3.1.3       Producer requirements Producers could login to the system using their accounts. Producers could view and search all their products on the system. Producers could deactivate or reactivate their products on the system. Producers could create information templates for their product information. Producers could create categories for their product information. Producers could add product items into the system and generate unique QR codes for those items. Producers could view the all the items containing unique QR code of a specific product registered. Producers could deactivate or reactivate their items on the system. Producers could view statistic of all their product items, includes number of checks, which consumer check at which time, etc.    3.1.4   3.1.5 Consumer requirements Consumers could validate the authentication of a product item using their smartphone aimed with a camera, a barcode reader, a mobile browser, and an Internet connection. Consumers could rate a product after validating its item. Item checking requirements 3.1.5.1 How QR code could fight against counterfeiting QR code could store big data with error recovery. Therefore, we can put it easily on item. However, QR code still can be faked and copy. We will provide some mechanisms to protect the QR code. 3.1.5.2 Prevent fake QR code: After decode QR code, we will have an URL to our system. This URL is unique for each item. The URL will contain item ID and a secure password. We will combine these parameters with secret key and finally hashed to make a secure string. The security hash string cannot be guest or generate because of secret key. On later version, we could also use public-key cryptography algorithm. What shall we do if some people completely build another website with same functionalities for phishing? We need to have a strong brand that easy to remember and check by consumer. 3.1.5.3 Prevent QR code from stolen for fake product The QR code can still be vulnerable from identically copying. Therefore, the problem is how to detect the stolen code. 17
  18. 18. The strategy of counterfeit is mass produce as much as possible and reduce cost to make benefit from risk. They cannot steal all QR code and make the same. They can just copy a little of QR code from the market but it will take time and risk. System could use data mining techniques with patterns and cases to determine stolen QR code from real one. These patterns include time, location, number, frequently be calculated with a formula then giving a reliability suggestion of product. This formula would be improved during operation. 3.1.6 Out of Scope Nowadays, there is a lot of software used for reading QR code on mobile. Therefore, our team will not go too far in this section. In the other hand, our solution focuses on business processes more than technologies. The favorite software we would like to use most is Barcode Scanner, which you can easily find on Google Play or iTunes App Store. 3.2 System Requirement Specification 3.2.1 External Interface Requirements 3.2.1.1 User Interfaces The look and feel of this website should rely on user requirements, no matter if users access via mobile or computer. Page layout and navigation should be as intuitive and easy as possible. Moreover, the design should be responsive. It means that the web components should be scaled according to a range of resolutions and devices to provide a consistent experience, no matter what. 3.2.1.2 Hardware Interfaces All things producer needs to access to use our system are a computer and an Internet connection. Consumer needs to have a smartphone aimed with a camera, a QR code reader, and an Internet connection in order to scan QR code on the product item and access our system to see the results. 3.2.1.3 Software Interfaces Our product runs on web platform. It requires being able to run on browsers of both PCs and mobiles. Software .NET Framework SQL Server Visual Studio MVC Browsers Version 4.0 2008 2010 3.0 Latest version of any browser (recommended) Source Microsoft Microsoft Microsoft Microsoft Mozilla, Google, Apple, etc. 3.2.1.4 Communications Protocol The protocol we would use is HTTP. We run our system on the browser using standard protocols for communication between client and server. 18
  19. 19. 3.2.2 System Features QR4AC System Update profile Validate Item Rate product <<extend>> <<include>> Manage products View Product Details <<include>> Consumer Manage items Manage producers Login <<include>> Manage Information Templates Manage accounts <<include>> Manage Requests Producer Manage Categories Administrator View Consumer Check Statistic Figure 1 - Overal Use Case Diagram 3.2.2.1 User Authentication 3.2.2.1.1 User Case-User Login Diagram QR4AC Logout <<include>> Login Administrator Producer Figure 2 - User Case-User Login Diagram 19
  20. 20. 3.2.2.1.2 Use Case-Login Specification USE CASE- Login SPECIFICATION Use-case No. UC101 Use-case Name Login Author BinhTQ Date Use-case Version 31/05/2012 Priority 1.0 High Actor: Administrator, Producer Summary: This use case allows administrator or producer to log on into the system Goal: Log on into the system Triggers Click to open login form on Navigation Bar Preconditions: User has an account and has not logged in yet Post Conditions: User has logged in Redirects to List Page Main Success Scenario: Step Actor Action 1 Enter the website 2 Fills user name and password 3 Click to “Login” button. System Response Display a form for login Redirects to Home Page 20
  21. 21. Alternative Scenario: Step Actor Action 1 Enter the website 2 Fills only user name or password 3 Click to “Login” button. System Response Display a form for login Display an error message Exceptions: Step Actor Action 1 Enter the website 2 System Response Fills user name and password 3 Display a form for login Click to “Login” button Cannot logged in and display an error message Relationships: N/A Business Rules: None 3.2.2.1.3 Use Case-Logout Specification USE CASE-Logout SPECIFICATION Use-case No. UC102 Use-case Name Logout Author BinhTQ Date 31/05/2012 Use-case Version Priority 1.0 High Actor: Administrator, Producer 21
  22. 22. Summary: This use case allows administrator or producer to logout the system Goal: Logout the system Triggers Click “Logout” link Preconditions: User logged into the system successfully Post Conditions: User has logged out Redirects to Login page Main Success Scenario: Step 1 Actor Action Click “Logout” link System Response Redirects to Login page Alternative Scenario: N/A Exceptions: N/A Relationships: N/A Business Rules: None 22
  23. 23. 3.2.2.2 Producer Management 3.2.2.2.1 Use Case-Producer Management Diagram QR4AC List all producers Register new producer Producer Management Update information of producer Administrator Switch producer activation Figure 3 - Use Case-Producer Management Diagram 3.2.2.2.2 Use Case-Add New Producer with Account Specification USE CASE-Add New Producer SPECIFICATION Use-case No. UC201 Use-case Name Add New Producer Author AnPH Date 31/05/2012 Use-case Version Priority 1.0 High Actor: Administrator Summary: This use case allows administrator to add a new producer into the system 23
  24. 24. Goal: Add a new producer into the system Triggers Click “Add New Producer” on Sidebar Preconditions: User logged into the system successfully Post Conditions: System refresh the list of producers on Producer List Page Main Success Scenario: Step Actor Action 1 Click on “Add New producer” on Producer List Page or on Sidebar 2 Fills all mandatory data fields 3 Click to “Submit” button. System Response Display a form for adding producer Close the form and refresh the list of producers Alternative Scenario: Step Actor Action 1 Click on “Add New producer” on Producer List Page or on Sidebar 2 Fills all mandatory data fields 3 Click to “Back to List” button. System Response Display a form for adding producer Close the form Exceptions: Step Actor Action 1 Click on “Add New producer” on Producer List Page or on Sidebar 2 Fills all mandatory data fields 3 Click to “Submit” button. System Response Display a form for adding producer Shows all required messages for all missing mandatory data fields 24
  25. 25. Relationships: Log in use case Business Rules: None 3.2.2.2.3 Use Case-List all Producers Specification USE CASE-List all Producers SPECIFICATION Use-case No. UC202 Use-case Name List all Producers Author BinhTQ Date 31/05/2012 Use-case Version Priority 1.0 High Actor: Administrator Summary: This use case allows administrator to view the list of all producers Goal: View the list of all producers Triggers Click on “List all Producers” on Sidebar Preconditions: User logged into the system successfully Post Conditions: System redirects user to Producer List Page Main Success Scenario: 25
  26. 26. Step 1 Actor Action Click on “List all Producers” on Sidebar System Response Display the Producer List Page including the list of all producers Alternative Scenario: N/A Exceptions: N/A Relationships: Log in use case Business Rules: None 3.2.2.2.4 Use Case-Update Producer Information Specification USE CASE-Update Producer Information SPECIFICATION Use-case No. UC203 Use-case Version Use-case Name Update Producer Information Author BinhTQ Date 31/05/2012 Priority 1.0 High Actor: Administrator Summary: This use case allows administrator to update information of a producer Goal: Update producer information 26
  27. 27. Triggers Click on “Update” on a row of the Producer List page Preconditions: User logged into the system successfully Post Conditions: System refreshes the list of producers on Producer List Page Main Success Scenario: Step Actor Action 1 Click on “Update” on a row of the producer list on Producer List Page 2 Update some data fields 3 Click to “Save changes” button System Response Display a form for update producer information Redirect to Producer List page Alternative Scenario: Step Actor Action 1 Click on “Update” on a row of the producer list on Producer List Page 2 Update some data fields 3 Click to “Back to List” button System Response Display a form for update producer information Redirect to Producer List page Exceptions: Step Actor Action 1 Click on “Update” on a row of the producer list on Producer List Page 2 System Response Update some data fields 3 Click to “Save changes” button Display a form for update producer information Shows all required messages for all missing mandatory data fields Relationships: Log in use case Business Rules: 27
  28. 28. None 3.2.2.2.5 Use Case-Switch Producer Activation Specification USE CASE-Switch Producer Activation SPECIFICATION Use-case No. UC204 Use-case Version Use-case Name Switch Producer Activation Author AnPH Date 31/05/2012 Priority 1.0 High Actor: Administrator Summary: This use case allows administrator to deactivate/activate a producer in the system Goal: Deactivate/Activate a producer in the system Triggers Click on “Deactivate”/”Activate” on the list of all producers on Producer List Page Preconditions: User logged into the system successfully Post Conditions: Producer status togged and Producer List refreshed Main Success Scenario: Step 1 Actor Action Click on “Deactivate”/”Activate” on a row of a producer on the list of producers on the Producer List Page System Response A confirmation dialog appears 28
  29. 29. 2 Close the message box and refresh the producer list with the status toggled Click “Yes” Alternative Scenario: Step Actor Action System Response A confirmation dialog appears 1 Click on “Deactivate”/”Activate” on a row of a producer on the list of producers on the Producer List Page 2 Click “No” Close the message box Exceptions: N/A Relationships: List all Producers use case Business Rules: None 3.2.2.3 Account Management 3.2.2.3.1 Use Case-Account Management Diagram QR4AC List All Accounts Create Account Account Management Administrator Remove account Change password Figure 4 - Use Case-Account Management Diagram 29
  30. 30. 3.2.2.3.2 Use Case-Create New Account Specification USE CASE-Create New Account SPECIFICATION Use-case No. UC301 Use-case Name Create New Account Author BinhTQ Date 31/05/2012 Use-case Version Priority 1.0 Normal Actor: Administrator Summary: This use case allows administrator to create an account for a producer Goal: Create an account for a producer Triggers View Product Update page Preconditions: User logged into the system successfully Post Conditions: System refresh the list of accounts displayed on Producer Detail page Main Success Scenario: Step Actor Action 1 Fills all mandatory data fields on “Create Account” form on Producer Update page 2 Click to “Submit” button System Response Refresh the list of accounts Alternative Scenario: 30
  31. 31. Step Actor Action 1 Fills all mandatory data fields on “Create Account” form on Producer Update page 3 Click to “Reset” button. System Response Reset the form Exceptions: Step Actor Action Display a form for creating account 1 Fills all mandatory data fields on “Create Account” form on Producer Update page. Some are skipped. Click to “Submit” button. Shows all required messages for all missing mandatory data fields 3 System Response Relationships: Update Producer Information use case Business Rules: None 3.2.2.3.3 Use Case-List all Producer Accounts of a Specific Producer Specification USE CASE-List all Accounts SPECIFICATION Use-case No. UC302 Use-case Version Use-case Name List all Accounts of a Specific Producer Author BinhTQ Date 31/05/2012 Priority 1.0 Normal Actor: Administrator Summary: This use case allows administrator to view all accounts of a producer 31
  32. 32. Goal: View all accounts of a producer Triggers View Producer Update page Preconditions: User logged into the system successfully Post Conditions: System display the list of accounts of that producer Main Success Scenario: Step 1 Actor Action Click on “Accounts” in Producer Update page or on Sidebar System Response Display the list of accounts Alternative Scenario: N/A Exceptions: N/A Relationships: Update Producer Information use case Business Rules: None 3.2.2.3.4 Use Case-Remove an Account Specification USE CASE-Remove an Account SPECIFICATION Use-case No. UC303 Use-case Name Use-case Version 1.0 Remove an Account 32
  33. 33. Author BinhTQ Date 31/05/2012 Priority Normal Actor: Administrator Summary: This use case allows administrator to remove an account of a producer Goal: Remove an account of a producer Triggers Click “Delete” on a row of an account on the list of accounts Preconditions: User logged into the system successfully Post Conditions: System display the list of accounts of that producer Main Success Scenario: Step Actor Action Display a confirmation message 1 Click on “Delete” on a row of an account on the list of accounts on the Producer Detail page Click “Yes” Close the message and refresh the list of accounts 2 System Response Alternative Scenario: Step Actor Action System Response Display a confirmation message 1 Click on “Remove” on a row of an account on the list of accounts on the Producer Detail page 2 Click “No” Close the message Exceptions: 33
  34. 34. N/A Relationships: Update Producer Information use case Business Rules: None 3.2.2.3.5 Use Case-Change Password Specification USE CASE-Change Password SPECIFICATION Use-case No. UC304 Use-case Name Change Password Author BinhTQ Date 31/05/2012 Use-case Version Priority 1.0 Normal Actor: Administrator Summary: This use case allows administrator or producer to change their own password Goal: Change own password Triggers Click “Change password” on Authentication popup on Navigation Bar Preconditions: User logged into the system successfully Post Conditions: System display form for changing password 34
  35. 35. Main Success Scenario: Step 1 Actor Action System Response Click on “Change password” on Authentication popup on Navigation Bar Redirect to Change Password page Alternative Scenario: N/A Exceptions: N/A Relationships: Log in use case Business Rules: None 3.2.2.4 Information Template Management 3.2.2.4.1 Use Case-Information Template Management Diagram QR4AC List all Templates InfoTemplates Management Add new Template Update Template Producer Delete Template Figure 5 - Use Case-Information Template Management Diagram 35
  36. 36. 3.2.2.4.2 Use Case-Create New Information Template Specification USE CASE-Create New Information Template SPECIFICATION Use-case No. UC401 Use-case Version Use-case Name Create new information template Author AnPH Date 31/05/2012 Priority 1.0 High Actor: Producer Summary: This use case allows producer to create new information template for their products Goal: Add new information template and generate unique QR codes for them Triggers Click “Create New Template” on Sidebar Preconditions: User logged into the system successfully Post Conditions: Information template added Main Success Scenario: Step Actor Action 1 Click on “Create New Template” on Sidebar 2 Fills all mandatory data fields 3 Click to “Submit” button System Response Redirect to Create New Information Template page Redirect to Template List Page 36
  37. 37. Alternative Scenario: Step Actor Action 1 Click on “Create New Template” on Sidebar 2 Fills all mandatory data fields 3 Click to “Back to List” button System Response Redirect to Create New Information Template page Redirect to Template List Page Exceptions: Step Actor Action 1 Click on “Create New Template” on Sidebar 2 System Response Fills all mandatory data fields 3 Click to “Submit” button Redirect to Create New Information Template page Shows all required messages for all missing mandatory data fields Relationships: Log in use case Business Rules: None 3.2.2.4.3 Use Case-List all Information Templates Specification USE CASE-List all Information Templates SPECIFICATION Use-case No. UC402 Use-case Version Use-case Name List all Information Templates Author AnPH Date 30/05/2012 Priority 1.0 Normal 37
  38. 38. Actor: Producer Summary: This use case allows producer to view their all information templates created on the system Goal: View list of all information templates Triggers Click “List all Templates” on Sidebar Preconditions: User logged into the system successfully Post Conditions: List of product is shown on the screen Main Success Scenario: Step 1 Actor Action Click on “List all Templates” on Sidebar System Response Show the information template list based on the producer logged in Alternative Scenario: N/A Exceptions: N/A Relationships: Log in use case Business Rules: None 38
  39. 39. 3.2.2.4.4 Use Case-Update Information Template Specification USE CASE-Update Template Information SPECIFICATION Use-case No. UC403 Use-case Version Use-case Name Update Template Information Author AnPH Date 31/05/2012 Priority 1.0 High Actor: Producer Summary: This user case allows producer to update template information Goal: Update template information Triggers Click “Update” on a row of template list on Template List Page Preconditions: User logged into the system successfully Post Conditions: System redirects user to the template List Page Main Success Scenario: Step Actor Action 1 Click on “Update” on a row of information template list on Information Template List Page 2 System Response Update information Display a form for update 39
  40. 40. 3 Click “Save changes” button Redirect to Information Template List Page Alternative Scenario: Step Actor Action 1 Click on “Update” on a row of information template list on Information Template List Page 2 Update information 3 Click “Back to List” button System Response Display a form for update Redirect to Information Template List Page Exceptions: Step Actor Action 1 Click on “Update” on a row of information template list on Information Template List Page 2 Update information 3 Click “Save changes” button System Response Display a form for update Shows all required messages for all missing mandatory data fields Relationships: Log in use case Business Rules: None 3.2.2.4.5 Use Case-Delete Information Template Specification USE CASE-Delete an Information Template SPECIFICATION Use-case No. UC404 Use-case Version Use-case Name Delete an Information Template Author 1.0 NhatPG 40
  41. 41. Date 31/05/2012 Priority Normal Actor: Producer Summary: This use case allow producer to remove an information template when it should not be available any more Goal: Remove an information template Triggers Click “Delete” on Information Template List Preconditions: User logged into the system successfully Post Conditions: System redirects user to the information template List Page Main Success Scenario: Step Actor Action System Response 1 Click on “Delete” on a row of template list on Information Template List page A confirmation dialog appears 2 Click “Yes” The template is removed Alternative Scenario: Step Actor Action System Response 1 Click on “Delete” on a row of template list on Information Template List Page A confirmation dialog appears 2 Click “Yes” Nothing changes Exceptions: N/A Relationships: 41
  42. 42. List all Information Templates use case Business Rules: None 3.2.2.5 Product Management 3.2.2.5.1 Use Case-Product Management Diagram QR4AC List all products Add new product Product Management Update product information Producer View product details Switch product activation Figure 6 - Use Case-Product Management Diagram 3.2.2.5.2 Use Case-Add New Product Specification USE CASE-Add New Product SPECIFICATION Use-case No. UC501 Use-case Name Add New Product Author AnPH Date 30/05/2012 Use-case Version Priority 1.0 High Actor: 42
  43. 43. Producer Summary: This use case allows producer to register a new product for its availability in the system Goal: Add New Product Triggers Click “Add New Product” on Sidebar Preconditions: User logged into the system successfully Post Conditions: System redirects user to the Product List Page Main Success Scenario: Step Actor Action 1 Click on “Add New Product” in Product List Page or on Sidebar 2 Fills all mandatory data fields 3 Click to “Submit” button System Response Redirect to Add New Product page Redirect to Product List Page Alternative Scenario: Step Actor Action 1 Click on “Add New Product” in Product List Page or on Sidebar 2 Fills all mandatory data fields 3 Click to “Back to List” button System Response Redirect to Add New Product page Redirect to Product List Page Exceptions: Step Actor Action 1 Click on “Add New Product” in Product List Page or on Sidebar System Response Redirect to Add New Product page 43
  44. 44. Fills some mandatory data fields. Some are skipped 2 Click to “Submit” button 3 Shows all required messages for all missing mandatory data fields Relationships: Log in use case Business Rules: None 3.2.2.5.3 Use Case-List all Products Specification USE CASE-List all Products SPECIFICATION Use-case No. UC502 Use-case Name List all Products Author NhatPG Date 30/05/2012 Use-case Version Priority 1.0 Normal Actor: Producer Summary: This use case allows producer to view their all products registered on the system Goal: View list of all products Triggers Click “List all Products” on Sidebar Preconditions: User logged into the system successfully 44
  45. 45. Post Conditions: List of product is shown on the screen Main Success Scenario: Step 1 Actor Action Click on “List all Products” on Sidebar System Response Show the product list based on the producer logged in Alternative Scenario: N/A Exceptions: N/A Relationships: Log in use case Business Rules: None 3.2.2.5.4 Use Case-Update Product Information Specification USE CASE-Update Product Information SPECIFICATION Use-case No. UC503 Use-case Version Use-case Name Update Product Information Author AnPH Date 31/05/2012 Priority 1.0 High Actor: Producer Summary: 45
  46. 46. This user case allows producer to update some information of a product Goal: Show the most accurate traits of product Triggers Click “Update” on a row of product list on Product List Page Preconditions: User logged into the system successfully Post Conditions: Data updated System redirects user to the product List Page Main Success Scenario: Step Actor Action 1 Click “Update” on a row of Product List 2 Update information 3 Click “Save changes” button System Response Redirect to Update Product page Redirect to Product List Page Alternative Scenario: Step Actor Action 1 Click “Update” on a row of Product List 2 Update information 3 Click “Back to List” button System Response Redirect to Update Product page Redirect to Product List Page Exceptions: Step Actor Action 1 Click “Update” on a row of Product List 2 System Response Update information (some mandatory fields are skipped) 3 Click “Save changes” button Redirect to Update Product page Shows all required messages for all missing mandatory data fields 46
  47. 47. Relationships: Log in use case Business Rules: None 3.2.2.5.5 Use Case-Switch Product Activation Specification USE CASE-Switch Product Activation SPECIFICATION Use-case No. UC504 Use-case Name Switch Product Activation Author NhatPG Date 31/05/2012 Use-case Version Priority 1.0 Normal Actor: Producer Summary: This use case allow producer to deactivate/activate a product when should not be available any more Goal: Switch activation of a product Triggers Click “Deactivate”/”Activate” on Sidebar Preconditions: User logged into the system successfully Post Conditions: Product status toggled and Product List refreshed Main Success Scenario: 47
  48. 48. Step 1 2 Actor Action System Response Click on “Deactivate”/”Activate” on Product List A confirmation dialog appears Click “Yes” Close the message box and refresh the product list with the status toggled Alternative Scenario: Step Actor Action System Response 1 Click on “Deactivate”/”Activate” on Product List A confirmation dialog appears 2 Click “No” Nothing changes Exceptions: N/A Relationships: List all Products use case Business Rules: When a product is out-of-date or the producer does not manufacture it any more, a product might be deactivated to announce, “it is no more supported.” 48
  49. 49. 3.2.2.5.6 Use Case-View Product Details QR4AC Rating and Comment <<include>> View Product Details Consumer Figure 7 - Use Case-View Product Details USE CASE-Update Information of a Product SPECIFICATION Use-case No. UC505 Use-case Name View Product Details Author TrucLK Date 31/05/2012 Use-case Version Priority 1.0 Normal Actor: Producer Summary: This user case allows Consumer to view product details Goal: Show the product details Triggers 49
  50. 50. Select product on “Product List” Preconditions: User access to the website Post Conditions: Product details displayed Main Success Scenario: Step 1 Actor Action System Response Select a product on Product List grid view Display product details Relationships: None Business Rules: None 3.2.2.6 Category Management 3.2.2.6.1 Use Case- Category Management Diagram QR4AC List all Categories Categories Management Create new category Administrator Remove category Figure 8 - Use Case- Category Management Diagram 50
  51. 51. 3.2.2.6.2 Use Case-Create New Category Specification USE CASE-Create New Category SPECIFICATION Use-case No. UC601 Use-case Name Create new category Author AnPH Date 31/05/2012 Use-case Version Priority 1.0 High Actor: Producer Summary: This use case allows producer to create new category for their products when this category does not exists Goal: Create new category Triggers Product updated with new category name which does not existed Preconditions: User logged into the system successfully Post Conditions: Category added Main Success Scenario: Step 1 Actor Action System Response Product updated with a new category name 2 New category added into the system Alternative Scenario: 51
  52. 52. N/A Exceptions: N/A Relationships: Update Product Information use case Business Rules: None 3.2.2.6.3 Use Case-Remove Category USE CASE-Remove Category SPECIFICATION Use-case No. UC602 Use-case Name Remove category Author AnPH Date 31/05/2012 Use-case Version Priority 1.0 High Actor: Producer Summary: This use case allows to remove a category when it does not contain any products any more Goal: Remove old category Triggers Product updated and a category does not contain any products any more Preconditions: User logged into the system successfully 52
  53. 53. Post Conditions: Category added Main Success Scenario: Step Actor Action 1 Product updated and a category does not containing any product any more 2 System Response Old category removed Alternative Scenario: N/A Exceptions: N/A Relationships: Update Product Information use case Business Rules: None 53
  54. 54. 3.2.2.7 Request Management 3.2.2.7.1 Use Case-Request Management Diagram QR4AC List all Request Create new request Request Management Producer Download QRPackage Figure 9 - Use Case-Item Package/Request Management Diagram 3.2.2.7.2 Use Case-Create New Request Specification USE CASE-Create New Request Specification Use-case No. UC701 Use-case Name Create New Request Author NhatPG Date 31/05/2012 Use-case Version Priority 1.0 High Actor: Producer Summary: This use case allows producer to create new request to the system for creating items Goal: 54
  55. 55. Create new request for creating items Triggers Click “Create items” on Product Update page or Product List page Preconditions: User logged into the system successfully Post Conditions: Request created and waits for creating items Main Success Scenario: Step Actor Action 1 Click on “Create items” on Product detail page 2 System Response Fills all mandatory data fields 3 Click to “Create items” button Redirect to Create Items page Create request and redirect to Request List page; waiting for creating items processing Alternative Scenario: Step Actor Action 1 Click on “Create items” on Product detail page 2 Fills all mandatory data fields 3 Click to “Back to Product List” button System Response Redirect to Create Items page Redirect to Product List page Exceptions: Step Actor Action 1 Click on “Create items” on Product detail page 2 System Response Fills some mandatory data fields but skips some 3 Click to “Submit” button Redirect to Create Items page Shows all required messages for all missing mandatory data fields Relationships: 55
  56. 56. Log in use case Business Rules: None 3.2.2.7.3 Use Case-List all Requests Specification USE CASE-List all Requests SPECIFICATION Use-case No. UC702 Use-case Version Use-case Name List all Requests Specification Author NhatPG Date 31/05/2012 Priority 1.0 Normal Actor: Producer Summary: This use case allows producer to view all requests created on the system Goal: View the list of requests created Triggers Click “List all Requests” on Sidebar Preconditions: User is logged into system successfully Post Conditions: List of items is shown screen Main Success Scenario: Step Actor Action System Response 56
  57. 57. 1 Click on “List of Requests” on Sidebar Display the list of requests Alternative Scenario: None Exceptions: None Relationships: Login use case Business Rules: None 3.2.2.7.4 Use Case-Download QR Code Packages Specification USE CASE-Download QR Code Packages SPECIFICATION Use-case No. UC703 Use-case Version Use-case Name Download QR Code Packages Specification Author NhatPG Date 31/05/2012 Priority 1.0 Normal Actor: Producer Summary: This use case allows producer to download QR code packages Goal: Download QR code packages Triggers Click “Download” on a row of Request List 57
  58. 58. Preconditions: User is logged into system successfully Post Conditions: List of items is shown screen Main Success Scenario: Step 1 Actor Action Click on “Download” on a row of Request List System Response File downloaded into computer Alternative Scenario: None Exceptions: None Relationships: Login use case Business Rules: None 58
  59. 59. 3.2.2.8 Item Management 3.2.2.8.1 Use Case-Item Management Diagram QR4AC List All Items Add New Items Item Management Producer Switch item activation Upload for Search Figure 10 - Use Case-Item Management Diagram 3.2.2.8.2 Use Case-Create New Items Specification USE CASE-Create New Items Specification Use-case No. UC801 Use-case Name Create New Items Author NhatPG Date 31/05/2012 Use-case Version Priority 1.0 High Actor: System Summary: This use case allows to create items Goal: 59
  60. 60. Add new product items and generate unique QR codes for them Triggers Request created by producer Preconditions: Service is running Post Conditions: Product items added and QR code generated Main Success Scenario: Step 1 Actor Action System Response Request is created 2 Add product items with unique QR codes. Alternative Scenario: N/A Exceptions: Step 1 Actor Action System Response Request is created 2 Creating failed Relationships: Create New Request use case Business Rules: None 3.2.2.8.3 Use Case-List all Items Specification USE CASE-List all Items SPECIFICATION Use-case No. UC802 Use-case Version 1.0 60
  61. 61. Use-case Name List all Items Specification Author NhatPG Date 31/05/2012 Priority Normal Actor: Producer Summary: This use case allows producer to view all items belong to a product on the system Goal: View the list of items of a product Triggers Click “View items” on Product List page Preconditions: User is logged into system successfully Post Conditions: List of items is shown screen Main Success Scenario: Step 1 Actor Action Click on “List of Items” in Product Detail page System Response Display the list of items Alternative Scenario: None Exceptions: None Relationships: List products use case Business Rules: 61
  62. 62. None 3.2.2.8.4 Use Case-Upload QR Codes for Search USE CASE-Upload QR Codes for Search SPECIFICATION Use-case No. UC803 Use-case Version Use-case Name Upload QR Codes for Search Author AnPH Date 31/05/2012 Priority 1.0 Normal Actor: Producer Summary: This use case allow producer to upload QR codes for search product items Goal: Search items based on QR code images Triggers Click “Upload for Search” on Item List page Preconditions: User is logged into system successfully Post Conditions: Found items displayed Main Success Scenario: Step Actor Action 1 Click “Upload for Search” on Item List page 2 Click “Upload” and select files or drag-and- System Response Upload file, display found items 62
  63. 63. drop files from Explorer for upload Alternative Scenario: Step Actor Action 1 Click “Upload for Search” on Item List page 2 Click “Upload” and select files or drag-anddrop files from Explorer for upload System Response Upload failed, or QR codes not found Exceptions: None Relationships: List items use case Business Rules: None 3.2.2.8.5 Use Case-Switch Activation of Items Specification USE CASE-Remove Items SPECIFICATION Use-case No. UC804 Use-case Name Remove Items Author NhatPG Date 31/05/2012 Use-case Version Priority 1.0 Normal Actor: Producer Summary: This use case allow producer to activate/deactivate items on the system Goal: 63
  64. 64. Activate/Deactivate items from the system Triggers Select items on the list of Items and click Activate/Deactivate Preconditions: User is logged into system successfully Post Conditions: Item status toggled and Item List refreshed Main Success Scenario: Step 1 2 Actor Action System Response Click on “Activate”/”Deactivate” in Items List page A confirmation dialog appears Click “Yes” Close the message box and refresh the item list with the status toggled Alternative Scenario: Step Actor Action System Response 1 Click on “Activate”/”Deactivate” in Items list page A confirmation dialog appears 2 Click “No” Nothing changes Exceptions: None Relationships: List all Items use case Business Rules: None 64
  65. 65. 3.2.2.9 Item Checking 3.2.2.9.1 Use Case-Item Checking Diagram QR4AC Check Item Consumer Figure 11 - Use Case-Item Checking Diagram 3.2.2.9.2 Use Case- Check Item Specification USE CASE – Check Item SPECIFICATION Use-case No. UC901 Use-case Name Check Item Author TrucLK Date 02/06/2012 Use-case Version Priority 1.0 High Actor: Consumer Summary: This use case allows a consumer to check the item he or she interests via QR code when using a smartphone with an application helping read QR code Goal: Check the item whether it is reliable or not Triggers Consumer visit website by unique URL of item 65
  66. 66. Preconditions: Consumer has a smartphone with an application helping read QR code. Consumer uses software to read the QR code and using browser to open URL Post Conditions: System redirects consumer to the page that shows detail about the item Main Success Scenario: Step Actor Action System Response 1 Consumer visits webpage from correct URL System display number of checking and reliability, system ask customer for rating 2 Consumer rates and comment of product System displays thank message Alternative Scenario: Step 1 2 Actor Action System Response Consumer visits webpage from incorrect URL or deprecated item. System alerts consumer about fake product and asks for store information Consumer provides information about this store. System displays thank message Exception: N/A Relationships: N/A Business Rules: When facing that kind of problem, consumer needs to contact with the seller to get the support. The distributor also needs to contact us for the cause and the solution. 66
  67. 67. 3.2.2.10 Product Rating 3.2.2.10.1 Use Case-Product Rating Diagram QR4AC Rate Product Consumer Figure 12 - Use Case-Product Rating Diagram 3.2.2.10.2 Use Case-Rate a Product Specification USE CASE – Rating product SPECIFICATION Use-case No. UC1001 Use-case Name Rate a Product Author TrucLK Date 02/06/2012 Use-case Version Priority 1.0 Low Actor: Consumer Summary: This use case allows the consumer to express his/her opinion about the product he/she has interest in Goal: Rate a product Triggers Consumer has checked item via QR code 67
  68. 68. Preconditions: N/A Post Conditions: System redirects consumer to the page that shows the result Main Success Scenario: Step 1 Actor Action Click “Rating this product” button 2 Click “Submit” button Redirect to the page containing information for assessing Choose how many star and Add comment (under 1000 characters) 3 System Response Redirect to the result page Alternative Scenario: Step 1 Actor Action Click “Rating this product” button 2 Click “Back to List” button Redirect to the page containing information for assessing Choose how many star and Add comment (under 1000 characters) 3 System Response Redirect to the previous page Exceptions: Step 1 Actor Action Click “Rating this product” button 2 Click “Submit” button Redirect to the page containing information for assessing Choose how many star and Add comment (above 1000 characters) 3 System Response Error message appears Relationships: Check Item use case 68
  69. 69. Business Rules: None 3.2.2.11 Consumer Check Statistic 3.2.2.11.1 Use Case- Consumer Check Statistic Diagram QR4AC View charts Administrator Producer View logs Figure 13 - Use Case- Consumer Check Statistic Diagram 3.2.2.11.2 Use Case-View Chart Specification USE CASE-View Chart SPECIFICATION Use-case No. UC1101 Use-case Name View Chart Author TrucLK Date 01/06/2012 Use-case Version Priority 1.0 High Actor: Administrator Producer Summary: This use case allow administrator or producer to view statistic of product item checking in charts Goal: 69
  70. 70. View statistic of product checking by consumer Triggers Click “View Chart” on Sidebar Preconditions: User is logged into the system successfully Post Conditions: Chart displayed Main Success Scenario: Step 1 Actor Action Click on “View Chart” on Sidebar System Response Redirect to View Chart page Alternative Scenario: N/A Exceptions: N/A Relationships: Log in use case Business Rules: None 3.2.2.11.3 Use Case-View Logs Specification USE CASE-View Logs SPECIFICATION Use-case No. UC1102 Use-case Name View Logs Author Use-case Version 1.0 TrucLK 70
  71. 71. Date 01/06/2012 Priority High Actor: Administrator Producer Summary: This use case allow administrator or producer to view all item checking log of consumers Goal: View checking logs of consumers Triggers Click “View logs” on the Item List Preconditions: User is logged into the system successfully Post Conditions: List of Checking Logs displayed Main Success Scenario: Step 1 Actor Action Click on “View logs” on the Item List System Response Redirect to View Logs page Alternative Scenario: N/A Exceptions: N/A Relationships: Log in use case Business Rules: None 71
  72. 72. 3.2.2.11.4 Use Case-Export to Excel Specification USE CASE-Export to Excel SPECIFICATION Use-case No. UC1103 Use-case Name Export to Excel Author NhatPG Date 01/06/2012 Use-case Version Priority 1.0 Low Actor: Producer Summary: This use case allow producer to export checking logs to Excel file Goal: Export checking logs to Excel Triggers Click “Excel” icon on View Logs page Preconditions: User is logged into the system successfully Post Conditions: Excel file downloaded Main Success Scenario: Step Actor Action 1 Click on “Excel” icon on View Logs page System Response Download Excel file to computer Alternative Scenario: N/A Exceptions: 72
  73. 73. N/A Relationships: Log in use case Business Rules: None 3.2.2.12 Logging 3.2.2.12.1 Use Case-Logging Check Statistic Diagram QR4AC Logging Administrator Producer Figure 14 - Use Case-Logging Check Statistic Diagram 3.2.2.12.2 Use Case-Logging Check Statistic Specification USE CASE-Logging SPECIFICATION Use-case No. UC1201 Use-case Name Logging Author TrucLK Date 03/06/2012 Use-case Version Priority 1.0 Normal Actor: System Summary: 73
  74. 74. This use case is used for logging all logged-in user (administrator, producer) actions on system for audit purpose Goal: Log user actions for audit purpose Triggers User do any action on the system Preconditions: User is logged into the system successfully Post Conditions: Action logged Main Success Scenario: Step 1 Actor Action User do any action on the system System Response Action logged Alternative Scenario: N/A Exceptions: N/A Relationships: N/A Business Rules: None 3.2.2.13 Software System Attributes 3.2.2.13.1 Reliability The system should not crash because of any actions on the website, includes generating QR codes for product items. The database should be backed up regularly and can be recovered if necessary. Mean Time Between Failures (MTBF): The acceptable failure is once a year. The failure should not be because of database or data loss. 74
  75. 75. Mean Time To Repair (MTTR): It should take immediately when admin finds out problem or someone attacks website. The acceptable mean time for a particular failure must be least than 24 hours. Maximum Bugs or Defect Rate: 5 bugs / KLOC. 3.2.2.13.2 Availability The system should be available at all times, meaning the user can access it using a web browser, only restricted by the down time of the server on which the system runs. The acceptable time for maintenance or backup should not more than 2 hours per week. When the system goes in undermaintenance, the website should display a message to inform that. In case of a hardware failure or database corruption, a backup version of the database should be retrieved from the server and saved by administrator, after that the service would be restarted. 3.2.2.13.3 Security Passwords of producer account would be stored encrypted in the database in order to ensure the user's privacy. All producer actions would be logged for audit. Sensitive data would be encrypted before being sent over insecure connections like the internet. Data integrity would be checked for critical variables. 3.2.2.13.4 Maintainability We could build a backup database for database maintenance and an application server for taking care of the site. In case of a failure, we could a re-initialize the system. In addition, the software designs using MVC modularity in mind so that it would be efficient for maintenance. 3.2.2.13.5 Portability The application is Microsoft .NET based and should be compatible with all other systems that have .NET framework. The end-user part is fully portable and any system using any web browser should be able to use the features of the application, including any hardware platform that is available or will be available in the future . So producer could use with any desktop web browser. Consumer could be used with any device that support reading QR code and can access internet with URL from QR code 3.2.2.13.6 Performance Average response time for a checking is 500milliseconds, and the maximum is 4 seconds. A checking involves sending one request or receiving one response. Throughput – an average of 20 requests per second Capacity – the system can communicate with 100 consumers’ mobiles at the same time. The system could server for 10.000.000 consumer, 1000 producers with 20000 products and 200.000.000 items. Degradation mode - If the system is degraded when we exceed 1000 consumers, we will remain in the normal mode of operation with longer response time. We can scale the system with more servers from Amazon cloud system 75
  76. 76. 3.3 Entity Relationship Diagram This diagram describes all the entities in the system. Figure 15 - Entity Relationship Diagram 76
  77. 77. 4 Software Design Description 4.1 Design Overview This document describes the technical and UI design of our system. It includes the architectural design and the detailed design of common functions and business functions. It also includes the design of database model, and overall design of user interface. The architectural design describes the overall architecture of the system. It will describe the patterns being used, the role of each component in the working environment. The detailed design describes static and dynamic structure for each component and function. It includes class diagrams, class explanations, and sequence diagrams of the main use cases. The detailed design uses notations of .NET framework 4.0 and C# 4.0, as they are the framework and language for developing the system. The database design describes the relationship between entities, and details of each entity. It uses notations of SQL Server 2008 as it is the database server for developing the system. The user interface design describes the layout of the system, and some design for the screens. 77
  78. 78. 4.2 System Architectural Design 4.2.1 Choice of System Architecture Figure 16 - System Architecture We use ASP.NET MVC 3, which is a framework for building scalable, standards-based web applications using well-established design patterns and the power of ASP.NET and the .NET Framework. MVC stands for model-view-controller. MVC is a pattern for developing applications that are well architected and easy to maintain. MVC-based applications contain:    Views are template files that your application uses for dynamically generating HTML responses. Models are classes that represent the data of the application and that use validation logic to enforce business rules for that data. Controllers are classes that handle incoming requests to the application, retrieve model data, and then specify view templates that return a response to the client. 4.2.2 Discussion of Alternative Designs At first glance, the three tiers may seem similar to the model-view-controller (MVC) concept; however, topologically they are different. A fundamental rule in three-tier architecture is the client tier never communicates directly with the data tier; in a three-tier model, all communication must pass through the middle tier. Conceptually the three-tier architecture is linear. However, the MVC architecture is triangular: the view sends updates to the controller, the controller updates the model, and the view gets updated directly from the model. 78
  79. 79. 4.3 Component Diagram Figure 17 - Component Diagram 79
  80. 80. 4.4 Detailed Description of Components 4.4.1 CRC Cards (Class-Responsibility-Collaborators) Figure 18 - Model Classes 80
  81. 81. Figure 19 - Controller Classes 81
  82. 82. 4.4.1.1 Common 1.1.1.1.1 HomeController Figure 20 - Controller & View for Home Methods public ActionResult Index (string searchString) Show content of home page public ActionResult About ( ) Show contact information 1.1.1.1.2 ImagesMerging Figure 21 - Methods in ImagesMerging class Methods public static Bitmap MergeImages (byte[] QRCode, Image ProducerLogo) Merge producer logo to QR code image public static string ResizeImage(Image pic, int size) Resize picture 82
  83. 83. 1.1.1.1.3 QR4ACDbContext Figure 22 - Database Context for model classes Properties DbSet<AccountProfile AccountProfiles > DbSet<Category> Categories [get, set] Represent AccountProfiles table Represent Categories table DbSet<Producer> Producers [get, set] Represent Producers table DbSet< Product > Products [get, set] Represent Products table DbSet< Items > Items [get, set] DbSet< Consumer > Consumers [get, set] DbSet< Rating > Ratings [get, set] DbSet<CheckingLog> CheckingLogs [get, set] DbSet<AccountProfile AccountProfiles [get, set] > DbSet<InfoTemplate> InfoTemplates [get, set] DbSet<Request> Requests [get, set] Represent Items table Represent Consumers table Represent Ratings table Represent CheckingLogs table Represent AccountProfiles table Represent InfoTemplates table Represent Requests table 83
  84. 84. 1.1.1.1.4 HashUtility Figure 23 - Methods in HashUtility class Methods public static string DecryptString (string Message, string Passphrase) Decrypt encoded string public static string EncryptString(string Message, string Passphrase) Decrypt encoded message string with password using MD5 and byte64 1.1.1.1.5 QRUtilities Figure 24 - Methods in QRUtilities class Methods public static byte[] QREncode (string encodedString, int size) Encode string to QR code image public static string QRDecode(Bitmap QRImage) Decode QR code image to string 84
  85. 85. 4.4.1.2 Account Figure 25 - Model-View-Controller for Account 1.1.1.1.6 RegisterModel Properties string Username [get, set] User name to register string Password [get, set] Password to register string ConfirmPassword [get, set] Confirm password to register string Email [get, set] Email to register 1.1.1.1.7 LogonModel Properties string Username [get, set] User name to log on string Password [get, set] Password to log on bool RememberMe [get, set] Remember me when forgetting 85
  86. 86. password 1.1.1.1.8 ChangePasswordModel Properties string OldPassword [get, set] Current password string Password [get, set] New password to change string ConfirmPassword [get, set] Confirm new password to change 1.1.1.1.9 AccountController Properties QR4ACDbContext db [get, set] Object used to query or update data from database Methods public ActionResult LogOn(LogOnModel model, string returnUrl) Allows user to login to system public ActionResult LogOff ( ) Allows user to logout from system public ActionResult Create(RegisterModel model) Allows administrator to create new account public ActionResult ChangePassword (ChangePasswordModel model) Allows user to change their password 86
  87. 87. 4.4.1.3 Producer Figure 26 - Model-View-Controller for Producer 1.1.1.1.10 Producer Properties int ProducerId [get, set] ID of producer string ProducerName [get, set] Name of producer string Description [get, set] Description of producer string Logo [get, set] URL of producer’s logo string Address [get, set] Address of producer String ContactPerson [get, set] Contact person information String Email [get, set] Email of producer Bool IsActive [get, set] String PhoneNumber [get, set] Status of producer Phone number of producer 87
  88. 88. 1.1.1.1.11 ProducerController Properties QR4ACDbContext db [get, set] Object used to query or update data from database Methods public ActionResult Create () Display a form for adding a producer public ActionResult Create (Producer producer) Add a producer to database public ActionResult SwitchActivation (int id) Switch activation of producer based on ProducerId public ActionResult Edit (int id) Display a form for editting a producer based on ProducerId public ActionResult Edit (Producer producer) Save changing of producer’s information to database public ActionResult Index () Display all producers public ActionResult Search (string searchText) Display list of producers that meet the search condition 88
  89. 89. 4.4.1.4 Product Figure 27 - Model-View-Controller for Product 1.1.1.1.12 Product Properties int ProductId [get, set] ID of product string Name [get, set] Name of product string Info [get, set] Description of product int ProducerId [get, set] ID of producer int TotalItems [get, set] Total product items bool IsActive [get, set] Whether product is active or not int CategoryId [get, set] Id of product’s category int InfoTemplateId [get, set] Id of product’s InfoTemplate 89
  90. 90. string Logo [get, set] Path of product’s logo 1.1.1.1.13 ProductController Methods public ActionResult Create () Display a form for adding a product public ActionResult Create (Product product) Add a product to database public ActionResult Details (int id) View details of product based on Product ID public ActionResult Edit (int id) Display a form for editing a product based on Product ID public ActionResult Edit (Product product) Save changing of product’s information to database public ActionResult Index() Display list of products that meet the search condition public ViewResult List(string sortOrder, string currentFilter, string searchString, int? page, int CategoryId) public JsonResult Display list of products to customer GetDetails(int id) Get product details public ActionResult SwitchActivation (int id) Switch activation of product based on Product ID public ActionResult Search (SearchProductModel searchModel, bool orderToggle) Display list of products that meet the search condition 90
  91. 91. 4.4.1.5 Item Figure 28 - Model-View-Controller for Item 1.1.1.1.14 Item Properties int ItemId [get, set] DateTime IssueDate [get, set] string QrCodeStr [get, set] ID of item Created date Description of product int TotalChecks [get, set] Total checking of item int ProductId [get, set] ID of product bool IsActive get, set] Whether item is active or not int Reliability Item reliability int RequestId ID of item’s creating request 91
  92. 92. Methods public int GetId (string file) Get Item ID from QR Code Image public JsonResult GetQRCode (Product product) Add a product to database public ActionResult Index (int? id) View list of items (or one item based on id) public ActionResult Search (SearchItemModel searchModel, string OrderBy, string idString, int? productId, bool orderToggle = false) Display list of items that meet the search condition public ActionResult SwitchActivation (id) Switch activation of item based on Item ID public ActionResult UploadQRCode() Return Upload QR Code view public ActionResult ViewProductItems (int productId) Show list of items based on Product ID 4.4.1.6 Checking Figure 29 - Model-View-Controller for Checking Logs 1.1.1.1.15 CheckingLogs Properties 92
  93. 93. int CheckingId [get, set] string ConsumerId [get, set] DateTime CheckingDate [get, set] int ItemId [get, set] string Location [get, set] ID of checking ID of consumer Date of checking ID of Item Location of checking int ProducerId [get, set] Producer ID int ProductId [get, set] Product ID 1.1.1.1.16 CheckingController Methods public ActionResult Details() Add checking log to database public ActionResult ProductFromProducer (int id) Get list of related products by producer id public ActionResult RelatedProduct(int id) Get list of related products by product id public JsonResult SaveUserLocation(int CheckId, string location) Update user location to checking log public ViewResult Validate(string s) Validate product item public ViewResult ViewProduct(int id) View product info based on product id 93
  94. 94. 4.4.1.7 Rating Figure 30 - Model-View-Controller for Rating 1.1.1.1.17 Rating Properties int RatingId [get, set] ID of rating int ProductId [get, set] ID of product DateTime RatingDate [get, set] int StarNo [get, set] string Comment [get, set] Date of rating Number of star user rated Comment of consumer 1.1.1.1.18 RatingController Methods public ActionResult Create(int ProductId) Display a form for rating the checked product public ActionResult Create(Rating rating) Rate product 94
  95. 95. public JsonResult RateProduct(string productId, string rating) Rate product 4.4.1.8 Category Figure 31 - Model-View-Controller for Category 1.1.1.1.19 Category Properties int CategoryId [get, set] string Name [get, set] ID of category Name of category 1.1.1.1.20 CategoryController Methods public ActionResult Create() Display a form for creating category public ActionResult Create(Category category) Insert category to database public ActionResult Edit(int id) Show updating category form based on category Id public ActionResult Edit(Category category) Update category public ActionResult Delete(int id) Delete category based on category id 95
  96. 96. public ActionResult Search(string searchText) Search category based on search text public ActionResult Index() List all categories 4.4.1.9 InfoTemplate Figure 32 - Model-View-Controller for InfoTemplate 1.1.1.1.21 InfoTemplate Properties int InfoTemplateId [get, set] string Name [get, set] int ProducerId [get, set] string Template [get, set] ID of template Name of template Producer ID Template content 1.1.1.1.22 InfoTempolateController Methods public ActionResult Create() Display a form for creating template 96
  97. 97. public ActionResult Create(InfoTemplate template) Insert template to database public ActionResult Edit(int id) Show updating template form based on template Id public ActionResult Edit(InfoTemplate template) Update template public ActionResult Delete(int id) Delete template based on template id public ActionResult Search(string searchText) Search template based on search text public ActionResult Index() List all templates public ActionResult GetInfo(int id) Get template info based on template ID 4.4.1.10 Request Figure 33 - Model-View-Controller for Request 1.1.1.1.23 Request Properties 97
  98. 98. int RequestId [get, set] DateTime CreatedDate [get, set] ID of request Request’s created time int ProducerId [get, set] Producer ID int ProductId [get, set] Product ID int QRCodeSize [get, set] Size of QR Code image string QRPackage [get, set] File name of generated QR package int Quantity [get, set] Quantity of QR Code images in package int Status [get, set] Status of request string UserName [get, set] Created by 1.1.1.1.24 RequestController Methods public ActionResult Create(int productId) Display a form for QR Code package creating request public ActionResult Create(Request request) Insert request to database public JsonResult Activation(int id) Activate all item in package public JsonResult Deactivation(int id) Deactivate all item in package public ActionResult Download(string filename) Download QR Code package public ActionResult Search(string searchText) Search request based on search text public ActionResult Index() List all request public JsonResult GetQRPackage (int id) Get QRPackage name based on request ID 98
  99. 99. 4.4.1.11 Statistic Figure 34 - Model-View-Controller for CheckingLogs 1.1.1.1.25 CheckingLogs Properties int CheckingId [get, set] DateTime CheckingDate [get, set] ID of checking Item’s checked time int ConsumerId [get, set] The ID identify consumer int ProductId [get, set] Product ID int ProducerId [get, set] Producer ID string ItemId [get, set] Item ID string Location [get, set] The string identify customer’s location 99
  100. 100. 1.1.1.1.26 StatisticController Methods public ActionResult ExportToExcel() Export checking logs to excel file public JsonResult GetDailyReportByItems(string from, string to) Get report data for daily items checking public JsonResult GetDailyReportByProducts(string from, string to) Get report data for daily products checking public JsonResult GetMonthlyReportByItems(string from, string to) Get report data for monthly items checking public JsonResult GetMonthlyReportByProducts(string from, string to) Get report data for monthly products checking public JsonResult GetYearlyReportByItems(string from, string to) Get report data for yearly items checking public JsonResult GetyearlyReportByProducts(string from, string to) Get report data for yearly products checking public ActionResult Search(string searchText) Search checking logs based on search text public ViewResult Index() View statistic chart public ViewResult ViewLogs() List all checking logs public ViewResult ViewItemCheckingLogs(int itemId) List all item checking logs based on item ID 100
  101. 101. 4.4.2 Encryption algorithm We can protect the QR code using a hash string in the URL as security checking string. The hash string would be generated by item ID. We use MD5 as cryptographic hash function, the digest size will be small enough to store in the URL. 4.5 Sequence Diagram 4.5.1 Login Figure 35 - Login sequence diagram 4.5.2 Template Management 4.5.2.1 List all Templates Figure 36 - List all Templates sequence diagram 101
  102. 102. 4.5.2.2 Add new Template Figure 37 - Add new Template sequence diagram 4.5.3 Producers Management 4.5.3.1 List all Producers Figure 38 - List all Producers sequence diagram 102
  103. 103. 4.5.3.2 Add New Producer Figure 39 - Add new Producer sequence diagram 4.5.3.3 Update Producer Information Figure 40 - Update Producer Information sequence diagram 103
  104. 104. 4.5.3.4 Switch Producer Activation Figure 41 - Switch Producer Activation sequence diagram 4.5.4 Product Categories Management 4.5.4.1 List all Categories Figure 42 - List all Categories sequence diagram 104
  105. 105. 4.5.4.2 Add new Category Figure 43 - Add new Category sequence diagram 4.5.4.3 Update Category Figure 44 - Update Category sequence diagram 105
  106. 106. 4.5.4.4 Delete Category Figure 45 - Delete Category sequence diagram 4.5.5 Products Management 4.5.5.1 List all Products Figure 46 - List all Products sequence diagram 106
  107. 107. 4.5.5.2 Add New Product Figure 47 - Add New Product sequence diagram 4.5.5.3 View Product Details Figure 48 - View Product Details sequence diagram 107
  108. 108. 4.5.5.4 Update Product Information Figure 49 - Update Product Information sequence diagram 108
  109. 109. 4.5.6 Request management 4.5.6.1 Create request for creating QR Code package Figure 50 Create request for creating QR Code package sequence diagram 4.5.6.2 Process QR Code package creating request Figure 51 - Process QR Code package creating request sequence diagram 109
  110. 110. 4.5.6.3 List all Requests Figure 52 - List all Requests sequence diagram 4.5.6.4 Download QR Code package Figure 53 - Download QR Code package sequence diagram 110
  111. 111. 4.5.7 Items Management 4.5.7.1 List all Items Figure 54 - List all Items sequence diagram 4.5.7.2 Switch item’s activation Figure 55 - Switch item’s activation sequence diagram 111
  112. 112. 4.5.7.3 Product Checking Figure 56 - Product Checking sequence diagram 4.5.8 Statistic 4.5.8.1 View statistic by chart Figure 57 - View statistic by chart sequence diagram 112
  113. 113. 4.5.8.2 View checking log Figure 58 - View checking log sequence diagram 113
  114. 114. 4.6 User Interface Design 4.6.1 Description of the User Interface 4.6.1.1 Screen Images 1.1.1.1.27 Login Figure 59 - Login UI 1.1.1.1.28 Change Password Figure 60 - Change password 114
  115. 115. 1.1.1.1.29 Update profile Figure 61 - Update profile 115
  116. 116. 1.1.1.1.30 Change password Figure 62 - Change password 1.1.1.1.31 List all Producers Figure 63 - List all producers UI 116
  117. 117. 1.1.1.1.32 Add New Producer Figure 64 - Add new producer UI 117
  118. 118. 1.1.1.1.33 Update Producer Figure 65 - Update producer UI 118
  119. 119. Figure 66 - Producer's account management 1.1.1.1.34 List all Categories Figure 67 - List all Categories 119
  120. 120. 1.1.1.1.35 Create new Category Figure 68 - Create new Category 1.1.1.1.36 Update Category Figure 69 - Update Category 1.1.1.1.37 List all Information Template Figure 70 - List all Information Template 120
  121. 121. 1.1.1.1.38 Add new Information Template Figure 71 - Add new Information Template 121
  122. 122. 1.1.1.1.39 List all Products Figure 72 - List all products UI 1.1.1.1.40 Create items and QR Code images package Figure 73 - Create items and QR Code images package 122
  123. 123. 1.1.1.1.41 Add New Products Figure 74 - Add new products UI 123
  124. 124. 1.1.1.1.42 Update Product Figure 75 - Update product UI 1.1.1.1.43 List all Product (Customer’s perspective) 124
  125. 125. 1.1.1.1.44 Figure 76 - List all Products 1.1.1.1.45 List all request 125
  126. 126. Figure 77 - List all Request 1.1.1.1.46 View Statistic Figure 78 - View statistic 126
  127. 127. 1.1.1.1.47 View Checking Logs Figure 79 - View logging 127
  128. 128. 4.8 Database Design i Figure 80 - Database design 4.8.1 Producers Name Type ProducerId int (identity) ProducerName nvarchar(100) Description nvarchar (500) Logo nvarchar (200) IsActive Bit Allow Nulls   Description ID of producer Name of producer Description of producer URL of logo of producer Whether producer is active or not 128

×