You are on page 1of 19

Jeremiah McGrath

Project 02: Storefront Android Application


CST 338 - Fall 2022 - Term B

Android Application: Computer Keyboard


Storefront
This project is an android application utilizing Java. It is a storefront where users and admins can
interact with a database of in-stock items, specifically computer keyboards.
The storefront is selling computer keyboards.
The admin users can view and delete user accounts, as well as manage and edit the database of
in-stock items.

Table of contents
Database Diagram 3

Use Case 01: Predefined Users 4


PASS 4

Use Case 02: Persistence 5


PASS 5

Use Case 03: Add A User 6


PASS 6

Use Case 04: Delete A User 7


PASS 7

Use Case 05: Add An Item 7


PASS 8

Use Case 06: Modify An Item 9


PASS 9

Use Case 07: Delete An Item 10


PASS 10

Use Case 08: Search For An Item 11


PASS 11

Use Case 09: Search For A User 12


PASS 12

Use Case 10: List In-Stock Items 13


PASS 13

Use Case 11: List All Users 14


PASS 14

Use Case 12: Delete All In-Stock Items 15


PASS 15

Use Case 13: Delete All Users 16


PASS 16

Use Case 14: Display Order History 17


PASS 17

Use Case 15: Return Item 18


PASS 18

Use Case 16: Purchase In-Stock Item 19


PASS 19
Database Diagram
Use Case 01: Predefined Users

PASS

1. Force quit the application


2. Login as testuser1
3. Display the username 'testuser1'
4. Logout
5. Login as admin2
6. Display the username 'admin2'
7. Display the admin functions button

https://imgur.com/vQLlniZ
Use Case 02: Persistence

PASS

1. Add an item to the database


2. Force quit the application
3. Show the item added in step 1 is still in the database
4. Change an item in the database
5. Force quit the application
6. Show the item modifications from step 4 have been saved

https://imgur.com/GDYicIt
https://imgur.com/xk2StDn
Use Case 03: Add A User

PASS

Adds a user account to the application

Main: {Create account}

1. User clicks the ‘create account’ button


2. Application displays the create account screen
3. User types in the desired username
4. User types in the desired password
5. User clicks the ‘create account’ button
6. User is returned to the landing page
7. A toast message is displayed indicating the successful creation of an account
8. Use case ends (Pass)

Alternate: {Bad username}

● User enters a username that is already taken


● Starting at 3 from {create account}

3. User enters a username that is already in use


4. User clicks the ‘create account’ button
5. Application displays a message ‘Username is already in use’
6. Use case ends (Fail)

https://imgur.com/AsxQCsr
Use Case 04: Delete A User

PASS

Delete user is only possible when logged into an admin account, deletes user account from the
application

Main: {Delete user}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin’ button
4. Application displays the admin functions screen
5. User clicks the ‘delete user’ button
6. User types in username of account they wish to delete
7. A toast message is displayed indicating the successful deletion of an account
8. Use case ends (Pass)

Alternate: {Bad username}

● User enters a username that does not exist


● Starting at 6 from {delete user}

6. User enters a username that does not exist


7. User clicks the ‘delete user’ button
8. Application displays a message ‘Username does not exist’
9. Use case ends (Fail)

https://imgur.com/Gz5beFx
Use Case 05: Add An Item

PASS

Add item is only possible when logged into an admin account, adds an item to the application

Main: {Add item}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin functions’ button
4. Application displays the admin functions screen
5. User clicks the ‘add item’ button
6. Application displays the add item screen
7. User types in item name
8. User types in item description
9. User types in item price
10. User clicks the ‘add’ button
11. A toast message is displayed indicating the successful creation of an item
12. Use case ends (Pass)

Alternate: {Item name already exists}

● User enters an item name that already exists


● Starting at 7 from {add item}

7. User enters an item name that already exists


8. User clicks the ‘add item’ button
9. Application displays a message ‘Item with same name already exists’
10. Use case ends (Fail)

Alternate: {Invalid price}

● User enters a price for an item that is not valid (not a number or is not above zero)
● Starting at 10 from {add item}

10. User enters a price for an item that is not valid


11. User clicks the ‘add item’ button
12. Application displays a message ‘Enter a valid number above zero for the price’
13. Use case ends (Fail)

https://imgur.com/zoRwVrw
Use Case 06: Modify An Item

PASS

Modify item is only possible when logged into an admin account, modifies an item in the application

Main: {Modify item}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin functions’ button
4. Application displays the admin functions screen
5. User clicks the ‘modify item’ button
6. Application displays the modify item screen
7. User types in item name
8. User clicks the ‘modify item’ button
9. Application displays the second modify item screen
10. User types in updated item description
11. User clicks the ‘modify’ button
12. A toast message is displayed indicating the successful modification of an item
13. Use case ends (Pass)

Alternate: {Item name does not exist}

● User enters an item name that does not exists


● Starting at 7 from {modify item}

7. User enters an item name that does not exist


8. User clicks the ‘modify item’ button
9. Application displays a message ‘Item does not exist’
10. Use case ends (Fail)

Alternate: {Invalid price}

● User enters a price for an item that is not valid (such as less than or equal to zero)
● Starting at 12 from {modify item}

12. User enters a price for an item that is not valid


13. User clicks the ‘add item’ button
14. Application displays a message ‘Invalid price’
15. Use case ends (Fail)

https://imgur.com/x9pcire
Use Case 07: Delete An Item

PASS

Delete item is only possible when logged into an admin account, deletes an item to the application

Main: {Delete item}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin functions’ button
4. Application displays the admin functions screen
5. User clicks the ‘delete item’ button
6. Application displays the delete item screen
7. User types in item name
8. User clicks the ‘delete’ button
9. User is returned to the admin functions screen
10. A toast message is displayed indicating the successful deletion of an item
11. Use case ends (Pass)

