Skip to content

Testing

Cotapher edited this page Jun 30, 2022 · 2 revisions

Testing Strategy

Our testing strategy was to test core functionality to ensure that we don't make breaking changes when we are collaborating. We tried to use Test Driven Development as much as possible. We also reran the tests whenever we refactored our code.

Types of Tests

This included unit tests for both the server and client, and integration tests for the UI.

Testing Framework and Strategy

For functionality tests, we utilized JUnit to test the behaviour of core functions. Then, for UI tests, we used the TestFx framework. The TestFx framework allowed us to test JavaFX UI elements with an automated bot called a FxRobot, which automated button clicks and entering text. We used this bot to test elements such as making sure our popups actually create notes and notebooks properly, and that our side panes properly displayed all the required notes and notebooks.

Our unit tests followed the steps shown in class:

  • Arrange: bring the system under test (SUT) to the starting state. We used the @Start annotation (which is similar to the @Before annotation in JUnit) to initialize our starting state before each test is run.
  • Act: call the method or methods that you want to test. In each test, we would call the corresponding method(s) with predefined parameters.
  • Assert: verify the outcome of the above action. We had hardcoded desired return values for the functions we called with predefined parameters, so we ensured that these functions returned the right values. For the UI tests, we ensure that the correct UI elements are displayed.

Test Results PaninotesClient:

image

Test Results PaninotesServer:

image

UI Test Example for the Side Notebook Pane:

Side_Notebook_pane_test_recording

Clone this wiki locally