Sample
Schnappinger/junit4/org.junit.internal.ExactComparisonCriteria
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.345 | 0–1; higher is more readable | 76.6Δ 7.1 |
| Scalabrino | 0.708 | 0–1; higher is more readable | 40.4Δ 29.1 |
| Dorn | 0.617 | 0–1; higher is more readable | 69.0Δ 0.5 |
| Mi | 0.628 | 0–1; higher is more readable | 67.7Δ 1.8 |
| LLOC | 2 | Logical lines; fewer is more readable | 94.6Δ 25.1 |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs | 83.0Δ 13.5 |
| GPT-6.1 Sol | 20 | 0–20; mean of three runs | 99.3Δ 29.9 |
| BTTF | 0.691 | 0–1; higher is more readable | 78.5Δ 9.1 |
| Human | 3.95 | 1–4; original rating | 69.5 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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.562 | −6.842 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 202.119 | −6.67 |
| Source linesThe number of non-empty source lines. | 10 | +4 |
Intercept 8.87 + feature contributions = -0.642 (log-odds).
Score = sigmoid(-0.642) = 0.345.
| Score | 0.708 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 11 | +0.647 |
| 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. | 72 | +0.616 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 10 | −0.391 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 9.849 | −0.272 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.075 | +0.212 |
Intercept 0.07 + feature contributions = 0.475 (log-odds).
Score = sigmoid(0.475) = 0.617.
| Score | 0.628 |
|---|
| Score | 2 |
|---|
Run 1
The code is highly readable due to its clear structure and intent. It defines a single-purpose class that extends a base class and overrides one method, demonstrating good separation of concerns. Nesting is minimal, with only package and class-level blocks. The method name 'assertElementsEqual' clearly conveys its purpose, and the single line of logic delegates to JUnit's assertEquals, keeping action granularity at one action per line. Code length is concise but not overly abbreviated. Reading flow is natural—package, imports, class declaration, method override—following standard Java conventions. Minor deductions: the class could benefit from a brief Javadoc comment explaining its role or when exact element comparison is appropriate, and the method lacks documentation about its contract. Overall, the code is straightforward, maintainable, and easy to understand at a glance.
Run 2
The code is highly readable. It has a clear, logical structure with a single class extending a parent class, all organized in a proper package. Nesting is minimal (one method inside a class). The intent is obvious: to provide an exact comparison criteria using JUnit's assertEquals. The code is concise and not unnecessarily long. Action granularity is good, with one clear method call. Reading flow is natural and straightforward. The only minor deduction is due to the lack of a class-level Javadoc comment, which would further clarify the purpose for future maintainers.
Run 3
The code is highly readable. It has a clear, single-purpose structure: a class extending a base class and overriding one method. The package and import statements are standard and appropriate. Nesting is minimal, with only one method containing a single line of delegation. Intent is clear—the class name and method name explicitly indicate exact comparison criteria and equating elements. Code length is concise with no unnecessary boilerplate. Action granularity is ideal—one action per line. Reading flow is natural, moving from package declaration to import to class definition to method implementation. The only minor drawbacks are the missing Javadoc and the reliance on external context (the base class) to fully understand behavior, which prevents a perfect score.
Run 1
Code Structure: Logically organized with a package declaration, import, and a focused subclass. Nesting: Minimal, limited to the class and method. Clarity of intent: Descriptive class and method names, plus @Override, make the exact element-comparison purpose clear. Code length: Concise, with no unnecessary logic or boilerplate beyond the required structure. Action granularity: The method performs one clearly expressed assertion on a single line. Reading flow: Standard Java formatting and declaration order make the code easy to follow.
Run 2
Code Structure: Clean organization with a package declaration, import, and focused subclass. Nesting: Minimal, limited to the class and method. Clarity of intent: Descriptive class and method names, the override annotation, and direct delegation to Assert.assertEquals clearly express the purpose. Code length: Concise, with no unnecessary logic or boilerplate. Action granularity: A single assertion occupies its own line. Reading flow: Standard Java layout and consistent formatting make the code easy to follow.
Run 3
Code Structure: Package, import, class, and overridden method are logically organized. Nesting: Minimal, with only the class and method scopes. Clarity of intent: Descriptive class and method names, the @Override annotation, and direct delegation to Assert.assertEquals clearly express exact element comparison. Code length: Concise, with no unnecessary statements. Action granularity: The method performs one action on one line. Reading flow: Conventional Java formatting and a straightforward top-to-bottom layout make the code easy to follow.