Skip to content

leap: Updated exercise to 1.4.0 version #753

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

Merged
merged 2 commits into from
Nov 24, 2018

Conversation

ZapAnton
Copy link
Contributor

@ZapAnton ZapAnton commented Nov 19, 2018

This PR syncs the leap exercise with the problem-specifications repo.

It introduces the following changes:

  • Adds all the cases from canonical data. The cases that were present in the suite were not present in the canonical version, so I added new cases in a test_description_in_lowercase format. The old cases were not touched (except the one that checked the 1996 year - it was present in canonical data, so I replaced it with the formatted case). Perhaps some old test cases could be deleted?

  • Replaced i32 argument type with u64 - no negative years are expected, so I thought it would make sense

Relevent PR: exercism/problem-specifications#1359

@petertseng petertseng added the sync/tests Keep a test suite/version in sync with exercism/problem-specifications label Nov 19, 2018
@petertseng
Copy link
Member

petertseng commented Nov 19, 2018

For this update to leap, note that there are multiple PRs that fall within the definition of "relevant PR" since this one spans multiple versions 1.0.0 through 1.4.0. I usuallly would use something like https://github.com/exercism/problem-specifications/pulls?q=is%3Apr+leap+is%3Aclosed to find them, or git log exercises/leap/canonical-data.json. In this case:

(in addition to the 1.3.0 -> 1.4.0 update you already linked)

Copy link
Member

@coriolinus coriolinus left a comment

Choose a reason for hiding this comment

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

I'm going to give this until tomorrow for discussion, then merge if no objections have arisen.

@ZapAnton
Copy link
Contributor Author

Still not sure about the old, track-specific tests. Will they not overload the students?

@coriolinus
Copy link
Member

In this respect my approach differs from Exercism's official policy: I personally always immediately remove all #[ignore] tags before beginning a new exercise, and write code which solves all tests simultaneously. It produces the same result as approaching the problem incrementally, while ensuring that I don't start heading down architectural routes which turn out not to work with the requirements of later tests.

In a professional context, assuming a well-managed project, coders deal with test suites comprising thousands of tests. If a dozen fail because of a change you made, you just have to deal with it. I therefore believe that we should encourage students not to be afraid of a bunch of test failures, but to embrace them: each one tells you about something your code needs to do.

To answer your question for myself, then, I'd say no, students won't be overwhelmed: correct code will pass all tests anyway; incorrect code can always use more examples of what outputs should correspond to what inputs.

To answer your question speaking ex officio as the track maintainer, I'd say that by maintaining a track policy of preferring to add tests without removing them, we are simultaneously following good project management practices and encouraging students to view tests as a bulk product for code improvement, not as individual hurdles which must be cleared.

Copy link
Member

@petertseng petertseng left a comment

Choose a reason for hiding this comment

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

are duplicates a concern? noting that 1800 and 2000 appear in both old and new.

@coriolinus
Copy link
Member

coriolinus commented Nov 20, 2018 via email

@coriolinus coriolinus merged commit 840ff98 into exercism:master Nov 24, 2018
@ZapAnton ZapAnton deleted the update_leap branch November 25, 2018 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sync/tests Keep a test suite/version in sync with exercism/problem-specifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants