Skip to main content

Guided Task: Run System Tests

Now that you’re completed the model classes with passing unit tests and added the GUI (view/controller) to the WolfScheduler program, you can run your system level tests. These tests ensure that the entire system is working end to end. When we run system tests, we consider the system as a whole where the internal details are not know. The system is like a closed box, where we put input in and get actual results out. If the actual results of execution are different than what was expected, the test fails and we can start debugging. The expected results of execution are defined in the requirements!

Callout Box Icon

Learning Outcomes

  • Run a Java application in Eclipse
  • Run system tests
  • Record the results of system test execution

Running WolfScheduler

The main() method for the WolfScheduler project is in the GUI class. To run the WolfScheduler project, right click on WolfSchedulerGUI and select Run As > Java Application. The program will start and a FileChooser dialog box titled “Load Course Catalog” will open. Select test-files/course-records.txt and click Select.


Figure: Load Course Catalog
Figure: Load Course Catalog


The main GUI will load. There are four sections:

  • Course Catalog: The catalog contains 13 classes in the same order as the file. (Note: the file has 14 lines, one line (line 4) is invalid.) The name, section, and title for each are displayed.
  • Actions: The actions section has a set of buttons and the Schedule Title text field.
  • My Schedule: Lists the courses that have been added to the schedule.
  • Course Details: Displays the details of any course selected in the Course Catalog table.


Figure: WolfSchedulerGUI
Figure: WolfSchedulerGUI


Running System Tests

The teaching staff have created 13 system tests for your to run. Each test should be independent, but some may have preconditions that rely on earlier tests. For example, the test to add a course to the schedule relies on the test to load a valid course catalog. To save a little time, the tests are ordered so that you can go through them all without closing the GUI and starting over for each test, starting with test 2. However, if you run into issues, you should close the GUI and start over on the next test (which is what the teaching staff will do during grading).

The System Test Plan is stored on Google Drive. You must be logged in to Google with your NC State id to access the file!

Download the System Test Plan document as a Word document by select File > Download > Microsoft Word in Google Drive. Create a new folder in your WolfScheduler project called project_docs by right clicking on WolfScheduler and selecting New > Folder. Save your system test plan as a Word document (*.doc or *.docx) in the project_docs folder.

Make sure all your system tests pass! However, if you run out of time and are unable to fix all the bugs in your project, report the actual results of execution - EVEN IF THEY ARE FAILING! You’ll earn some points on the system test portion of the grading rubric for reporting actual, failing results.

Recording Test Results

As you execute each test, document the results in the Actual Results column of your System Test Plan:

For PASSING tests:

  • Record: “Pass” or “Passed”
  • You do NOT need to write detailed descriptions for tests that pass as expected
  • This is the standard format used in industry for test documentation

For FAILING tests:

  • Provide a detailed description of what actually happened:
    • What was displayed differently than expected?
    • What error message appeared?
    • What behavior was incorrect?
  • DO NOT write “Failed” or “Did not pass”. Describe the actual failing behavior to provide details to the developer that can help them debug the issue.
  • Use your own words to describe what you observed

Example for a failing test:

1
2
Expected Results: Course CSC 216-001 appears in the schedule
Actual Results: When clicking "Add Course", an error dialog appeared with message "Course cannot be found" and CSC 216-001 did not appear in the schedule table

Test Documentation Standards

Grading Note: You will receive credit for accurately reporting test results, even if your tests fail. Honest documentation of failures helps you and the teaching staff identify where to focus debugging efforts. However, you should strive to fix all failures before final submission.

Reference: Staging and Pushing to GitHub

Check Your Progress

Before moving on to the next portion of the Guided Project, complete the following tasks:

  • Make sure that all fields, methods, and constructors are commented.
  • Resolve all static analysis notifications.
  • Fix test failures.
  • Commit and push your code changes with a meaningful commit message. Label your commit with “[Test]” for future you!