Sample

Schnappinger/junit4/junit.framework.JUnit4TestCaseFacade

Human rating uses the original dataset scale.

Human3.95
Lines30

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0250–1; higher is more readable
72.2Δ 8.5
Scalabrino0.8410–1; higher is more readable
73.3Δ 9.6
Dorn0.5440–1; higher is more readable
62.7Δ 1.0
Mi0.370–1; higher is more readable
23.1Δ 40.6
LLOC11Logical lines; fewer is more readable
70.6Δ 6.9
DeepSeek V4 Pro180–20; mean of three runs
91.4Δ 27.7
GPT-6.1 Sol18.670–20; mean of three runs
86.5Δ 22.8
BTTF0.7640–1; higher is more readable
91.7Δ 28.1
Human3.951–4; original rating
63.7

Views

Source code

package junit.framework; import org.junit.runner.Describable; import org.junit.runner.Description; public class JUnit4TestCaseFacade implements Test, Describable { private final Description fDescription; JUnit4TestCaseFacade(Description description) { fDescription = description; } @Override public String toString() { return getDescription().toString(); } public int countTestCases() { return 1; } public void run(TestResult result) { throw new RuntimeException( "This test stub created only for informational purposes."); } public Description getDescription() { return fDescription; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.541.113−17.857
Source linesThe number of non-empty source lines.30+12
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.46−6.69

Intercept 8.87 + feature contributions = -3.677 (log-odds).
Score = sigmoid(-3.677) = 0.025.

Score0.841

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.75+0.489
Indentation frequencyHow rapidly indentation changes from line to line.30+0.301
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.30−0.268
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.072+0.246
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.25+0.151
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.28.763−0.008

Intercept 0.07 + feature contributions = 0.176 (log-odds).
Score = sigmoid(0.176) = 0.544.

Score0.37
Score11
Run 1

The code is highly readable. It has a clear, logical structure with a single class, well-named fields, and methods. Nesting is minimal—only a single lambda-like constructor call and no deeply nested blocks. The intent is unambiguous: this is a facade for JUnit 4 test descriptions. Each method is concise and does one thing, with one action per line in most places. The reading flow follows a natural top-to-bottom order: constructor, toString, countTestCases, run, getDescription. The only minor deductions are the non-standard field prefix 'f' (which is intentional in some JUnit codebases but may confuse beginners) and the lack of Javadoc explaining why run() throws. Overall, very clean and maintainable.

Run 2

The code is highly readable with clear logical structure, minimal nesting, and concise intent. Each action is on its own line, and the reading flow is natural. Minor improvements could include adding javadoc for the class or clarifying the runtime exception message, but overall it is straightforward and easy to understand.

Run 3

The code is highly readable due to its clear, logical structure and minimal nesting. It has a single responsibility as a facade, with well-named methods that align with the Test and Describable interfaces. Action granularity is excellent—each method performs one clear task, and the throw statement is formatted cleanly across lines for readability. The field name fDescription follows a consistent convention, and the constructor is concise. Minor deductions: the cryptic 'f' prefix on the field and the hardcoded return value of 1 in countTestCases() could be clearer with a named constant or comment, but overall intent is obvious. Reading flow is natural and the code length is appropriate for its purpose.

Run 1

Code Structure: The class is logically organized around a single immutable description, with short, focused methods. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: Interface names, method names, and the exception message clearly indicate an informational test facade, though the fDescription naming convention and unexplained constant test count slightly reduce clarity. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one action, and the wrapped exception construction remains readable. Reading flow: The constructor followed by interface-related methods provides a natural progression. Consistent @Override annotations on all implemented interface methods would improve readability.

Run 2

Code Structure: A small, logically organized class with a single field and focused methods. Nesting: No nested control flow, making it easy to scan. Clarity of intent: The facade exposes a test description, reports one test case, and explicitly rejects execution with an informative exception. The legacy fDescription naming and missing @Override annotations on interface methods slightly reduce clarity and consistency. Code length: Concise, with no unnecessary implementation. Action granularity: Each statement performs a single action. Reading flow: Conventional formatting and short methods provide a natural progression from construction to behavior and description access.

Run 3

Code Structure: A small, logically organized class with a single immutable field and clearly separated methods. Nesting: No nested control flow, making every method easy to scan. Clarity of intent: Interface implementations and the exception message clearly identify an informational test facade, although the legacy fDescription naming and missing @Override annotations on some interface methods slightly reduce clarity. Code length: Concise, with no unnecessary logic or boilerplate. Action granularity: Each statement performs one simple action; the wrapped exception construction remains readable. Reading flow: The constructor followed by short interface methods provides a natural flow, supported by consistent formatting.