Sample
Schnappinger/junit4/org.junit.internal.AssumptionViolatedException
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 52.8Δ 37.9 |
| Scalabrino | 0.742 | 0–1; higher is more readable | 46.9Δ 43.8 |
| Dorn | 0.373 | 0–1; higher is more readable | 53.1Δ 37.6 |
| Mi | 0.25 | 0–1; higher is more readable | 16.2Δ 74.6 |
| LLOC | 27 | Logical lines; fewer is more readable | 51.5Δ 39.3 |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs | 66.8Δ 23.9 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 17.0 |
| BTTF | 0.581 | 0–1; higher is more readable | 54.1Δ 36.6 |
| Human | 4 | 1–4; original rating | 90.8 |
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. | 1936.402 | −63.901 |
| Source linesThe number of non-empty source lines. | 90 | +36 |
| 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.597 | −6.896 |
Intercept 8.87 + feature contributions = -25.927 (log-odds).
Score = sigmoid(-25.927) = 0.
| Score | 0.742 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 90 | −2.15 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 72 | +1.753 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 72 | −1.231 |
| 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. | 114.944 | −1.203 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 115 | +1.051 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 88.784 | +0.831 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.06 | +0.359 |
Intercept 0.07 + feature contributions = -0.52 (log-odds).
Score = sigmoid(-0.52) = 0.373.
| Score | 0.25 |
|---|
| Score | 27 |
|---|
Run 1
The code demonstrates strong readability with clear logical organization and consistent naming conventions (Hungarian notation for fields). The class structure is well-defined with a clear responsibility: encapsulating assumption violations. Nesting is minimal — the deepest level is just two levels in describeTo. Intent is explicit through meaningful field names, well-documented constructors, and the Javadoc. Code length is appropriate with no unnecessary methods or duplicated logic. Action granularity is good; each line performs one operation, particularly in describeTo. Reading flow is natural: fields are declared logically, constructors chain sensibly from specific to general, and describeTo follows a coherent conditional progression. Minor deductions: deprecated class might warrant cleanup, the Hungarian notation is slightly dated by modern Java standards, and the serialVersionUID hardcoded to 2L could confuse. Otherwise, the code is quite readable and maintainable.
Run 2
The code is well-structured and readable. It has a clear purpose: representing assumption violations in testing, with minimal nesting and a natural reading flow. Each action is logically separated into its own line. Constructors are concise and properly chain to a central constructor, reducing duplication. Field naming with the 'f' prefix is slightly dated but consistent. The describeTo method is flat and easy to follow. Minor deductions: the ternary in the super() call adds slight cognitive load, and the boolean fValueMatcher could be clearer as something like 'hasValueAndMatcher' to improve intent.
Run 3
The code is well-structured with clear separation of fields, constructors, and methods. It uses minimal nesting (only one level of conditionals in describeTo) and maintains good action granularity with one logical action per line. Intent is clearly documented via Javadoc comments explaining each constructor's purpose. The class is concise for its functionality, avoiding unnecessary verbosity while maintaining readability. Reading flow is natural - fields are defined first, followed by constructors in logical progression, then methods. The deprecation documentation is clear. Minor deductions: the constructor with 4 parameters could benefit from a parameter object if extended further, and the conditional checking of fAssumption twice in describeTo could be slightly restructured. Overall, very readable code that follows established Java conventions well.
Run 1
Code Structure: Fields, constructors, and description methods are logically organized, with constructor delegation centralizing initialization. Nesting: Shallow conditional nesting in describeTo is easy to follow. Clarity of intent: Documentation and descriptive method names explain the exception's purpose, though Hungarian-style field prefixes and the fValueMatcher boolean slightly obscure meaning. Code length: Concise overall; repeated constructor documentation adds minor redundancy. Action granularity: Each statement performs one clear action, with no densely packed operations. Reading flow: Consistent formatting and sequential description assembly make reading natural; positional boolean and null constructor arguments require some cross-referencing.
Run 2
Code Structure: Fields, constructors, and methods are logically grouped; constructor delegation avoids duplicated initialization. Nesting: Conditional nesting is shallow, reaching only two levels in describeTo. Clarity of intent: Class documentation and descriptive method names explain the purpose well, though f-prefixed fields and the valueMatcher boolean require some interpretation. Code length: The implementation is concise; repeated constructor documentation adds minor verbosity. Action granularity: Statements generally perform one action per line, making initialization and message construction easy to follow. Reading flow: Consistent formatting and sequential description assembly provide a natural flow. Delegated boolean/null arguments and the conditional Throwable cast slightly increase the effort needed to understand constructor behavior.
Run 3
Code Structure: Fields, delegating constructors, and description methods are logically organized with little duplication. Nesting: Control flow is shallow, with only two levels of conditional nesting in describeTo. Clarity of intent: Class documentation and constructor comments explain the purpose well, though the f-prefixed fields and valueMatcher boolean are less immediately intuitive. Code length: The implementation is concise; constructor overloads add length but provide useful interfaces. Action granularity: Each statement performs a single clear action, and description construction is broken into readable steps. Reading flow: Execution progresses naturally from initialization to message formatting, with whitespace separating logical sections. Minor drawbacks include repeated constructor documentation, boolean arguments whose meaning requires checking the primary constructor, and the implicit extraction of a Throwable cause from value.