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

triangle: Add clarity to test descriptions #1483

Merged
merged 3 commits into from Mar 26, 2019
Merged

triangle: Add clarity to test descriptions #1483

merged 3 commits into from Mar 26, 2019

Conversation

Mehni
Copy link
Contributor

@Mehni Mehni commented Mar 21, 2019

Proposed fix to exercism/csharp#1253

The current [Test] names confused me when I was doing the exercise. It was also difficult to see which tests failed, because of long method names combined with a small window with the test results.

This PR changes the "Returns_true_if_the_triangle_is_equilateral_false_if_any_side_is_unequal" style in favour of a pattern that follows "equilateral_triangle_returns_false_if_any_side_is_unequal".

Proposed fix to exercism/csharp#1253

The current [Test] names confused me when I was doing the exercise. It was also difficult to see which tests failed, because of long method names combined with a small window with the test results.
@Mehni
Copy link
Contributor Author

Mehni commented Mar 21, 2019

Some things I considered but didn't do:

  • Change the version. Reading the test-data-versioning, would this be a major change?
  • Technically the "sides can be floats" test uses doubles for the C# track. Since this is likely language specific, I'm not certain what the correct naming would be.

@rpottsoh rpottsoh changed the title triangle: Shorten and clarify test descriptions triangle: Add clarify to test descriptions Mar 21, 2019
@rpottsoh
Copy link
Member

rpottsoh commented Mar 21, 2019

Change the version. Reading the test-data-versioning, would this be a major change?

The changes I believe constitute a patch version change. I think bin/check_versions should have taken exception to the version not being changed and caused Travis CI to fail. @petertseng did check_versions perform as expected in this instance?

Update: @petertseng it appears Travis CI did not run at all....

Technically the "sides can be floats" test uses doubles for the C# track. Since this is likely language specific, I'm not certain what the correct naming would be.

I think floats is OK. Sometimes the term real is used as well as a more language agnostic way to infer that a value not be an integer, or a string, etc. Perhaps a more concise way to make the statement could be sides can be of a floating point type.

Copy link
Member

@rpottsoh rpottsoh left a comment

Choose a reason for hiding this comment

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

The version should be bumped to indicate a patch change I believe. I just realized that Travis CI was not executed on this PR. @kytrinyx is there something going on here that should be addressed?

@rpottsoh rpottsoh changed the title triangle: Add clarify to test descriptions triangle: Add clarity to test descriptions Mar 21, 2019
@SaschaMann
Copy link
Contributor

With #1473 in mind, perhaps the descriptions could be shortened a bit, e.g. all sides are equal instead of returns true if all sides are equal? The returned value is right below it anyway.

(Just a thought, not objecting to the proposed change here if others approve it)

@SaschaMann SaschaMann closed this Mar 21, 2019
@SaschaMann SaschaMann reopened this Mar 21, 2019
@SaschaMann
Copy link
Contributor

Closed and reopened to trigger a Travis build.

@Mehni
Copy link
Contributor Author

Mehni commented Mar 21, 2019

@rpottsoh from what you posted, wouldn't it be a major version since it renames a "property" (test type)? Or am I misunderstanding the nomenclature, and does it fall under "key formatting"?

@SaschaMann while "the returned value is right below it" is true when looking at the Test.cs itself, the test methods themselves aren't in the same screen as the test results (which is when you're most interested in expected vs actual). Coming from the C#-track, the IDE has the test results in a different pane. If I do the recommend way of testing dotnet test, I get a CLI with just the results.

@SaschaMann
Copy link
Contributor

@SaschaMann while "the returned value is right below it" is true when looking at the Test.cs itself, the test methods themselves aren't in the same screen as the test results (which is when you're most interested in expected vs actual). Coming from the C#-track, the IDE has the test results in a different pane. If I do the recommend way of testing dotnet test, I get a CLI with just the results.

That seems like an issue with dotnet tooling, not one that the common test spec needs to solve. I referred to that issue because shortening descriptions seemed to be a common wish in it and, imo, return true if (or true if) doesn't add a lot of info to the test data. The vast majority of test cases on this repo don't mention the expected result in the description.
But as I said, I leave it up to others to decide on this, just wanted to bring it up.

