addressbook-level4 icon indicating copy to clipboard operation
addressbook-level4 copied to clipboard

Expand the scope of system tests

Open yamgent opened this issue 7 years ago • 5 comments

The "system" tests in test/java/guitests/ currently act somewhat as a unit test for GUI and commands.

With PR #536, GUI unit tests are done in a seperate architecture and test cases. With PRs associated to #172, commands themselves already have their appropriate unit tests.

As such, the system tests should be more thorough. For example, after performing a valid delete, DeleteCommandTest should also ensure that the StatusBar's time is updated, and that StorageManager has also saved the file.

Remaining tests:

  • [ ] ExitCommand
  • [x] HelpCommand
  • [ ] HistoryCommand
  • [ ] ListCommand
  • [x] ~UndoCommand~ (doesn't make sense to be tested in isolation)
  • [x] ~RedoCommand~ (doesn't make sense to be tested in isolation)

yamgent avatar Jul 11 '17 00:07 yamgent

@damithc do we have to write system tests for:

  1. ExitCommand (I think we definitely can't write for this :P)
  2. HelpCommand
  3. HistoryCommand
  4. ListCommand
  5. RedoCommand
  6. UndoCommand

For UndoCommand and RedoCommand, we have integrated them with other system tests. For the remaining 4 commands, arguably we need a system test to ensure that upon execution of these commands, the system is updated / not updated accordingly.

Zhiyuan-Amos avatar Aug 22 '17 10:08 Zhiyuan-Amos

  1. ExitCommand : we should, but probably can't, so it's ok.
  2. HelpCommand : yes
  3. HistoryCommand : yes
  4. ListCommand : yes
  5. RedoCommand/UndoCommand : if they are thoroughly tested by other commands, can be omitted. But it is unlikely other tests will push the limits of these commands, so I guess yes, we can have a system test for these too, but can be a lower priority.

damithc avatar Aug 22 '17 10:08 damithc

Noted. I will put the emphasis on porting the existing tests from guitests to systemtests, before implementing for the commands listed above. ^^

Zhiyuan-Amos avatar Aug 22 '17 10:08 Zhiyuan-Amos

ExitCommand (I think we definitely can't write for this :P)

The test will type in the exit keyword, and then test that the MainWindow/MainApp is closed.

yamgent avatar Aug 22 '17 14:08 yamgent

The test will type in the exit keyword, and then test that the MainWindow/MainApp is closed.

After investigating this, @yamidark and I realized that it's not possible to test that the MainWindow / MainApp is closed because the JVM shuts down after the exit command is executed; the test will end immediately. See here for the detailed discussion.

Zhiyuan-Amos avatar Feb 21 '18 00:02 Zhiyuan-Amos