Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

SRS Team7 v5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Software Requirements

Specification
for

Document Sharing Website


Prepared by Aarushi Mathur, Shreeyans, Apurv Jain & Varun

Manipal University, Jaipur

02/28/2022

Copyright © 1999 by Karl E. Wiegers. Permission is granted to use, modify, and distribute this document.
Software Requirements Specification for Document Sharing Website Page 2

Table of Contents
Table of Contents ii
Revision History iii
1. Introduction 1
1.1 Purpose 1
1.2 Intended Audience and Reading Suggestions 1
1.3 Product Scope 1
1.4 References 1
2. Overall Description 1
2.1 Product Perspective 1
2.2 Product Functions 1
2.3 User Classes and Characteristics 2
2.4 Operating Environment 2
2.5 Design and Implementation Constraints 2
2.6 Assumptions and Dependencies 2
3. External Interface Requirements 3
3.1 User Interfaces 3
3.2 Hardware Interfaces 3
3.3 Software Interfaces 3
4. System Features 3
4.1 Uploading Files 3
4.2 Downloading Files 4
5. Other Nonfunctional Requirements 5
5.1 Performance Requirements 5
5.2 Safety Requirements 5
5.3 Security Requirements 5
5.4 Software Quality Attributes 5
Appendix A: Glossary 5
Appendix B: Analysis Models 6
Appendix C: Estimation 14
Appendix D: Testing 17
Appendix E: Snapshots 23
Appendix F: Code 25
Software Requirements Specification for Document Sharing Website Page 3

Revision History
Name Date Reason For Changes Version
Version 1 28.2.2022 The first implementation 1
Version 2 21.3.2022 Added DFD0 and Use Case 2
Diagrams
Version 3 30.3.2022 Added Class Diagram and updated 3
Design and Implementation
Constraints
Version 4 09.05.2022 Added Remaining UML Diagrams 4
Version 5 20.05.2022 Added Testing, Snapshots and Code 5
Software Requirements Specification for Document Sharing Website Page 1

1. Introduction
1.1 Purpose
The Document Sharing System is an online platform which helps users to upload and
download documents. It is a user-friendly system which can be handled and
understood easily by people of all age groups. It works on a many-to-many relationship
basis.

A website for viewing and sharing documents with others in a fast and easy way.

1.2 Intended Audience and Reading Suggestions


The document is intended for students, faculty members, entrepreneurs, i.e. all types of
users.

1.3 Product Scope


The aim of this portal is to help the user to easily upload, access and review files.

1.4 References
● React - A JavaScript library for building user interfaces
● Supabase - Backend Service Provider (open-source alternative to Firebase)
● Chakra UI - UI and component library for React

2. Overall Description
2.1 Product Perspective
This project uses Supabase - a Backend Service Provider to manage Authentication and
Storage which is fast, reliable and scalable to build a robust backend for the purpose of
sharing and viewing documents and files.

2.2 Product Functions


For Unregistered Users, they can perform the following functions:
● View Documents: View the document is the browser if the document viewer
supports the format of the file.
● Download Document: Download the file as long as the uploader has allowed it.
Software Requirements Specification for Document Sharing Website Page 2

For Registered Users, they can perform all the functions of the Unregistered Users as
well as:
● Upload Documents: Upload documents as long as the file type, file size and file
limit constraints are satisfied.
● Delete Documents: Delete their uploaded documents.
● Manage Documents: Manage the visibility of the documents or lock it with a
password.

2.3 User Classes and Characteristics


● Uploader: Uploaders for this website are users who are required to create an
account. They can then upload documents and make them public so that the
documents can be shared.
● Downloader: Downloaders for this website are users who are not required to
create an account. If they have the file link they can access the file. They are able
to view and download the file.

2.4 Operating Environment


The project is in the form of a website so most popular browsers like Google Chrome,
Mozilla
Firefox and Apple Safari are supported and it should also work on other compatible
browsers. Website is responsive so it supports all screen sizes.

2.5 Design and Implementation Constraints


● Major functionality is dependent on Supabase’s API. Any major modifications may
require deviation from the provided JS library and use of custom API implemented
with Supabase’s more flexible RESTful API.
● Preview document functionality depends on a 3rd party JS library and may not
support obscure file types.

2.6 Assumptions and Dependencies


• If there are some issues with the backend provider the user will not be able to access
the website for the period of downtime.
• Changes in the APIs may lead to unexpected behavior on the website.
• Some features may be deprecated in the future from the libraries used in the making
of the website and may need to be maintained.
Software Requirements Specification for Document Sharing Website Page 3

3. External Interface Requirements