Alternate: {Item name does not exist}

● User enters an item name that does not exist


● Starting at 7 from {delete item}

7. User enters an item name that does not exist


8. User clicks the ‘delete’ button
9. Application displays a message ‘Insert an item name for an existing item’
10. Use case ends (Fail)

https://imgur.com/JwfmTvR
Use Case 08: Search For An Item

PASS

Searches for an item in the application

Main: {Search for item}

1. Login as testuser1
2. Display the username ‘testuser1’
3. User clicks the ‘search for item’ button
4. Application displays the search for item screen
5. User types in item name
6. User clicks the ‘search for item’ button
7. Application displays result item screen
- Screen displays item that the user has searched for
- Item name
- Item description
- Item price
8. Use case ends (Pass)

Alternate: {Item does not exist}

● User enters an item name that does not exist


● Starting at 5 from {search for item}

5. User enters an item name that does not exist


6. User clicks the ‘search for item’ button
7. TextView clears
8. Application displays a message ‘Item does not exist’
9. Use case ends (Fail)

https://imgur.com/8pAGc9q
Use Case 09: Search For A User

PASS

Search for a user is only possible when logged into an admin account, searches for a user in the
application

Main: {Search for a user}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin functions’ button
4. Application displays the admin functions screen
5. User clicks the ‘search for user’ button
6. Application displays the search for user screen
7. User types in username
8. User clicks the ‘search for user’ button
9. TextView displays user information
- Username
- Password
- Admin Status (true/false)
10. Use case ends (Pass)

Alternate: {User does not exist}

● User enters a username that does not exist


● Starting at 7 from {search for a user}

7. User enters a username that does not exist


8. User clicks the ‘search for user’ button
9. TextView clears
10. Application displays a toast message ‘User does not exist’
11. Use case ends (Fail)

https://imgur.com/7diBRir
Use Case 10: List In-Stock Items

PASS

List in-stock items is only possible when logged into an admin account, lists all in-stock items in the
application

Main: {List in-stock items}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin functions’ button
4. Application displays the admin functions screen
5. User clicks the ‘list in-stock items’ button
6. Application displays the list items screen
- Screen displays a list of all in-stock items
- Item name
- Item description
- Item price
7. Use case ends (Pass)

https://imgur.com/ci1E3FJ
Use Case 11: List All Users

PASS

List all users is only possible when logged into an admin account, lists all existing users in the
application

Main: {List users}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin functions’ button
4. Application displays the admin functions screen
5. User clicks the ‘list users’ button
6. Application displays the list users screen
- Screen displays a list of all users
- Username
- User password
- Admin Status (true/false)
7. Use case ends (Pass)

https://imgur.com/MRJywvP
Use Case 12: Delete All In-Stock Items

PASS

Delete all in-stock items is only possible when logged into an admin account, deletes all in-stock items
from the application

Main: {Delete all in-stock items}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin functions’ button
4. Application displays the admin functions screen
5. User clicks the ‘delete all in-stock items’ button
6. A toast message is displayed indicating the successful deletion of all in-stock items
7. Use case ends (Pass)

https://imgur.com/sh77kZN
Use Case 13: Delete All Users

PASS

Delete all users is only possible when logged into an admin account, deletes all existing user accounts
from the application besides the default accounts ‘testuser1’ and ‘admin2’

Main: {Delete all users}

1. Login as admin2
2. Display the username ‘admin2’
3. User clicks the ‘admin functions’ button
4. Application displays the admin functions screen
5. User clicks the ‘delete all users’ button
6. A toast message is displayed indicating the successful deletion of all existing user accounts
besides the default accounts
7. Use case ends (Pass)

https://imgur.com/hDoqwIp
Use Case 14: Display Order History

PASS

Displays current user’s order history

Main: {Display order history}

1. Login as testuser1
2. Display the username ‘testuser1’
3. User clicks the ‘order history’ button
4. Application displays the order history screen
- Screen displays a list of all items this user has purchased
- Item name
- Item description
- Item price
5. Use case ends (Pass)

https://imgur.com/2wqM6xE
Use Case 15: Return Item

PASS

Removes an item from the current user’s order history, places the item back into the in-stock inventory
of items

Main: {Return item}

1. Login as testuser1
2. Display the username ‘testuser1’
3. User clicks the ‘return item’ button
4. Application displays the return item button
5. User types in item name
6. User clicks the ‘return item’ button
7. A toast message is displayed indicating the successful return of the item
8. Use case ends (Pass)

Alternate: {Item name does not exist}

● User enters an item name that does not exists


● Starting at 5 from {return item}

5. User enters an item name that does not exist


6. User clicks the ‘return item’ button
7. Application displays a message ‘Item does not exist’
8. Use case ends (Fail)

https://imgur.com/eBRTLW8
Use Case 16: Purchase In-Stock Item

PASS

Removes an item from the list of in-stock items, adds the item to the current user’s order history

Main: {Purchase item}

1. Login as testuser1
2. Display the username ‘testuser1’
3. User clicks the ‘purchase item’ button
4. Applications displays the purchase item screen
5. User types in item name
6. User clicks the ‘purchase’ button
7. A toast message is displayed indicating the successful purchase of an item
8. Use case ends (Pass)

Alternate: {Item does not exist}

● User enters an item name that does not exist


● Starting at 5 from {purchase item}

5. User enters an item name that does not exist


6. User clicks the ‘purchase’ button
7. Application displays a message ‘Item does not exist’
8. Use case ends (Fail)

https://imgur.com/AF9Fjow

You might also like