Sample

Schnappinger/junit4/junit.extensions.RepeatedTest

Human rating uses the original dataset scale.

Human3.95
Lines39

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
65.2Δ 4.3
Scalabrino0.8470–1; higher is more readable
74.7Δ 5.2
Dorn0.6890–1; higher is more readable
74.6Δ 5.1
Mi0.7390–1; higher is more readable
90.1Δ 20.6
LLOC15Logical lines; fewer is more readable
65.8Δ 3.6
DeepSeek V4 Pro18.330–20; mean of three runs
96.0Δ 26.6
GPT-6.1 Sol190–20; mean of three runs
92.6Δ 23.1
BTTF0.6130–1; higher is more readable
59.7Δ 9.7
Human3.951–4; original rating
69.5

Views

Source code

package junit.extensions; import junit.framework.Test; import junit.framework.TestResult; /** * A Decorator that runs a test repeatedly. */ public class RepeatedTest extends TestDecorator { private int fTimesRepeat; public RepeatedTest(Test test, int repeat) { super(test); if (repeat < 0) { throw new IllegalArgumentException("Repetition count must be >= 0"); } fTimesRepeat = repeat; } @Override public int countTestCases() { return super.countTestCases() * fTimesRepeat; } @Override public void run(TestResult result) { for (int i = 0; i < fTimesRepeat; i++) { if (result.shouldStop()) { break; } super.run(result); } } @Override public String toString() { return super.toString() + "(repeated)"; } }

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.808.518−26.681
Source linesThe number of non-empty source lines.39+15.6
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.347−6.521

Intercept 8.87 + feature contributions = -8.732 (log-odds).
Score = sigmoid(-8.732) = 0.

Score0.847

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.37+0.543
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.80+0.486
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.37−0.428
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.39−0.345
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.80+0.277
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.37.877+0.12
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.089+0.074

Intercept 0.07 + feature contributions = 0.797 (log-odds).
Score = sigmoid(0.797) = 0.689.

Score0.739
Score15
Run 1

The code is highly readable. It follows a clear logical structure with a standard class layout: field, constructor, then overridden methods. Nesting is minimal—only one level of indentation in the for-loop and if-check. Intent is explicit: the class name, constructor validation, and method overrides convey purpose clearly. Code length is appropriate; no unnecessary boilerplate or mutable state beyond what is needed. Action granularity is well-balanced—each meaningful operation appears on its own line, while simple super delegations remain compact. Reading flow is natural: setup (constructor), query behavior (countTestCases), execution (run), and representation (toString) are organized logically. The only minor deduction is the compact 'if / break' inside the loop, which could be slightly expanded, but it remains clear and idiomatic.

Run 2

The code is highly readable. It has a clear, logical structure with a simple class hierarchy, flat nesting, and well-named methods that reveal intent. Each method performs a single, clear action with minimal lines of code. The constructor validation, loop with an explicit stop condition, and overridden methods are concise and self-explanatory. The only minor drawback is the slight redundancy in the loop’s break check, but this does not detract from overall clarity.

Run 3

The code is well-structured with clear separation of concerns. It extends TestDecorator appropriately and overrides only necessary methods. Nesting is minimal: the constructor has one early validation check, and the run loop contains a single break condition. Intent is explicit via method names, Javadoc, and the descriptive field fTimesRepeat. The code is concise without sacrificing readability. Each line generally performs one logical action. Reading flow is natural: constructor, then overrides in logical order. Minor deductions: the field name fTimesRepeat is slightly dated Hungarian notation, and countTestCases could be zero when repeat is 0, but this is not misleading. Overall, a clean and maintainable class.

Run 1

Code Structure: Logically organized into a constructor and focused overrides. Nesting: Shallow; only the stop condition is nested inside the repetition loop. Clarity of intent: The class comment, method names, and validation clearly convey repeated test execution, though fTimesRepeat uses a dated naming convention. Code length: Concise, with no unnecessary logic or duplication. Action granularity: Each statement performs a single clear action. Reading flow: Natural progression from initialization to counting, execution, and string representation. A more descriptive field name such as repeatCount would slightly improve readability.

Run 2

Code Structure: The class is logically organized into constructor validation and small, focused overrides. Nesting: Nesting is shallow, with only a stop-condition check inside the repetition loop. Clarity of intent: The class name, documentation, and method implementations clearly convey repeated test execution; the legacy field name fTimesRepeat is slightly less intuitive than repetitionCount. Code length: The implementation is concise without unnecessary abstraction or duplication. Action granularity: Each statement performs a single clear action. Reading flow: The progression from initialization to counting, execution, and string representation is natural and easy to follow.

Run 3

Code Structure: The class is logically organized into initialization, test counting, execution, and string representation. Nesting: Shallow nesting, with only a stop-condition check inside the loop. Clarity of intent: The class documentation and method names clearly communicate repeated test execution; the legacy field name fTimesRepeat is slightly less intuitive than repetitionCount. Code length: Compact, with no unnecessary logic or duplication. Action granularity: Each statement performs a single clear action. Reading flow: Natural progression from constructor validation to overridden behaviors, with consistent formatting and straightforward control flow.