Sample
Schnappinger/junit4/org.junit.rules.TestName
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 1 | 0–1; higher is more readable | 93.0Δ 30.6 |
| Scalabrino | 0.908 | 0–1; higher is more readable | 90.8Δ 28.4 |
| Dorn | 0.812 | 0–1; higher is more readable | 86.5Δ 24.1 |
| Mi | 0.89 | 0–1; higher is more readable | 99.7Δ 37.3 |
| LLOC | 5 | Logical lines; fewer is more readable | 83.0Δ 20.6 |
| DeepSeek V4 Pro | 18.33 | 0–20; mean of three runs | 96.0Δ 33.7 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 92.6Δ 30.2 |
| BTTF | 0.826 | 0–1; higher is more readable | 97.7Δ 35.3 |
| Human | 3.94 | 1–4; original rating | 62.4 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 41 | +16.4 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 267.189 | −8.817 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 4.708 | −7.061 |
Intercept 8.87 + feature contributions = 9.391 (log-odds).
Score = sigmoid(9.391) = 1.
| Score | 0.908 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.031 | +0.643 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 42 | −0.451 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 77.119 | +0.44 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (horizontal)How rapidly the visual pattern of identifier characters changes from left to right. It measures spatial frequency, not the meaning of the names. | 78.929 | +0.322 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 40.638 | +0.158 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 18 | −0.115 |
Intercept 0.07 + feature contributions = 1.466 (log-odds).
Score = sigmoid(1.466) = 0.812.
| Score | 0.89 |
|---|
| Score | 5 |
|---|
Run 1
The code is highly readable. It has a clear structure, with a focused class, a well-documented Javadoc example, and minimal nesting. The class extends TestWatcher, making its purpose obvious. There is no unnecessary nesting or complexity. The method starting() is concise and performs a single assignment. The getter is trivial and clear. Field naming (fName) is slightly dated but understandable. Overall, the code follows clean code principles, with a good balance of documentation and simplicity.
Run 2
The code is highly readable. It has a clear, logical structure with a single class extending TestWatcher, minimal methods, and flat nesting. The Javadoc example effectively demonstrates usage, enhancing clarity of intent. Method and field names are descriptive, except for the minor legacy-style 'fName' prefix. The code is concise, with one action per line, and the reading flow is natural: documentation, field declaration, lifecycle override, then accessor. Minor deductions are for the unconventional field naming and the slight verbosity of the Javadoc example, but overall it is exemplary.
Run 3
The code is highly readable. It has a clear structure with a single class, minimal but appropriate field, and two straightforward methods. Nesting is completely flat. The intent of the TestName rule is obvious from the class name, method names, and Javadoc example, which uses a simple, illustrative code snippet. Code length is concise and avoids unnecessary complexity. Each line performs a distinct action (assigning the method name, returning it). The reading flow follows a logical order: class declaration, field, lifecycle override, public accessor. The only minor deductions are the slightly dated naming convention (fName) and the Javadoc example using an older JUnit import style, but overall readability is excellent.
Run 1
Code Structure: Clearly organized into a field, lifecycle callback, and getter. Nesting: Minimal, with no conditional or loop nesting. Clarity of intent: The class name, method names, and documentation clearly explain its purpose; fName and d are slightly less descriptive than ideal. Code length: The implementation is concise, and the longer documentation provides a useful usage example. Action granularity: Each executable statement performs one action on its own line. Reading flow: Natural progression from usage documentation to state, initialization callback, and accessor. Minor formatting inconsistencies in the documentation example slightly reduce polish.
Run 2
Code Structure: Logically organized into a single-purpose class with one field, a lifecycle callback, and an accessor. Nesting: Flat, with no conditional or loop nesting. Clarity of intent: Class documentation, the usage example, and method names clearly explain the purpose; abbreviated names fName and d slightly reduce clarity. Code length: Implementation is concise, and the longer documentation provides useful context rather than unnecessary complexity. Action granularity: Each statement performs one simple action. Reading flow: Natural progression from documentation to state, state initialization, and retrieval; minor formatting inconsistencies in the example are the only notable distraction.
Run 3
Code Structure: Logically organized into a single-purpose class, private field, lifecycle override, and accessor. Nesting: Flat, with no nested control flow. Clarity of intent: The class documentation, usage example, and method names clearly explain its purpose; abbreviated names fName and d are slightly less descriptive. Code length: The implementation is minimal, and the longer documentation provides useful context. Action granularity: Each statement performs one action. Reading flow: Natural progression from documentation to state, initialization, and retrieval, with minor formatting inconsistencies in the example.