Skip to content

Issue #166: Added format string to @Parameters annotation in Scrabble… - #222

Merged
jtigger merged 11 commits into
exercism:masterfrom
FridaTveit:ScrabbleScoreTestAddFormatStringToParametersAnnotation
Dec 26, 2016
Merged

jtigger merged 11 commits into
exercism:masterfrom
FridaTveit:ScrabbleScoreTestAddFormatStringToParametersAnnotation

Conversation

@FridaTveit

Copy link
Copy Markdown
Contributor

…ScoreTest. This should fix issue #166 .

…m#164, exercism#165 and exercism#166: Added format string to @parameters annotation in AtbashTest, BinaryTest, OctalTest, RaindropsTest and RomanNumeralsTest. Removed repeated word in format string for PiglatinTest and ScrabbleScoreTest.
@FridaTveit

Copy link
Copy Markdown
Contributor Author

Did the same change for AtbashTest, BinaryTest, OctalTest, RaindropsTest, RomanNumeralsTest and PigLatinTest. This should fix issue #165, #164 , #163, #162 , #161 and #160 .

@jtigger jtigger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, @FridaTveit, thank you for tackling all of these.

I have a suggestion.

Making the test output higher fidelity has made it clearer that the names of the variables in the tests reveal little intention.

Would you like to tackle, as part of this PR picking more descriptive names from the inputs and outputs?

As an example: in AtbashTest, instead of input it would be more descriptive to call it something like plaintext and instead of expectedOutput call it ciphertext. The message could then read, "{index}: expected plaintext \"{0}\" to encode to ciphertext \"{1}\"."

The spirit of all this is for the test system to give such great signal that any failure is as obvious as possible from just the message.

(This was not part of the original issue, feel free to call it done, if you'd like).

@jtigger jtigger self-assigned this Dec 21, 2016
@FridaTveit

Copy link
Copy Markdown
Contributor Author

Sure @jtigger, will do! :)

@jtigger jtigger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate your patience, @FridaTveit. We're really close.

Some comments about how some of the messages are perfectly poetic while others are a little verbose.

These might seem like real nitpicks. They are. But the bulk of a practitioner's experience of Exercism is with the test suites. The more readable the better. Readability is (in part) using the right amount of words, no more, no less.

private int decimalNumber;

@Parameters
@Parameters(name = "{index}: expected result {1} when converting binary number " +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The fewer words written, the more of them read." Do you think we can trim up this sentence?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it :)

public BinaryTest(String input, int expectedOutput) {
this.input = input;
this.expectedOutput = expectedOutput;
public BinaryTest(String binaryNumberAsString, int decimalNumber) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

private int decimalNumber;

@Parameterized.Parameters
@Parameterized.Parameters(name = "{index}: expected result {1} when converting octal number " +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about simplifying this sentence as above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it :)

private String pigLatinTranslation;

@Parameterized.Parameters
@Parameterized.Parameters(name = "{index}: expected \"{0}\" to translate to the pig latin phrase \"{1}\"")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jtigger jtigger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jtigger

jtigger commented Dec 26, 2016

Copy link
Copy Markdown
Contributor

Thanks for your time and attention on this @FridaTveit! Looks great!

@jtigger
jtigger merged commit 9dcf9a2 into exercism:master Dec 26, 2016
@FridaTveit
FridaTveit deleted the ScrabbleScoreTestAddFormatStringToParametersAnnotation branch October 17, 2017 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants