CS 2334: Web-Cat Instructions
Configuring Eclipse (do these once)
Install the Web-Cat Plug-In
- Help menu: select Install New Software
- Click Add
- Enter Name: WebCAT Plugin
- Enter Location: http://web-cat.org/eclipse
- Click OK
- Click Select All and Next
- Click Next
- Read license, select Accept, click Finish
- Wait
- Security warning: click OK
- Restart Eclipse: click Yes
- Eclipse restarts
- Window menu: select Preferences
- Select: Configured Assignments
- Fill in the Submit URL as:
http://web-cat2.cs.ou.edu/WebObjects/Web-CAT.woa/wa/assignments/eclipse?institution=OU
- Click: OK
Using spaces instead of tabs (and other configuration steps)
The Web-Cat style checker expects that all indentation be done with
spaces instead of tabs. This makes your code more portable because a
tab can translate into different amounts of space depending on the
viewer. Here is the process for informing Eclipse that it should use
spaces instead of tabs for indentation:
- Window menu: select preferences
- Select Java/Code Style/Formatter
- Click New to create a custom profile
- Click OK
- Click the Indentation tab
- Under General Settings/Tab Policy: select Spaces
Only
- Also select Statements within switch body
- Under White Space/Control Structures/if-else, select before opening
parenthesis
- Under the Braces tab, select next line on all
items (except, perhaps, Array initializer)
- Under the Control Statements tab, select Insert New Line Before else/catch/finally/while (four check boxes)
- Click Apply. Click OK until you are back to the preferences menu.
- In the preferences menu: select General tab, select Editors/Text Editors/Show Print Margin and set the Print Margin Column to 120.
- Click Apply. Click OK until you are out of the
preferences menu.
Submitting to Web-Cat
Method 1: Submitting from Eclipse
- Complete the writing and testing of your project.
- Project menu: select Submit Assignment
- Project text box: make sure that your current project is selected
- Under Select the assignment to submit, select CS
2334/[assignment name], where assignment name
corresponds to the current assignment.
- Do this once: Click Change username and password. Enter
your Web-Cat username and password. Click OK
- (back to Submit an assignment for grading window)
Click Finish
- Your browser should automatically open a Web-Cat page that
shows your submission being graded. After a short wait, the
page will show a report of your submission.
Method 2: Submitting directly to the Web-Cat server:
- From the File menu, select Export.
- Select Java/JAR File. Click Next.
- Select and expand your project folder.
- Select your src and doc folders.
- Select Export Java source files and resources.
- Select an export destination location (e.g., your Documents
folder/directory). This file should end in .jar
- Select Add directory entries.
- Click Finish.
- In your web browser, login to the Web-Cat server.
- Click the Submit button.
- Browse to your jar file.
- Click the Upload Submission button.
- The next page will give you a list of all files that you
are uploading. If you selected the correct jar file, then click
the Confirm button.
- Your browser will then open a Web-Cat page that shows your
submission being graded. After a short wait, the page will show a report of
your submission. See the main class web page for a link that
describes the Web-Cat output.
Interpreting the Web-Cat Report
Note 1: Your code grades depend on both automatic and human grader input. When you
first submit code, you will only have access to the automatically
graded components; the human input will be made available after the
submission deadline.
Note 2: Unit tests are special segments of code that are
designed to test your program. We will always provide a set of
unit tests to check the correctness of your submission. While you
will not be given the content of these tests, you will get a report on
which tests passed and which ones failed.
Note 3: You will be implementing your own unit tests starting with lab 2.
The Web-Cat report includes a lot of information. Here are the key
pieces:
Result Summary
- Total Score: this is your grade at the current time. It may or
may not include human-added points.
- Score Summary:
File Details
This section lists all of your graded Java files and indicates the
number of points that were deducted by the static code checker.
You can click through each of the files. For each file, you will see:
- Comments about where points were deducted by the static checker
- Any notes left by the grader, including deducted points
- Starting with lab 2: highlighting of your code based on the
results of executing your unit tests:
- Red: code blocks that were not "touched" by at least one of your
unit tests
TA/Instructor Comments
We will place any high-level comments in this section as we are
completing the human grading step. These comments will include
discussion of any deducted points not already noted directly in your
code.
Compilation Produced Errors/Warnings
This section gives the output of the compiler as it attempted to
compile your code. If you are not receiving automatic feedback, then
you likely have a compiler error that you must address. Looking
carefully at the compiler output, you will see that the nature of the
error is discussed in detail, including the source file name and the
line number.
Note that compiler errors should largely be getting caught by Eclipse
as you are testing your code locally. A very common case that will
not be caught is when our unit tests do not
compile against your code. This happens when you deviate from the
API required by the lab/project specification.
Results from Running Your Tests
This section gives a summary of your individual unit tests and, for
each one, indicates whether your code passed or failed the unit test.
Before you submit your code to Web-Cat, your own tests should already
be passing (in which case, you should not have trouble here).
Code Coverage from Your Tests
This section reports how much of your code base is covered by your
own unit tests. In Eclipse, you can test coverage on your local
machine (we will discuss this in Lab 2). If you are passing these
coverage tests, then you will pass them on the server.
Estimate of Problem Coverage
This section summarizes the degree to which your submission passed our
unit tests. You will be able to see the percent of passed tests and a few
hints, but you will not have access to the specifics of the failing
tests. In general failing a test here, while passing all of your
own unit tests suggests that your own tests are incomplete.
Style Checks
The Web-Cat server will confirm that your code adheres to specific
style requirements. Any deviations from these requirements will
result in point subtractions from your Style/Coding grade (-1
or -2, depending on the type of error). Here are the key things that
the static code analyzer
checks for:
- Proper indentation with no tabs. You can force Eclipse to
reformat your code properly by using: Ctrl-a to select all of
your code and Ctrl-i to indent the selected code. Remember to
save before you resubmit your code
- Properly formatted class-level documentation. This is a
Javadoc section at the top of each file that includes:
- @author line
- @version line. Your version should be the date that you
created the Java file for the first time.
- Properly formatted method-level documentation. This is a
Javadoc section that is placed ahead of each method that
includes:
- @param line for each parameter (if there are parameters)
- @return line if the method returns a value
- A space between a conditional and the subsequent open
parenthesis. For example:
if (x < 5)
not:
if(x < 5)
- Each curly bracket must have its own line. For example:
if (x < 5)
{
++y;
}
not:
if (x < 5) {
++y;
}
- All blocks must have curly brackets. For example
if (x < 5)
{
++y;
}
not:
if (x < 5)
++y;
- Lines must not exceed 120 characters in length.
- All declared variables must be used.
- All import statements must be used.
Resubmission
Based on the feedback from the Web-Cat server, you may alter your
program and, up until the deadline, resubmit it. Please do not abuse
this ability,
as there are many other people using the server at the same time.
Note that the server will stop providing feedback at some time before
the project deadline.
Notes
- Browser: we are aware that older versions of Firefox do not
function properly with Web-Cat. When in doubt, you can set a
different default browser for Eclipse under: Window Menu/Preferences/General/Web Browser
- Always use the default package in Eclipse -- do not create your
own packages.
- Do not use the Web-Cat server to do debugging. You should make
sure that your code is executing without problems on your local
computer before submitting.
- The Web-Cat server won't do automatic grading if it can't
compile your code. If you are receiving zeros for both
automatically graded items, then this is a clue that you have a
compiler error. See the Compilation Produced
Errors/Warnings section of your Web-Cat feedback for more
detail
andrewhfagg--gmail.com
Last modified: Fri Aug 25 17:21:07 2017