Testing Documentation
Testing Documentation
This page will document our testing for classes in Inventoryinator. Segmented into:
- Unittesting
- Integration Testing
- Hybrid Testing
- Acceptance Testing
Launch and shutdown
-
Initial launch
- Download the jar file and copy into an empty folder
java -jar inventoryinator.jar
- Double-click the jar file Expected: Shows the GUI with a set of sample items and recipes. The window size may not be optimum.
- Download the jar file and copy into an empty folder
-
Saving window preferences
-
Resize the window to an pre-set size. Move the window to a different location. Close the window.
-
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
-
Saving data
-
Dealing with missing/corrupted data files
- Delete the data file and restart. The application will generate a valid default save file.
Running tests
There are two ways to run tests.
- Method 1: Using IntelliJ JUnit test runner
- To run all tests, right-click on the
src/test/java
folder and chooseRun 'All Tests'
- To run a subset of tests, you can right-click on a test package,
test class, or a test and choose
Run 'ABC'
- To run all tests, right-click on the
- Method 2: Using Gradle
- Open a console and run the command
gradlew clean test
(Mac/Linux:./gradlew clean test
)
- Open a console and run the command
Link: Read this Gradle Tutorial from the se-edu/guides to learn more about using Gradle.
Types of tests
This project has three types of tests:
- Unit tests targeting the lowest level methods/classes.
e.g.seedu.address.commons.StringUtilTest
- Integration tests that are checking the integration of multiple code units (those code units are assumed to be working).
e.g.seedu.address.storage.StorageManagerTest
- Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
These tests are separated into their respective files. e.g.seedu.address.logic.commands.CraftItemCommandTest
andseedu.address.logic.commands.CraftItemCommandIntegrationTest