HelloWorldJUnit

image

After committing/uploading your Java files. Click "Actions" to see the report.
When committing, GitHub will ask you to enter a message. It helps to easily understand why a change has been made at a particular time and distinguish between each commission.
image

Action

This is the action page:
image
The workflow are your commissions from newest to latest.
Click on the one that you want to see the report.

This means the workflow is in progress, and you have to wait until it changes the status.
image


This means the workflow is failed. You can see your details in the reports inside it.
image


This means the workflow is passed, but you should check the reports to check your code style is good enough and any misspell occurs.
image


When the workflow finish, you can see its details:
image

Test Report

image
The Test Report shows the result of how many test cases that are passed, failed, or skipped.

  • Click "Test Report" for the report of test cases
  • Don't worry about "Build Step." It will be red if any test case failed.


The following is an example a Test Report with 3 failed tests.
image
Several reasons are suggested for the test case's failure. After "expected" is the correct answer and after "but was" is your answer.
If you want to check the test case and see what methods it calls, you can see the test case and path in this line. image



Let analyze this failed test. image
This test case calls the main() method and receives different outputs than expected.
It expects "Hello, World!" but receives "Hello, World! " (with an extra space at the end). The extra space is the reason of this failure.




Checkstyle

image
image

Checkstyle is a tool for checking Java source code for adherence to the Google Java Style Guide.
Click "checkstyle" to view the report. The report should look like this: image



You can access each code line violating the coding standard through "Findings(37)" image

The following is some comments you might find in the report:

  • "'method def modifier' has incorrect indentation level 4, expected level should be 2." Google style uses an indentation of 2 spaces, but most IDEs use 4 spaced indentation. Therefore, if you want to use 4 spaced indentation, you can ignore this comment.
  • "Line is longer than 100 characters (found 109)." A normal computer screen cannot show more than 100 characters horizontally. The long line should be broken into shorter lines to ensure readability.
  • "'{' at column 5 should be on the previous line." '{' should not be in a new line. For example,
    if (condition) {
    statement;
    }
  • "'if' construct must use '{}'s." Even when you only have 1 statement in your constructor, you should uses '{}'
  • "Only one statement per line allowed." Code should only have 1 statement per line for readability.
  • "WhitespaceAround: '=' is not preceded with whitespace" and "WhitespaceAround: '=' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)" There should be a space before and after '+', '-', '*', '/', '=', '<', '>', ... ';' should be followed by a space if there is anything after it