3.1 User Interfaces
The project comprises of the following webpages:
● Login/SignUp Page: Simple welcome page which allows users to Login or SignUp
for the website.
● Home Page: Allows a logged in user a List of uploaded documents and a
quick-access list to view recently accessed documents.
● Upload Window: Allows a logged in user to browser for a file, set a passcode if
needed and upload it.
● Download Page: On entering the file’s sharing URL and entering the passcode,
anyone can access the file to download and preview it.

3.2 Hardware Interfaces


The only hardware requirement is that the device should be able to run a supported
browser.

3.3 Software Interfaces


The UI Component Library called ChakraUI is used for making this website. This allows
us to use premade UI components while allowing us to customize them easily and
reducing time which would be spent on writing code for styling the components.

Supabase a Backend Provider provides the website with services such as


Authorization, Database and Storage. The supabase package is installed from
npmjs.com and provides us with Session Handling and Object with methods for api calls
to the above mentioned services.

4. System Features
4.1 Uploading Files
4.1.1 Description and Priority
The user should be able to upload any file of the supported format to the website.
The file then can be managed by the user to manage it (i.e. make it public,
lock file with password, etc.). Although, the user can only upload a limited
amount of files and there is a maximum file size limit.
Software Requirements Specification for Document Sharing Website Page 4

These constraints are present to decrease load in the backend. Also to increase
security, the user can set a password which is needed by everyone who
needs access.
Priority: Critical

4.1.2 Stimulus/Response Sequences


The user can press the button on the homepage to open the file upload dialog.
The user can then select a single file and upload it. If successful the file is
then shown on the homepage with a list of other uploaded files.
4.1.3 Functional Requirements
REQ-1: Authentication for User
REQ-2: Database to store file details
REQ-3: Storage to store the files
REQ-4: Form for user to submit file/details

4.2 Downloading Files


4.1.1 Description and Priority
Any user is able to access the file via the link if the uploader has allowed it. They
can download the file and also preview it if the file format is supported by
the viewer. The User may need to input a password if the file is protected by
the uploader.
Priority: Critical
4.1.2 Stimulus/Response Sequences
The user can access the webpage by opening the received link. User may need to
input a password if asked. The User can preview and download the file by
pressing the respectively named buttons.
4.1.3 Functional Requirements
REQ-1: Database to retrieve file details
REQ-2: Storage to retrieve the files
REQ-3: Form for user to submit password if needed
Software Requirements Specification for Document Sharing Website Page 5

5. Other Nonfunctional Requirements


5.1 Performance Requirements
● The Browser should have support for advanced Javascript.
● The data fetched from the database should be able to be stored in buffers.

5.2 Safety Requirements


● Some content hosted on the website may not be appropriate for all individuals.

5.3 Security Requirements


● Supabase’s own Email authentication is used for this website. The data passed
and stored is encrypted.
● It is not advised to upload highly sensitive documents to the website as there is a
very small chance of unwanted access.

5.4 Software Quality Attributes


The website is planned to have a beautiful user interface and great user experience for
all types of devices.

Appendix A: Glossary
● API (Application Programming Interface): A software intermediary that allows two
applications to talk to each other. Eg: Website and Database
● Backend Service Provider: Backend-as-a-Service Providers help provide web and
mobile app developers with pre-written software. BaaS vendors offer automation
for backend applications and integrate them with cloud services.
● Libraries: These are collections of prewritten code snippets that can be used and
reused to perform common functions.This leads to faster development and fewer
vulnerabilities to have errors.
Software Requirements Specification for Document Sharing Website Page 6

Appendix B: Analysis Models


Data Flow Diagrams

Figure 1: Level 0 DFD

Figure 2: Level 1 DFD


For the uploader:
● File to be uploaded and its metadata is sent to the website.
● Email and Password is sent to the website for Login.
● The Download Link for the uploaded file is received in return.

For the downloader:


● The Downloader sends the Document Link and the Passcode for the file.
● In return, the Downloader gets the File and its metadata.
Software Requirements Specification for Document Sharing Website Page 7

Use Case Diagram

Figure 3: Use Case Diagram

The Uploader can use the website for:


1. Creating an account to use the website.
2. Uploading a document.
3. Managing the document which includes downloading and/or previewing it.
4. Sharing the document indirectly via a document link.

The Downloader can use the website for:


1. Downloading a document.
2. Previewing a document.
Software Requirements Specification for Document Sharing Website Page 8

Class Diagram

Figure 4: Class Diagram

● The User class is a singleton class which is responsible for managing all functions
related to the authentication and session management of the user.
● The File class represents a file which has been uploaded to the system.
● The UserData class represents the Files uploaded by the user and contains the
free storage space remaining for the user.
● The Server class represents the Server which is responsible for actions pertaining
to Authentication, Database and Storage.
Software Requirements Specification for Document Sharing Website Page 9

