Sample

Schnappinger/junit4/org.junit.experimental.theories.suppliers.TestedOnSupplier

Human rating uses the original dataset scale.

Human3.84
Lines21

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
60.2Δ 14.7
Scalabrino0.4190–1; higher is more readable
5.1Δ 40.4
Dorn0.5410–1; higher is more readable
62.4Δ 16.8
Mi0.5370–1; higher is more readable
38.9Δ 6.6
LLOC7Logical lines; fewer is more readable
75.9Δ 30.4
DeepSeek V4 Pro17.670–20; mean of three runs
83.0Δ 37.5
GPT-6.1 Sol18.330–20; mean of three runs
85.3Δ 39.8
BTTF0.5780–1; higher is more readable
53.8Δ 8.3
Human3.841–4; original rating
45.5

Views

Source code

package org.junit.experimental.theories.suppliers; import java.util.ArrayList; import java.util.List; import org.junit.experimental.theories.ParameterSignature; import org.junit.experimental.theories.ParameterSupplier; import org.junit.experimental.theories.PotentialAssignment; public class TestedOnSupplier extends ParameterSupplier { @Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) { List<PotentialAssignment> list = new ArrayList<PotentialAssignment>(); TestedOn testedOn = sig.getAnnotation(TestedOn.class); int[] ints = testedOn.ints(); for (final int i : ints) { list.add(PotentialAssignment.forValue("ints", i)); } return list; } }

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.793.065−26.171
Source linesThe number of non-empty source lines.21+8.4
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.578−6.868

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

Score0.419

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
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.77.955+0.363
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.22+0.257
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.20.835−0.119
Indentation frequencyHow rapidly indentation changes from line to line.21−0.011
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.096+0.009

Intercept 0.07 + feature contributions = 0.164 (log-odds).
Score = sigmoid(0.164) = 0.541.

Score0.537
Score7
Run 1

The code is well-structured and highly readable. It follows a clear logical organization: imports, class declaration, single overridden method. Nesting is flat, with only a single loop and no conditional complexity. Intent is immediately clear — the supplier extracts an annotation, reads its integer values, and converts them into potential assignments. The code is concise, with no unnecessary verbosity or redundancy. Each line performs a single logical action, and the reading flow is natural from top to bottom: retrieve annotation, access values, iterate, build list, return. Minor improvements could include using a diamond operator for the list instantiation, but overall this is exemplary readable code.

Run 2

The code is well-structured and readable. It follows a clear logical flow: fetch the annotation, extract values, convert them into assignments, and return them. The nesting is minimal (single loop), and each line generally performs one action. Variable names are descriptive, and the method's purpose is immediately clear. The only minor deductions are for the fully qualified types in the generic declaration (which slightly adds noise) and the absence of a null check on testedOn, though that may be assumed by the framework. Overall, it is concise and maintainable.

Run 3

The code is highly readable. It has a clear, logical structure with a single focused method. Nesting is minimal (one loop); intent is unambiguous from method and variable names. The code is concise, avoiding boilerplate or unnecessary complexity. Each line performs one clear action, and the flow reads naturally: retrieve annotation, extract values, build list, return result. Minor improvement could modernize the code by using diamond operator or streams, but readability is not affected.

Run 1

Code Structure: The class contains one focused method with logically ordered steps. Nesting: A single loop keeps nesting shallow. Clarity of intent: Reading annotation values and converting them into potential assignments is straightforward, although generic names such as list, ints, and i provide limited context. Code length: The implementation is concise, with no unnecessary logic. Action granularity: Each statement performs one clear action. Reading flow: Imports, annotation lookup, value extraction, iteration, and return follow a natural sequence. More descriptive variable names would improve an already highly readable implementation.

Run 2

Code Structure: A single focused method is logically organized, with imports and class declaration clearly separated. Nesting: Only one loop, keeping the code shallow and easy to follow. Clarity of intent: The annotation values are plainly converted into potential assignments, though generic names such as list, sig, and ints offer limited context. Code length: Concise, with no unnecessary logic or repetition. Action granularity: Each statement performs one distinct action on its own line. Reading flow: Naturally progresses from creating the result list to retrieving values, transforming them, and returning the result.

Run 3

Code Structure: A single focused method logically organizes annotation retrieval, value conversion, and return. Nesting: Only one shallow loop, making control flow easy to follow. Clarity of intent: The method clearly converts annotated integers into potential assignments, though generic names such as list and ints are less descriptive than they could be. Code length: Concise, with no unnecessary logic or repetition. Action granularity: Each statement performs one distinct action on its own line. Reading flow: The straightforward top-to-bottom sequence is natural and easy to trace.