Create test cases
There are three areas in which you can import or upload files:
Help Files: These files will be duplicated into the students' workbench. You can include template files in this section.
Test Drivers: This is where you upload the driver file for the test cases. You may have multiple driver files, and different test cases may require distinct driver files. If the entire solution consists of a single file from the student, you should include a blank file (or a very small file, such as a one-line comment like "// your file") as a placeholder. The students' file will replace this placeholder when running the test cases.
Solution Files: These files will be merged with the test drivers to generate output based on the input provided by the test cases.
In each file section, you have the option to upload a file, create a new one, or import a file from your workbench.
When working with Java, please note that the driver file does not require a ".java" suffix. There is a subpage about using the help file to pull in a complete solution. Following this link to the Java page.
Additionally, there is an option to generate a solution using OpenAI. You'll need to adjust the class name as necessary and ensure that the input/output text aligns with your problem description.
Follow the following instructions to add test cases.
If the students need to provide a test driver, how could I specify a test case?
You need to create a nearly empty file(a file with fewer than 10 characters), and upload the file as the test driver in the Test Main section. The file will be used as the placeholder in the test.
If I need to use text file input, where do I put the text files?
Generally you are advised not to use text files for testing purpose. The input data file are redirected to standard input. If you do like to use text files, you may include them in the Test Main file section. If you gave the data file in the Help file section, make sure they are also included in the Test Main section, as the students may change the content of the files in their work bench.
The order of the files that are copied to the test folder are:
student files(or solution files)
test driver(main) files if the size of the drive file has more than 10 characters. If the test driver in the Test Main folder has fewer than 10 characters, the file from the student will be used.
FOR C++ only: If the student has files with a main function, will this cause any issues because there are more than one main functions?
The student may have their own test files, and they don't have to remove them before submission. Just make sure that their files with main function has a Test as part of the file name, they will be ignored in the linking.
Also they need to make sure that no other files has Test in them(otherwise they will be ignored).
If the instructor need to have student provide a test driver, the driver should have Test as part of the name and there should be a place holder file in the Test Main section.