Activity Diagram

Figure 5: Activity Diagram

The above diagram shows the message flow from one activity to another.
The process starts with the Login Activity and then allows the user to Upload a document if
there is sufficient storage space. If upload is successful the user is shown with a list of
uploaded documents they can access.
Software Requirements Specification for Document Sharing Website Page 10

State Diagram

Figure 6: State Diagram

Above diagram shows the states of the User Object reached by calling different functions.
On Logging in the system fetches the data of the user. The user can then Sign Out,
Download/Preview any of the uploaded files by selecting one or Upload a new File. If the
uploaded file is verified and successfully uploaded, the user requests the server again for the
updated user data and the newly uploaded file can be seen. The user can also download other
files by accessing the document link and entering the correct passcode.
Software Requirements Specification for Document Sharing Website Page 11

Communication Diagrams

Figure 7: Communication Diagram 1

Figure 8: Communication Diagram 2

The above diagram shows the flow of data from one class to another.
On logging in the User object gets instantiated with the user data fetched after authentication.
The User can then request the Server for its data which gets instantiated in the UserData
Object. The UserData Object contains a list of Files which have been uploaded. The User
object and access the File object in order to download or manage it. File object as a response
requests the server to carry out the actions.

The Downloader is not assigned a User but a File object gets instantiated on entering the
correct link and passcode. The File can then be accessed by the Downloader.
Software Requirements Specification for Document Sharing Website Page 12

Sequence Diagrams

Figure 9: Sequence Diagram 1

Figure 10: Sequence Diagram 2


Software Requirements Specification for Document Sharing Website Page 13

The above diagrams show the sequential flow of data between the Objects. The Website
comprises the Local classes in the system.

The Uploader follows the sequence of Logging in, Requesting Data, Uploading a File and
Accessing an uploaded File respectively
.
The Downloader requests for a File by providing necessary data and after getting a response
can access the File.

Software Architecture Diagram

Figure 11: Software Architecture Diagram

● User: Interacts with the website in order to carry out tasks.

● Website: Is a website made with React.js framework, coded using Javascript.


Communicates with the Server with the help of HTTPS requests in order to
request actions related to Authentication, Database and Storage.

● Supabse: It is a Backend as a Service Provider similar to Google’s Firebase.


Provides different modules for Authentication, a PostgreSQL Database and
Storage built on Amazon’s S3. Supabase provides a REST API to access all the
modules easily. Supabse has a feature called Row-Level Security which only
allows certain users to carry out certain actions on the Database Tables and
Storage. This eliminates the use of a Custom Web API Server in order to keep
the Backend Secure which leads to a 2-tiered architecture instead of a
3-tiered one.
Software Requirements Specification for Document Sharing Website Page 14

Appendix C: Estimation
Function Point & COCOMO
(Refer to Figure 1: Level 0 DFD)

1. Login

EI: 3DET, 1FTR -> Low(3)

ILF: 2DET, 1RET -> Low(7)

EO: < 20 DET, 1FTR -> Avg(5)

2. Change / Reset Password

EI: 3DET, 1FTR -> Low(3)

ILF: 2DET, 1RET -> Low(7)

3. Upload File

EI: 5DET, 2FTR -> Avg(4)

ILF: 6DET, 2RET -> Low(7)

4. Download File

EI: 2DET, 1FTR -> Low(3)

ILF: 2DET, 1RET -> Low(7)

EO: 5DET, 2FTR -> Low(4)


Software Requirements Specification for Document Sharing Website Page 15

General System Characteristic

Figure 12: General System Characteristics Table

Total = 19
TDI = 19
Software Requirements Specification for Document Sharing Website Page 16

VAF = 0.65 + ( 0.01 * TDI )


VAF = 0.65 + ( 0.01 * 24 )
VAF = 0.84
UFP = ∑EI + ∑EO + ∑EQ + ∑ILF + ∑EIF
= (3+3+4+3) + 5 + 0 + (7*4) + 0
UFP = 41
FP = UFP * VAF = 41 * 0.84
FP = 34.5 ~ 35

KLOC = FP x (LOC/FP for Javascript) / 1000


= 37 x 47 / 1000
KLOC = 1.645 => Organic

For Organic,
a = 2.4, b = 1.05, c= 2.5, d = 0.38

Effort = a x KLOC^b
= 2.4 x 1.739^1.05
Effort = 4.05 PM

Time = c x Effort^d
= 2.5 x 4.29^0.38
Time = 4.25 M

Persons Required = Effort / Time


