{"action":"created","issue":{"url":"https://api.github.com/repos/exercism/x-common/issues/192","repository_url":"https://api.github.com/repos/exercism/x-common","labels_url":"https://api.github.com/repos/exercism/x-common/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/exercism/x-common/issues/192/comments","events_url":"https://api.github.com/repos/exercism/x-common/issues/192/events","html_url":"https://github.com/exercism/x-common/issues/192","id":139319316,"number":192,"title":"largest-series-product: Should tests test for implementation details (slices, digits)?","user":{"login":"petertseng","id":346181,"avatar_url":"https://avatars.githubusercontent.com/u/346181?v=3","gravatar_id":"","url":"https://api.github.com/users/petertseng","html_url":"https://github.com/petertseng","followers_url":"https://api.github.com/users/petertseng/followers","following_url":"https://api.github.com/users/petertseng/following{/other_user}","gists_url":"https://api.github.com/users/petertseng/gists{/gist_id}","starred_url":"https://api.github.com/users/petertseng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petertseng/subscriptions","organizations_url":"https://api.github.com/users/petertseng/orgs","repos_url":"https://api.github.com/users/petertseng/repos","events_url":"https://api.github.com/users/petertseng/events{/privacy}","received_events_url":"https://api.github.com/users/petertseng/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-08T16:15:54Z","updated_at":"2016-03-22T19:54:45Z","closed_at":"2016-03-22T19:54:21Z","body":"I've mentioned in [a previous comment](https://github.com/exercism/todo/issues/13#issuecomment-174045677), but I'm taking out just the relevant points here:\r\n\r\nSome tracks' test suites for largest-series-product too severely funnel students toward a particular implementation whereas there are at least two implementations to choose between (1. generate all slices, find all products, choose the max. vs 2. iterate all digits once, keeping a sliding window and the maximum product seen). They test internal implementation details (some helper functions) instead of the actual problem (Finding the largest series product!). This means that for my Haskell and Clojure submissions for this problem I was \"forced\" to write a helper function that my actual submission doesn't use to find the largest product.\r\n\r\n**I propose that all tracks that implement largest-series-product remove tests for implementation details, and just leave tests for the actual problem**. Note that this was previously done for the Ruby track in https://github.com/exercism/xruby/issues/10, and that I deliberately chose not to include implementation details in the JSON shared test data at https://github.com/exercism/x-common/blob/master/largest-series-product.json#L7\r\n\r\n(To make it clear, I'm fine with personally submitting PRs to execute this proposal myself, but I'd like to get consensus before I know that I should actually do that)\r\n\r\nPlaying devil's advocate against myself, there is a distinct advantage of writing test suites that guide students toward a solution: They give students hints on a potentially hard problem. This is actually a fine thing to do! But I wish there were a way of giving hints that didn't restrict students like this. Maybe I suggest how Elixir did it here? https://github.com/exercism/xelixir/tree/master/exercises/zipper/hints\r\n\r\nYet another advantage of writing test suites in this way: It's a good thing to get students in the habit of testing helper functions so that they can build larger solutions from smaller parts that they know to be working. But I'm going to argue here that this should be up to the student to do this! Any way to guide them in that direction? Recall that many tracks that implement largest-series-product also implement series (which is where it makes sense to test the `slices` and `digits` functions!).\r\n\r\nGiven that I think most largest-series-product appear late in their respective tracks (at a stage where students should know how to test internal details themselves, plus anyone who hasn't been skipping around has already written `series` if applicable for their track), I think this is reasonable to do, but I'd like to hear anything I missed.\r\n\r\n---\r\n\r\nAppendix:\r\n\r\nThe list of tracks with largest-series-product: \r\nhttp://x.exercism.io/problems/largest-series-product\r\n\r\nWith series:\r\nhttp://x.exercism.io/problems/series\r\n\r\nSo, languages that have LSP but not series:  clojure, elixir\r\n\r\nI put links to the largest-series-product subdirectory for each track in https://github.com/exercism/todo/issues/104#issuecomment-174168732\r\n\r\nI believe the languages that test digits/slices are:\r\nclojure, csharp, ecmascript, elixir, haskell, javascript, perl5, python, scala\r\n\r\n(I also made a mistake with csharp - the case for empty string and 0 span should be a product test, not a slice test)"},"comment":{"url":"https://api.github.com/repos/exercism/x-common/issues/comments/199989483","html_url":"https://github.com/exercism/x-common/issues/192#issuecomment-199989483","issue_url":"https://api.github.com/repos/exercism/x-common/issues/192","id":199989483,"user":{"login":"kytrinyx","id":276834,"avatar_url":"https://avatars.githubusercontent.com/u/276834?v=3","gravatar_id":"","url":"https://api.github.com/users/kytrinyx","html_url":"https://github.com/kytrinyx","followers_url":"https://api.github.com/users/kytrinyx/followers","following_url":"https://api.github.com/users/kytrinyx/following{/other_user}","gists_url":"https://api.github.com/users/kytrinyx/gists{/gist_id}","starred_url":"https://api.github.com/users/kytrinyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kytrinyx/subscriptions","organizations_url":"https://api.github.com/users/kytrinyx/orgs","repos_url":"https://api.github.com/users/kytrinyx/repos","events_url":"https://api.github.com/users/kytrinyx/events{/privacy}","received_events_url":"https://api.github.com/users/kytrinyx/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T19:54:45Z","updated_at":"2016-03-22T19:54:45Z","body":"Thanks so much for taking the time to get all of this cleaned up!"}}