Sample
Schnappinger/junit4/junit.extensions.TestDecorator
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.257 | 0–1; higher is more readable | 75.6Δ 7.1 |
| Scalabrino | 0.897 | 0–1; higher is more readable | 88.4Δ 5.7 |
| Dorn | 0.836 | 0–1; higher is more readable | 91.1Δ 8.4 |
| Mi | 0.86 | 0–1; higher is more readable | 99.0Δ 16.3 |
| LLOC | 13 | Logical lines; fewer is more readable | 68.2Δ 14.5 |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs | 83.0Δ 0.3 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 92.6Δ 9.9 |
| BTTF | 0.717 | 0–1; higher is more readable | 85.1Δ 2.5 |
| Human | 3.97 | 1–4; original rating | 82.7 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 610.496 | −20.146 |
| Source linesThe number of non-empty source lines. | 42 | +16.8 |
| 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.391 | −6.586 |
Intercept 8.87 + feature contributions = -1.063 (log-odds).
Score = sigmoid(-1.063) = 0.257.
| Score | 0.897 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 36 | +0.508 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 42 | −0.451 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 72.429 | +0.364 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.304 |
| 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. | 79.976 | +0.278 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 40.704 | +0.159 |
Intercept 0.07 + feature contributions = 1.63 (log-odds).
Score = sigmoid(1.63) = 0.836.
| Score | 0.86 |
|---|
| Score | 13 |
|---|
Run 1
The code is highly readable and well-structured. It has a clear, single responsibility as a base decorator for tests. The class structure is logical, with fields, constructor, and methods arranged in a natural order. Nesting is minimal—no deeply nested blocks or conditionals. Each method is concise and performs one action per line, with clear intent revealed by method names like basicRun, countTestCases, and getTest. The use of Javadoc comments on the class and basicRun helps clarify purpose. The only minor drawbacks are the protected field fTest (which relies on naming convention for clarity) and slight ambiguity in why basicRun is separate from run, though the comment mitigates this. Overall, the code demonstrates strong readability with a clean flow from construction to execution to introspection.
Run 2
The code is highly readable with clear structure, minimal nesting, and concise methods. Each method has a single responsibility and follows a natural reading flow. The class hierarchy and intent are well-documented. Minor deductions for slightly redundant comments and older naming conventions (fTest prefix).
Run 3
The code is highly readable. It has a clear, logical structure with a well-defined class purpose as a test decorator. It is completely flat with no nesting. Each method performs a single, clear action and delegates to the wrapped Test object, making the intent obvious. Method names like basicRun, countTestCases, and getTest are self-documenting. The code is concise without being too terse. The only minor drawback is the protected field 'fTest' using a legacy prefix, which slightly affects modern readability conventions, but it is still clear given the constructor and getter.
Run 1
Code Structure: The class is logically organized around a wrapped Test, with small delegation methods. Nesting: There is no nested control flow, making every method easy to follow. Clarity of intent: The class documentation clearly explains the decorator role, and method names communicate their purposes; the legacy field name fTest is slightly less descriptive than wrappedTest. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one clear action. Reading flow: The constructor followed by simple execution, counting, representation, and access methods creates a straightforward reading experience. Minor improvements include grouping basicRun and run together and documenting basicRun as an extension hook.
Run 2
Code Structure: The class is logically organized around a single decorator responsibility, with small delegation methods. Nesting: Methods are flat, with no conditional or loop nesting. Clarity of intent: The class documentation clearly explains its purpose, and method names communicate their roles; the legacy name fTest is slightly less descriptive than wrappedTest. Code length: The implementation is concise, with no unnecessary logic. Action granularity: Each statement performs one action, and each method has a focused responsibility. Reading flow: Consistent formatting and straightforward delegation make the code easy to follow. The relationship between run and basicRun is understandable, though documenting basicRun as a subclass extension point would improve clarity.
Run 3
Code Structure: A clearly organized decorator class with short, cohesive delegation methods. Nesting: Entirely flat, with no conditional or loop nesting. Clarity of intent: The class documentation and method names clearly communicate its purpose; the legacy field name fTest is slightly less descriptive than wrappedTest. Code length: Concise, with no unnecessary implementation detail; basicRun provides an intentional extension point rather than needless duplication. Action granularity: Each statement performs a single action, making behavior easy to scan. Reading flow: Constructor followed by execution, counting, representation, and access methods creates a straightforward flow. Minor inconsistencies in override annotations and sparse method documentation slightly reduce polish but do not impede understanding.