@Mehni
Copy link
Contributor Author

Mehni commented Mar 22, 2019

I've re-read the documentation and changing the description of tests is indeed a patch increment. Thanks for your patience, @rpottsoh.

I've also removed the "expected result" to bring this more in line with the other exercises. Thanks for your feedback, @SaschaMann.

Copy link
Member

@rpottsoh rpottsoh left a comment

Choose a reason for hiding this comment

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

I think saying first, second, third is a little cleaner than (1) (2) (3). I like your changes to the case descriptions. I want to take these three a little further.

exercises/triangle/canonical-data.json Outdated Show resolved Hide resolved
exercises/triangle/canonical-data.json Outdated Show resolved Hide resolved
exercises/triangle/canonical-data.json Outdated Show resolved Hide resolved
@rpottsoh
Copy link
Member

rpottsoh commented Mar 22, 2019

@rpottsoh from what you posted, wouldn't it be a major version since it renames a "property" (test type)? Or am I misunderstanding the nomenclature, and does it fall under "key formatting"?

@Mehni I think this still falls under patch, all of your changes only involve descriptions and comments.

Ha! I see you posted a comment that makes this one moot. 😄 Thanks for taking the time to streamline this exercise for all of us.

Co-Authored-By: Mehni <Mehni@users.noreply.github.com>
@Mehni
Copy link
Contributor Author

Mehni commented Mar 22, 2019

ofc 😄

I think Exercism is one of the best ways to learn coding and wanted to contribute.

@rpottsoh
Copy link
Member

If this PR is merged it should be squashed. This PR should remain open for a day or two to allow others a chance to comment and offer suggestions. If it is still open on March 24th I'll Squash and merge it.

@rpottsoh rpottsoh merged commit c652ec2 into exercism:master Mar 26, 2019
petertseng pushed a commit to petertseng/exercism-crystal that referenced this pull request Nov 1, 2019
The current [Test] names confused me when I was doing the exercise. It
was also difficult to see which tests failed, because of long test
descriptions combined with a small window with the test results.

This PR changes the
"Returns true if the triangle is equilateral false if any side is unequal"
style in favour of a pattern that follows
"equilateral triangle returns false if any side is unequal".

exercism/problem-specifications#1483

Note for the Crystal track:

Since the the following case group descriptions do not appear in the
test file (for example, as a `describe` or a `context`), test
descriptions may be considered to be missing some context. However, this
has always been the case, so this does not worsen the state of the
world, only keep it about as bad as it always has been.

https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L22
https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L71
https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L152
petertseng pushed a commit to petertseng/exercism-crystal that referenced this pull request Nov 1, 2019
The current [Test] names confused me when I was doing the exercise. It
was also difficult to see which tests failed, because of long test
descriptions combined with a small window with the test results.

This PR changes the
"Returns true if the triangle is equilateral false if any side is unequal"
style in favour of a pattern that follows
"equilateral triangle returns false if any side is unequal".

exercism/problem-specifications#1483

Note for the Crystal track:

Since the the following case group descriptions do not appear in the
test file (for example, as a `describe` or a `context`), test
descriptions may be considered to be missing some context. However, this
has always been the case, so this does not worsen the state of the
world, only keep it about as bad as it always has been.

https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L22
https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L71
https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L152
petertseng pushed a commit to petertseng/exercism-crystal that referenced this pull request Nov 1, 2019
The current [Test] names confused me when I was doing the exercise. It
was also difficult to see which tests failed, because of long test
descriptions combined with a small window with the test results.

This PR changes the
"Returns true if the triangle is equilateral false if any side is unequal"
style in favour of a pattern that follows
"equilateral triangle returns false if any side is unequal".

exercism/problem-specifications#1483

Note for the Crystal track:

Since the the following case group descriptions do not appear in the
test file (for example, as a `describe` or a `context`), test
descriptions may be considered to be missing some context. However, this
has always been the case, so this does not worsen the state of the
world, only keep it about as bad as it always has been.

https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L22
https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L71
https://github.com/exercism/problem-specifications/blob/master/exercises/triangle/canonical-data.json#L152
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.

None yet

3 participants