From 0dc1c2950320d6979cba1664dde6f6dce2e33a73 Mon Sep 17 00:00:00 2001
From: damithc Go to the main website [http://se-education.org/guides] Go to the main website [http://se-education.org/guides] This is a sub-project of the se-education.org.
Suggestions, questions, and bug reports can be posted in our issue tracker. Alternatively, contact project mentor Damith C. Rajapakse.
- This work is released under the MIT OSS license. PRs to improve/add content are welcome. This website uses MarkBind documentation tool. This document has some guidance on how to use it when updating contents. Follow the Markdown style guide in your PR. The Guides for SE student projects »
Guides for SE student projects »
Guides for SE student projects »
About Us
Contact
License
Contributing
Acknowledgements
favicon.ico
is based on an icon made by Dave Gandy from www.flaticon.com
This work is released under the MIT OSS license.
PRs to improve/add content are welcome.
This website uses MarkBind documentation tool. This document has some guidance on how to use it when updating contents.
Follow the Markdown style guide in your PR.
The favicon.ico
is based on an icon made by Dave Gandy from www.flaticon.com
We recommend using java.util.logging
package for logging.
Logging Levels
SEVERE
: A critical problem detected which may cause the termination of the application.WARNING
: Can continue, but with caution.INFO
: Information showing the noteworthy actions by the App.FINE
: Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size.We recommend using java.util.logging
package for logging.
Logging Levels
SEVERE
: A critical problem detected which may cause the termination of the application.WARNING
: Can continue, but with caution.INFO
: Information showing the noteworthy actions by the App.FINE
: Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size.AddressBook-Level3 (AB3) is a brownfield project template used by SE courses. Given below are some tutorials to help students understand how to navigate and modify the existing AB3 codebase.
Person
class.Authors:
AddressBook-Level3 (AB3) is a brownfield project template used by SE courses. Given below are some tutorials to help students understand how to navigate and modify the existing AB3 codebase.
Person
class.Authors:
GitHub Actions is CI/CD tool integrated into GitHub.
In the simplest case, setting up is a matter of adding a .yml
file into the [root]\.github\workflows
folder (example).
GitHub Actions will run the workflow (as per the .yml
file) every time certain project events are triggered (e.g., when a PR is updated, or the master
branch is updated).
GitHub Actions is CI/CD tool integrated into GitHub.
In the simplest case, setting up is a matter of adding a .yml
file into the [root]\.github\workflows
folder (example).
GitHub Actions will run the workflow (as per the .yml
file) every time certain project events are triggered (e.g., when a PR is updated, or the master
branch is updated).
This tutorial covers basics of the Intellij IDEA's debugging features.
If you are new to using an IDE-based debugger, we recommend that you watch the following video (from LaunchCode) which gives a pretty good explanation of how to use the IntelliJ IDEA debugger.
To recall how to use a specific feature, you can use the sections below.
Purpose: A breakpoint is a line in the code at which the debugger will pause the execution.
How: Click on the left gutter of the editor pane, at the line where you want to breakpoint. A red dot will appear to indicate the breakpoint.
[image credit: Intelli]
To remove the breakpoint, click the red dot again.
Video segment 3.09 - 3.30 :
More info from Intellij is here.
Purpose: To get Intellij to run the code in the debugger mode, so that the debugger can direct the execution flow as needed by the debugging.
How: There are several ways. One of them is to click the icon in the gutter near the class with the main()
method and select Debug
.
[image credit: Intelli]
Video segment 3.53 - 4.00 :
More info from Intellij is here.
Purpose: To examine variable values at a specific step of the execution.
How: Use the Debugger tool window (the bottom part of the screenshot below). Ccurrent value of each variable is listed in the panel on the bottom right.
[image credit: LaunchCode]
Video segment 4.41 - 6.06 :
More info from Intellij is here.
Purpose: Executes the current statement, and move to the next statement.
How: Click the Step Over
button in the debugger toolbar, as shown below.
[image credit: se-edu]
Video segment 7.30 - 7.55 :
More info from Intellij is here.
Purpose: Suppose the current statement calls another method, and you are interested to see how the execution goes through that method. Here, you can step into that method.
How: Click the Step Into
button in the debugger toolbar, as shown below.
[image credit: se-edu]
Video segment 13.05 - 13.35 :
When trying to step into a statement such as storage.saveAddressBook(model.getAddressBook())
which contains multiple method calls, Intellij will let you choose (by clicking) which one you want to step into.
More info from Intellij is here.
Purpose: Executes the remaining lines of code in the current method and returns to the caller.
-Used when you've stepped into a method, stepped through some of it, and now want to return to the caller method without stepping through the remainder of the current method.
How: Click the Step Out
button in the debugger toolbar, as shown below.
[image credit: LaunchCode]
Video segment 13.45 - 13.55 :
More info from Intellij is here.
Purpose: To pause the execution at a certain breakpoint only when a certain condition is met e.g., to stop at a breakpoint only when the 100th iteration of a loop.
How: Right-click on a breakpoint and enter a condition (e.g., i == 5
)
[image credit: LaunchCode]
Video segment 15.20 - 16.45 :
Purpose: Allows you to compute the value of an expression at a specific point during execution, enabling dynamic inspection of variables and data structures.
e.g., while debugging, you want to find the result of expressions truncate(myVariable * 2)
based on the current value myVariable
How: Enter it in the Evaluate expression
field in the Variables pane (shown below) and press Enter.
[image credit: Tom Gregory Tech]
More info from Intellij is here.
Purpose: To pause execution whenever a specified exception is thrown, regardless of where it occurs in your code, making it easier to identify and diagnose issues.
How: Choose Run
> View Breakpoints
from the main menu, and use the icon to add an exception breakpoint, as shown below.
[image credit: Tom Gregory Tech]
More info from Intellij is here.
Authors:
This tutorial covers basics of the Intellij IDEA's debugging features.
If you are new to using an IDE-based debugger, we recommend that you watch the following video (from LaunchCode) which gives a pretty good explanation of how to use the IntelliJ IDEA debugger.
To recall how to use a specific feature, you can use the sections below.
Purpose: A breakpoint is a line in the code at which the debugger will pause the execution.
How: Click on the left gutter of the editor pane, at the line where you want to breakpoint. A red dot will appear to indicate the breakpoint.
[image credit: Intelli]
To remove the breakpoint, click the red dot again.
Video segment 3.09 - 3.30 :
More info from Intellij is here.
Purpose: To get Intellij to run the code in the debugger mode, so that the debugger can direct the execution flow as needed by the debugging.
How: There are several ways. One of them is to click the icon in the gutter near the class with the main()
method and select Debug
.
[image credit: Intelli]
Video segment 3.53 - 4.00 :
More info from Intellij is here.
Purpose: To examine variable values at a specific step of the execution.
How: Use the Debugger tool window (the bottom part of the screenshot below). Ccurrent value of each variable is listed in the panel on the bottom right.
[image credit: LaunchCode]
Video segment 4.41 - 6.06 :
More info from Intellij is here.
Purpose: Executes the current statement, and move to the next statement.
How: Click the Step Over
button in the debugger toolbar, as shown below.
[image credit: se-edu]
Video segment 7.30 - 7.55 :
More info from Intellij is here.
Purpose: Suppose the current statement calls another method, and you are interested to see how the execution goes through that method. Here, you can step into that method.
How: Click the Step Into
button in the debugger toolbar, as shown below.
[image credit: se-edu]
Video segment 13.05 - 13.35 :
When trying to step into a statement such as storage.saveAddressBook(model.getAddressBook())
which contains multiple method calls, Intellij will let you choose (by clicking) which one you want to step into.
More info from Intellij is here.
Purpose: Executes the remaining lines of code in the current method and returns to the caller.
+Used when you've stepped into a method, stepped through some of it, and now want to return to the caller method without stepping through the remainder of the current method.
How: Click the Step Out
button in the debugger toolbar, as shown below.
[image credit: LaunchCode]
Video segment 13.45 - 13.55 :
More info from Intellij is here.
Purpose: To pause the execution at a certain breakpoint only when a certain condition is met e.g., to stop at a breakpoint only when the 100th iteration of a loop.
How: Right-click on a breakpoint and enter a condition (e.g., i == 5
)
[image credit: LaunchCode]
Video segment 15.20 - 16.45 :
Purpose: Allows you to compute the value of an expression at a specific point during execution, enabling dynamic inspection of variables and data structures.
e.g., while debugging, you want to find the result of expressions truncate(myVariable * 2)
based on the current value myVariable
How: Enter it in the Evaluate expression
field in the Variables pane (shown below) and press Enter.
[image credit: Tom Gregory Tech]
More info from Intellij is here.
Purpose: To pause execution whenever a specified exception is thrown, regardless of where it occurs in your code, making it easier to identify and diagnose issues.
How: Choose Run
> View Breakpoints
from the main menu, and use the icon to add an exception breakpoint, as shown below.
[image credit: Tom Gregory Tech]
More info from Intellij is here.
Authors:
Please refer to Intellij's own documentation here.
Please refer to Intellij's own documentation here.
If you are working with a forked repo that is using MarkBind already, refer to this guide instead.
MarkBind is a tool for generating static websites from markdown-like text, particularly suitable for text-heavy websites such as software project documentation.
Given below are some information useful for when you want to update documentation in a project that uses MarkBind.
MarkBind is a superset of Markdown. Refer the MarkBind user guide for more details.
First, start the live preview: Unless it is a trivial change, you would want to see how your change to the documentation source files will reflect in the generated website. You can use the MarkBind live preview mode to preview the generated website as you update the source file. To start the live preview mode,
[project root]/docs
-- if you are not sure, look for the folder containing the site.json
file).markbind serve
command. That will open the generated website in your default browser.Next, edit the files you want:
.md
files).While live preview can pick up most changes, it may not be able to pick up certain changes (e.g., changes to files in the _markbind
folder or changes to nunjucks macros). Furthermore, some syntax errors in your code can cause the live preview to crash. In those cases, just stop the server (Ctrl+C on Windows) and start it again.
Project admins can,
If you are working with a forked repo that is using MarkBind already, refer to this guide instead.
MarkBind is a tool for generating static websites from markdown-like text, particularly suitable for text-heavy websites such as software project documentation.
Given below are some information useful for when you want to update documentation in a project that uses MarkBind.
MarkBind is a superset of Markdown. Refer the MarkBind user guide for more details.
First, start the live preview: Unless it is a trivial change, you would want to see how your change to the documentation source files will reflect in the generated website. You can use the MarkBind live preview mode to preview the generated website as you update the source file. To start the live preview mode,
[project root]/docs
-- if you are not sure, look for the folder containing the site.json
file).markbind serve
command. That will open the generated website in your default browser.Next, edit the files you want:
.md
files).While live preview can pick up most changes, it may not be able to pick up certain changes (e.g., changes to files in the _markbind
folder or changes to nunjucks macros). Furthermore, some syntax errors in your code can cause the live preview to crash. In those cases, just stop the server (Ctrl+C on Windows) and start it again.
Project admins can,