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

Update Pangram test case from cannonical data #349

Closed
ricemery opened this issue Mar 28, 2017 · 9 comments
Closed

Update Pangram test case from cannonical data #349

ricemery opened this issue Mar 28, 2017 · 9 comments

Comments

@ricemery
Copy link
Member

Update Pangram test case from cannonical data. The test suite is out of date.

ricemery added a commit to ricemery/xscala that referenced this issue Mar 28, 2017
ricemery added a commit to ricemery/xscala that referenced this issue Mar 28, 2017
@ricemery
Copy link
Member Author

Oops this is a dupe of #331.

@lpalma
Copy link

lpalma commented May 11, 2017

I just spotted an approved iteration for this exercise with a bug that is not caught in the current test cases:

object Pangrams {
  def isPangram(s: String): Boolean =
    s.filter(_.isLetter)
      .distinct
      .length == 26
}

The bug is with sentences containing upper and lower case of the same character,
which is caught in this test case

@ricemery
Copy link
Member Author

ricemery commented May 11, 2017 via email

@lpalma
Copy link

lpalma commented May 11, 2017

Have you thought of another test case that could be added that would indicate the code is incorrect?

not really. Since the test case mentioned already catches this particular bug, I think it is enough to add it to the track. I don't see much value in having multiple tests for the same scenario.

In any case, should we update the exercise, or wait for #331?

My initial comment was more like calling our attention to reassure the importance of keeping tests up-to-date.

@ricemery
Copy link
Member Author

ricemery commented May 11, 2017 via email

@lpalma
Copy link

lpalma commented May 11, 2017

I am confused..
What do you mean by "approved" iteration for the exercise?

Ah, sorry about that. Maybe Approved is not the right word.

Firstly, the code I mentioned in my first comment is a student's solution.

The student submitted the code and another student gave a thumbs up (that's what I meant by approved). I spotted the bug because I was checking other students solutions and was surprised to see that this student's code passed the tests.
So, I commented in the student's iteration, informing the bug and the lack of test coverage, then I came
here to open an issue, but saw this related issue already opened.

The fact that the student's solution passed the tests and was even complimented (pressed the Looks great! button) by other student raised an alert on my head, about the importance of keeping tests up-to-date.

@ricemery
Copy link
Member Author

ricemery commented May 11, 2017 via email

@abo64
Copy link
Contributor

abo64 commented May 12, 2017

@lpalma You are right, I just oversaw the problem with case in that solution. So I retracted my "approval" thumbs up.

The thing to do here IMO is to

  • have a list of all exercises either in Sync Up Existing Test Suites with x-common #331 or a new issue.
  • then go through add test suite generators to all of them and update their test suite.
  • install a mechanism that checks whether the test suite version is out of date.

All in all a major endeavour but probably inevitable?

@ricemery
Copy link
Member Author

Closing. The original issue was addressed.

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

No branches or pull requests

3 participants