= 4.29 / 4.35
Persons Required = 0.95
Software Requirements Specification for Document Sharing Website Page 17

Appendix D: Testing
Black Box Testing
1. Boundary Value Analysis

Our website has a limit of uploading files not more than 50MB i.e. 50000000 Bytes and the file
name should be of length [1, 50]

Test Case size filename.length() Output

1 25000000 1 Upload Successful

2 25000000 2 Upload Successful

3 25000000 25 Upload Successful

4 25000000 49 Upload Successful

5 25000000 50 Upload Successful

6 1 25 Upload Successful

7 2 25 Upload Successful

8 49000000 25 Upload Successful

9 50000000 25 Upload Successful

10 25000000 0 Invalid filename

11 25000000 51 Filename too long

12 0 25 Invalid size

13 50000001 25 File size too large


Software Requirements Specification for Document Sharing Website Page 18
2. Equivalence Class Testing

Based on Output Domain

Test Case size filename.length() Output

1 25000000 25 Upload Successful

2 25000000 0 Invalid filename

3 25000000 100 Filename too long

4 -10 25 Invalid size

5 90000000 25 File size too large

Based on Input Domain

Test Case size filename.length() Output

1 25000000 25 Upload Successful

2 0 25 Invalid size

3 90000000 25 File size too large

4 25000000 0 Invalid filename

6 25000000 51 Filename too long


Software Requirements Specification for Document Sharing Website Page 19
3. Decision Table Testing

CONDITIONS

C1: is filetype N Y
supported?

C2: is there space to _ N Y


upload?

C3: is filesize valid? _ _ Y Y N N

C4: is filename valid? _ _ Y N Y N

ACTIONS

A1: Upload File X

A2: Notify with NoSpace X


Error

A3: Notify with FileSize X X


Error

A4: Notify with FileName X


Error

A5: Notify with FileType X


Error

Test Case type space size filename Output


.length()

1 .exe 0 25000000 25 File not supported

2 .pdf 50000000 0 25 No storage space

3 .pdf 0 25000000 25 Upload Successful

4 .pdf 0 25000000 100 Invalid filename

5 .pdf 0 90000000 25 Invalid size

6 .pdf 0 90000000 100 Invalid size


Software Requirements Specification for Document Sharing Website Page 20
White Box Testing
Path Testing

insertUserFiles is a JavaScript function which takes input from an HTML Form and uploads a
file to storage and file details to the database.

Figure 13: insertUserFiles Function Code


Software Requirements Specification for Document Sharing Website Page 21

Figure 14: DD Graph for insertUserFiles Function

Cyclomatic Complexity
CC = No of Predicate Statements + 1 = 5 + 1 = 6

Independent Paths
1. A → B
2. A → C → D
3. A → C → E → F
4. A → C → E → G → H
5. A → C → E → G → I → J → K
6. A → C → E → G → I → J → L → M → N
Software Requirements Specification for Document Sharing Website Page 22

Test Cases

Path Input Output


No

1 storage = 50000000; error.message = “Storage


input.file.size = 2000000; Capacity Full”;
// each user can store upto 50MB total

2 input.file.size = 90000000; error.message = “Invalid


// max file size is 50MB File Size”;

3 input.file.size = 2000000; error.message = “File


input.file.name = Name too long”;
“this_is_a_test_filename_for_documents
haringwebsite.docx”;

4 input.file.size = 2000000; error.message = “Invalid


input.file.name = “”; File Name”;

5 input.file.size = 2000000; error = {code: 503,


input.file.name = “test.pdf”; message: “Service
storageResponse.error = {code: 503, Unavailable”}
message: “Service Unavailable”}
// if server is down

6 input.file.size = 2000000; data = {status:


“success”, url:
input.file.name = “test.pdf”; “docshr.app/download/n30n
49czyrg4ts”}
storageResponse.error = null;
Software Requirements Specification for Document Sharing Website Page 23

Appendix E: Snapshots

Figure 15: Login Page

Figure 16: Dashboard Page


Software Requirements Specification for Document Sharing Website Page 24

Figure 17: Download Figure 18: Preview File


Software Requirements Specification for Document Sharing Website Page 25

Appendix F: Code

Figure 19: Supabase Server Instantiation Code

Figure 20: Website HTML Layout in JSX Code


Software Requirements Specification for Document Sharing Website Page 26

Figure 21: Authentication Management Code


Software Requirements Specification for Document Sharing Website Page 27

Figure 22: Fetch User Data Code

Figure 23: Delete File Code


Software Requirements Specification for Document Sharing Website Page 28

Figure 24: Upload File Code

Figure 25: Change File Passcode Code

You might also like