Skip to content

Commit 44c5a4d

Browse files
committed
update instructions
1 parent 7a98f73 commit 44c5a4d

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,23 @@ name in the [settings.gradle](./settings.gradle) file.
77
- Sample learning objective
88

99
## Set up instructions
10-
- Sample instruction
10+
- Fork this repository and clone the forked version to your machine
11+
- Open the root directory of the project in IntelliJ
12+
- Implement the requirements listed in comments in the `./src/main/java/com.booleanuk/Exercise.java` file
13+
- When ready to test your solution, open the `./src/test/java/com.booleanuk/ExerciseTest.java` file and click a "Run Test" button. You can either run the entire test suite via figure 1 in the screenshot below, or run a specific test via figure 2.
14+
15+
![](./assets/run-a-test.PNG)
16+
17+
## Test Output
18+
19+
When you run a test, it's either going to pass or fail. When it fails, you'll be presented with a big red stream of text. This is called a stack trace and, though intimidating, does contain some useful information.
20+
21+
One of the core skills of a developer is debugging stack traces like this. The stack trace details in which classes & files the failure happened, and gives you a line number at the end. Most of the lines in the stack trace are irrelevant most of the time, you want to try and identify the files that you're actually working with.
22+
23+
In the sample screenshot below, we've tried to complete the first step of the exercise but provided an invalid value. Then we run the test associated with it and we see a big red stack trace, a test failure.
24+
25+
At the top, we see `expected: <32> but was: <33>`. This means the test expected the value to be 32, but the value the student provided was 33. We can see this in the code snippets at the top of the screenshot.
26+
27+
In the stack trace itself, we see this line: `at app//com.booleanuk.ExerciseTest.shouldBeAged32(ExerciseTest.java:20)`. This is helpful! This tells us the exact line in the ExerciseTest.java file (line 20) where the failure happened, as well as the method name (shouldBeAged32), helping us to identify where the issue began. This is the kind of thing you need to look for; a relevant file name, method name, class name and line number to give you a good starting point for debugging.
28+
29+
![](./assets/test-failure.PNG)

assets/run-a-test.PNG

26.4 KB
Loading

assets/test-failure.PNG

70 KB
Loading

0 commit comments

Comments
 (0)