Testing guide
Running tests
There are three ways to run tests.
Running test using method 3 is more reliable, and it does not choke up your computer’s graphical interface.
-
Method 1: Using IntelliJ JUnit test runner (Not recommended)
- 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
-
Method 3: Using Gradle (headless)
- Open a console and run command
gradlew clean headless test
(Mac/Linux:./gradlew clean headless test
)
- Open a console and run command
Types of tests
This project has three types of tests:
-
GUI Tests
These are tests which simulates user interaction with the application.
a. Unit tests that test the individual GUI components. These are in the
seedu.address.ui
package.b. System test within
seedu.address.ui
package, theMainWindowTest.java
simulates user interaction with the full TBM GUI. -
Non-GUI Tests
These are tests not involving the GUI of TBM. They include,
a. Unit tests targeting the lowest level methods/classes.e.g
seedu.address.commons.StringUtilTest
b. 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
c. Hybrids of unit and integration tests. These test are checking multiple code units as well as how they are connected together.
e.g.
seedu.address.logic.LogicManagerTest