For the first assignment you will need to first follow the instruction on your Git and GitHub intro.
Using the link provided by your instructor, you first need to accept the assignment. This will create a repository for your assignment on GitHub. Go to your repository page and copy the SSH link to clone the repository. You can find it by clicking on the “Code” green button. Example:
git@github.com:ECE495-F24-handbook/ar694-graph.git
Now you should have a page that says your project was created, and states that the repository is empty.
There should be a blue “Clone” button. If you click it, you should get a drop down. We’ll use
the ssh one (assuming you have setup SSH keys already, this is easiest). Copy the link,
and go to your command prompt and type git clone
then paste the URL you copied
in after that.
git clone git@github.com:ECE495-F24-handbook/ar694-graph.git
You should now have an (empty) directory named the same as your assignment. That directory is the
root of your assignment, and we’ll do everything in there. cd
into
it.
Run gradle init
to setup a project. Your answers to the questions should be:
Note: replace YOURNETID with your actual netid. For me, this was edu.duke.ece495.ar694.graph
Code coverage tools let you analyze which lines of code were executed during a particular run. It helps determine the share of code covered by tests and identify areas that lack sufficient test coverage. We will use JaCoCo plugin for that reason. It provides code coverage metrics for Java code via integration with JaCoCo.
Edit build.gradle
to add the following to the plugins section:
id 'jacoco
Then run gradle build
just to make sure there are no problems in your build.gradle
before
you proceed. Gradle will try to find the required dependencies and re-build the project.
You can execute the jacoco task to generate test coverage by executing the following command:
gradle jacocoTestReport
. This will generate a report in the build directory. You can check the result at, build/reports/jacoco/test/html/index.html
.