# **Test Plan Document for Alpha Test Version of App completed, April 18, 2020**
## 1. Testing Strategy
### 1.1 Overall Strategy
For unit testing, we will see if we can first invoke the list manager, then create all our different classes: Create List, Delete List, Get Lists, Rename List, Display Items in a List, Add item to list by: Hierarchy List, Searching Item, and creating a new item if not found in database, deleting an item from the list, changing quantity of item in a list, marking item(s) in the list, and marking all items in the list.
For integration testing, we will test the different Android Activities for the functionality of the buttons and displays the correct information to the screen.
For regression testing, we will have to retest all test cases that are related to the change.
### 1.2 Test Selection
We will select our test cases based on condition testing. We will first test if we can invoke the list manager and test the creation of List with pass and fail condition. Then we will test the differt methods in the classes of our application with pass and fail conditions. Then we will test if we can invoke the list manager and the creation of List as a user, assume everything works.
### 1.3 Adequacy Criterion
When Unit testing, we can assess the quality of our test cases by calculating the number of line of code we are executing with the test case divided by the total lines of code in the unit (class) we are testing times 100. When we are Integration and System testing, we can assess the quality of our test cases by calculating the number of lines of code we are executing with the test case divided by the total lines of code in the entire application times 100.
### 1.4 Bug Tracking
We can have a form that a user can fill out to submit bugs and feature requests which will send out an email to the team.
### 1.5 Technology
We will use JUnit and Espresso tests in Android Studio to implement tests.
## 2. Test Cases
| Test Case | Purpose | Steps Necessary | Expected Result | Actual Result | Pass/Fail | Add'l Info |
| ------------------------------------------------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------- | --------- | ---------- |
| Press the "Create List" button in the MainActivity | See behavior of pressing the "Create List" button in the MainActivity | Press the "Create List" button | The CreateList is launched | The CreateList is launched | Pass | |
| Press the "Back" button in the CreateListActivity | See behavior of pressing the ‘Back’ button in the CreateListActivity | Press the "Create List" Button then press the ‘Cancel’ Button | We go back to the Main Activity page | Return to the MainActivity | Fail | |
| Press the "Delete" button in the MainActivity | See behavior of trying to delete a list in the MainActivity | Press the "Create List" button then press the "Delete" button | A list is deleted | A list is deleted | Pass | |
| Create a list with the name "Weekly". | See behavior of trying to create a List with "Weekly". | Press the "Create New" button with "Weekly" filled. | Updated Lists with the newly created one | "Weekly" List appeared on the user's list | Pass | |
|Rename an existed list | See the behavior of trying to rename a list | Select a "pencil icon" to rename the list | A list is renamed | A list is renamed | Pass |Once you hit the "pencil icon" dialogue box appears |
| Press the "Add Item" button in the ListActivity | See the behavior of "Add Item" button in the ListActivity | Press the "Add Item" button | An item is added to the list and the quantity increase | An item is added to the list and the quantity increase | Pass | |
| Press the "Edit Quantity" button in the ListActivity | See the behavior of "Edit Quantity" button in the ListActivity | Select the item, then press edit quantity which will take you to the next screen, fix the quantity and hit "Change Quantity" button and save changes | An item is deleted from the list and the quantity decrease | An item is deleted from the list and the quantity decrease | Pass | |
| Press the "Add Item" button in the MainActivity which leads to Search tool | See the behavior of "Search" box in the MainActivity | Press the category or name button | The item that satisfied the critera in SearchBar should appear | The item that satisfied the critera in SearchBar appear. | Pass | |
| Search by category in search box | See the behavior of "Search" box in the MainActivity | Press the category and search for "Meat" | The item that satisfied the critera in SearchBar should appear, that should pop the category of meat like chicken, meat and pork | The item that satisfied the critera in SearchBar appears. | Pass | |
| Search by item name in search box | See the behavior of "Search" box in the MainActivity | Press the name and search for "Apple" | The item that satisfied the critera in SearchBar should appear | The item that satisfied the critera in SearchBar appears. | Pass | |
| Delete an Item from a List | See behavior of trying to Delete an Item from a List. | Press the checkbox on the left side of the Item to check. | Item in given List isChecked = true | The chosen Item’s check attribute is true. | Pass |When you hit "Delete an Item" it takes you to another screen where you could select the items you want to delete. |
|Check off all Items from a List with no existing Item.| See behavior of trying to check off all Items in a List when no Item exists. | Press the checkbox on the left side of the List to check all. | The List isChecked = true and nothing else happens. | The chosen List’s check attribute is true. | Fail | |
| Check off all Items from a List | See behavior of trying to check off all Items in a List. | Press the checkbox on the left side of the List to check all. | The List isChecked = true and all Items in the List isChecked = true | All the Items’ check attributes in chosen List are true. | Fail | |
| Press "Select All" from list to "Delete Item" and "Edit Quantity" | See behavior of trying delete or editing all items | Press the checkbox on the left side of the List to check all. | The List isChecked = true and all Items in the List isChecked = true | All the Items’ check attributes in chosen List are true. | Pass | |
| Press "User list" button to go back to all the list | See behavior of trying to go back to the list |In middle of editing a particlar list if you want to go back to preview all the lists | To preview the items in other list. | All the Items’ check attributes in chosen List are true. | Pass | |
| Press "Create New Item" button to add non existing item to database | See behavior of trying to add item to grocery database |if you cannot find the item in the database you can create the item. | The item that satisfied the criteria added through category or name in the database | All the Items’ check attributes in chosen List are true. | Pass |To reach "Create new Item" you have to go through "Add an Item" which takes you to the search page where you can find "Create new Item" button at the bottom of the screen |
| Test to see if the items in a list are grouped by type | See behavior of trying to test the items if they are group by its type |so as to allow the user to shop for the specific type of product at once |Expected result should be that items are grouped by its type|we can see the items are grouped by its type | Pass | |](https://)