Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pangram: Slim down descriptions to generate better test identifiers #1533

Merged
merged 6 commits into from
Jun 28, 2019

Conversation

bencoman
Copy link
Contributor

The purpose of the "description" field is to derive identifiers for naming generated test methods, but some descriptions have tended to verbosity ending up with long identifiers (up to 150 characters). Such long method names are harder for students to work with and also are awkward for some IDE GUIs.

Issue #1473 proposed adding a separate "identifier" field, but I was required to first try improving "descriptions" to better suit "identifier" generation. This PR aims to slim down the generated identifiers without losing substantive information about the test.

To start with, "Check if the given string is a pangram" is a rather banal redundant description unworthy of nesting.

Banal description adds unnecessary length to test method identifiers.
@bencoman bencoman changed the title pangram: Remove nesting pangram: Slim down descriptions to generate better test identifiers Jun 13, 2019
@bencoman
Copy link
Contributor Author

I had split this into two commits to make it easier to separate review nesting and description changes.
Just discovered you get a nice overall view if you go...
Files changed > Settings (gear icon) > Hide whitespace changes

@bencoman
Copy link
Contributor Author

btw, The strategy I use to create slim descriptions is imagine the word "Test" preceding the description (because including it would be redundant)

@rpottsoh
Copy link
Member

Files changed > Settings (gear icon) > Hide whitespace changes

Nice find. TIL something, and it is only the morning.

@bencoman
Copy link
Contributor Author

@rpottsoh I went to push a similar change to your suggestion into missing character 'h'
but realised that camelCase identifier convention would generate missing a 'h' into missingAH
which is not nice. I reverted your suggestion so it will generate missingCharacterH .
Let me know if you object.

@bencoman
Copy link
Contributor Author

@kotp, @rpottsoh, I committed your suggestion. Anything further be giving this the tick?

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Excellent changes again. Left a small comment.

"expected": false
},
{
"description": "perfect lower case",
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering if we should maybe rephrase this test case or add something to the README to describe what a perfect pangram is.

Copy link
Member

@kotp kotp Jun 26, 2019

Choose a reason for hiding this comment

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

That sounds like a good idea. (different PR though for the README). "perfect pangram in lower case" might be a better description of the test

Copy link
Member

Choose a reason for hiding this comment

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

Context being the pangram, which is why I think that the wording ended up being the way it became.

Copy link
Member

Choose a reason for hiding this comment

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

I am in favour of adding to the readme as wel.

Copy link
Member

Choose a reason for hiding this comment

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

@kotp @SleeplessByte If we do a separate PR for the readme, is this PR ok to be merged?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think so.

@SleeplessByte SleeplessByte merged commit f68b632 into master Jun 28, 2019
@SleeplessByte SleeplessByte deleted the bencoman-pangram-slim-descriptions branch June 28, 2019 21:41
@SleeplessByte
Copy link
Member

Another one merged @bencoman 🚀

@bencoman
Copy link
Contributor Author

thx all.

sshine pushed a commit to exercism/haskell that referenced this pull request Oct 25, 2019
Addresses exercism/problem-specifications#1533

This commit changes the test descriptions so that they no longer conform to the 
canonical test descriptions. Instead, they are modified such that they read
"pangram ...", e.g. "pangram with empty sentence". This helps readability.
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.

5 participants