Repository navigation
Issue #166: Added format string to @Parameters annotation in Scrabble… - #222
Conversation
…ScrabbleScoreTest.
…PigLatinTest.
…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.
jtigger
left a comment
There was a problem hiding this comment.
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).
|
Sure @jtigger, will do! :) |
…st name for OctalTest and BinaryTest to be more desciptive.
jtigger
left a comment
There was a problem hiding this comment.
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 " + |
There was a problem hiding this comment.
"The fewer words written, the more of them read." Do you think we can trim up this sentence?
There was a problem hiding this comment.
I've changed it :)
| public BinaryTest(String input, int expectedOutput) { | ||
| this.input = input; | ||
| this.expectedOutput = expectedOutput; | ||
| public BinaryTest(String binaryNumberAsString, int decimalNumber) { |
| private int decimalNumber; | ||
|
|
||
| @Parameterized.Parameters | ||
| @Parameterized.Parameters(name = "{index}: expected result {1} when converting octal number " + |
There was a problem hiding this comment.
Same comment about simplifying this sentence as above.
There was a problem hiding this comment.
I've changed it :)
| private String pigLatinTranslation; | ||
|
|
||
| @Parameterized.Parameters | ||
| @Parameterized.Parameters(name = "{index}: expected \"{0}\" to translate to the pig latin phrase \"{1}\"") |
|
Thanks for your time and attention on this @FridaTveit! Looks great! |
…ScoreTest. This should fix issue #166 .