Sample

Schnappinger/junit4/org.junit.runner.Runner

Human rating uses the original dataset scale.

Human3.93
Lines43

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett10–1; higher is more readable
93.6Δ 33.9
Scalabrino0.9420–1; higher is more readable
96.9Δ 37.2
Dorn0.7420–1; higher is more readable
78.5Δ 18.8
Mi0.7670–1; higher is more readable
93.1Δ 33.3
LLOC4Logical lines; fewer is more readable
87.0Δ 27.2
DeepSeek V4 Pro18.330–20; mean of three runs
96.0Δ 36.3
GPT-6.1 Sol190–20; mean of three runs
92.6Δ 32.8
BTTF0.7310–1; higher is more readable
88.4Δ 28.7
Human3.931–4; original rating
59.7

Views

Source code

package org.junit.runner; import org.junit.runner.notification.RunNotifier; /** * A <code>Runner</code> runs tests and notifies a {@link org.junit.runner.notification.RunNotifier} * of significant events as it does so. You will need to subclass <code>Runner</code> * when using {@link org.junit.runner.RunWith} to invoke a custom runner. When creating * a custom runner, in addition to implementing the abstract methods here you must * also provide a constructor that takes as an argument the {@link Class} containing * the tests. * <p/> * The default runner implementation guarantees that the instances of the test case * class will be constructed immediately before running the test and that the runner * will retain no reference to the test case instances, generally making them * available for garbage collection. * * @see org.junit.runner.Description * @see org.junit.runner.RunWith * @since 4.0 */ public abstract class Runner implements Describable { /* * (non-Javadoc) * @see org.junit.runner.Describable#getDescription() */ public abstract Description getDescription(); /** * Run the tests for this runner. * * @param notifier will be notified of events while tests are being run--tests being * started, finishing, and failing */ public abstract void run(RunNotifier notifier); /** * @return the number of tests to be run by the receiver */ public int testCount() { return getDescription().testCount(); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.43+17.2
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.275.783−9.101
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.486−6.729

Intercept 8.87 + feature contributions = 10.24 (log-odds).
Score = sigmoid(10.24) = 1.

Score0.942

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.99.93+0.808
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.017+0.774
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.99.977−0.569
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
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.41.802+0.174
Indentation frequencyHow rapidly indentation changes from line to line.17−0.149

Intercept 0.07 + feature contributions = 1.055 (log-odds).
Score = sigmoid(1.055) = 0.742.

Score0.767
Score4
Run 1

The code is highly readable. It follows a clear, logical structure: package declaration, imports, comprehensive Javadoc, class declaration, and methods. Nesting is minimal (no deep indentation or conditional blocks). Intent is explicit through descriptive names and thorough documentation. Length is concise—the class contains only essential methods with no redundant code. Action granularity is appropriate; each statement stands on its own line. Reading flow is natural, moving from high-level purpose to implementation details. Minor deductions: no blank line between the abstract methods and testCount(), and inherited interface methods lack @Override annotations, which could slightly improve clarity.

Run 2

The code is highly readable. It has a clear, flat structure with a single abstract class and two abstract methods, making intent obvious. Javadoc comments are concise and informative, explaining the purpose, usage, and key behaviors without being excessive. Nesting is minimal (only one class and one method body), and each method is short and focused. The `testCount()` method is a single, clear delegation line. Reading flow is natural: class documentation, abstract methods, then a concrete utility method. Minor deductions: the empty Javadoc reference comment in `getDescription()` adds slight noise, and the `p/>` tag is inconsistently used instead of `</p>`, but these are trivial. Overall, it exemplifies clean, maintainable API design.

Run 3

The code is exceptionally readable. It is structured logically with a clear class declaration, well-organized imports, and concise Javadoc comments that explain the purpose and contract. Nesting is minimal—only a single method body with a return statement. The intent is unambiguous: define an abstract Runner contract for JUnit test execution. The code length is appropriate for an abstract base class, avoiding unnecessary boilerplate. Action granularity is one action per line, making flow easy to follow. Reading flow is natural, from class documentation to abstract methods and a concrete helper. Minor deductions for slight verbosity in Javadoc, but overall it exemplifies clean, maintainable API design.

Run 1

Code Structure: A well-organized abstract class groups a small, coherent API with documentation beside each method. Nesting: Effectively flat, with only a single-level method body. Clarity of intent: Descriptive class and method names, explicit types, and useful Javadoc clearly communicate the runner's responsibilities and extension requirements. Code length: The implementation is concise; documentation is somewhat verbose, and the non-Javadoc comment adds little value. Action granularity: Each declaration or statement occupies its own line, and testCount performs one straightforward delegation. Reading flow: Package, import, class documentation, abstract methods, and the concrete convenience method follow a natural order. Minor documentation clutter prevents a perfect score.

Run 2

Code Structure: The class is logically organized, with its abstract API followed by a simple convenience method. Nesting: There is no control-flow nesting, making the code easy to scan. Clarity of intent: Descriptive names and useful documentation clearly communicate the runner's purpose and notification behavior; the inherited getDescription contract is referenced rather than explained directly. Code length: The implementation is concise, though some documentation markup and the non-Javadoc comment add minor clutter. Action granularity: Each declaration or statement performs one clear action; testCount delegates directly to the description. Reading flow: Consistent formatting and a natural progression from class documentation to methods support smooth reading.

Run 3

Code Structure: The class is logically organized, with abstract methods defining its contract followed by a small convenience method. Nesting: There is no unnecessary nesting; the only implementation is a single-level method body. Clarity of intent: Descriptive names and useful Javadoc clearly explain the runner's purpose, subclass requirements, and notification behavior. Code length: The implementation is concise; documentation is proportionate, though the non-Javadoc comment adds little value. Action granularity: Each declaration or operation occupies its own line, and testCount performs one straightforward delegation. Reading flow: The progression from class overview to description, execution, and test counting is natural and easy to follow. Minor dated documentation formatting slightly reduces polish without hindering comprehension.