Problem-specifications: rna-transcription: Test long input

Created on 28 Jun 2019  Â·  7Comments  Â·  Source: exercism/problem-specifications

In mentoring for the Elixir track (which uses an immutable linked list as input) I've noticed that students can be very inefficient in creating their output list (i.e. appending each item to the end of the output at O(n) instead of prepending at O(1)). To showcase this inefficiency, I've added a new test to the Elixir suite, testing a simple input 500,000 "nucleotides" long. Any of the proper solutions can pass this in under 200ms, but an inefficient solution will take impossibly long. Perhaps there are other languages where this could also be a valuable teaching moment for students who don't fully understand the data type with which they're working.

Most helpful comment

This feels like a good case for a track-specific test, not a
general-purpose one.

On Sat, Jun 29, 2019 at 9:23 AM Norbert Melzer notifications@github.com
wrote:

Yes, I think this is a good case for an optional test.

I'm not sure though if its worth to blow the JSON-file that much… Adding
~1MB of input and expectation…

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/exercism/problem-specifications/issues/1543?email_source=notifications&email_token=AB3V4TTHOJ46TAQYO54LBIDP44EXZA5CNFSM4H4IJYTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY3TRNY#issuecomment-506935479,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB3V4TUHNHHLE3RUD2IJNODP44EXZANCNFSM4H4IJYTA
.

All 7 comments

Yes, I think this is a good case for an optional test.

I'm not sure though if its worth to blow the JSON-file that much… Adding ~1MB of input and expectation…

This feels like a good case for a track-specific test, not a
general-purpose one.

On Sat, Jun 29, 2019 at 9:23 AM Norbert Melzer notifications@github.com
wrote:

Yes, I think this is a good case for an optional test.

I'm not sure though if its worth to blow the JSON-file that much… Adding
~1MB of input and expectation…

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/exercism/problem-specifications/issues/1543?email_source=notifications&email_token=AB3V4TTHOJ46TAQYO54LBIDP44EXZA5CNFSM4H4IJYTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY3TRNY#issuecomment-506935479,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB3V4TUHNHHLE3RUD2IJNODP44EXZANCNFSM4H4IJYTA
.

This could definitely be a track-pertinent test, but yeah there's no obvious method for expressing it in the problem specifications without blowing up the size of the canonical data file. Besides that it would be extremely language specific; in Python's case it would be precise opposite effect -- 500K insertions would be crippling, but 500K appends will be fine -- but I've not yet seen anyone choose insert over append, so I'd be surprised if the test ever failed.

Yeah, for python I assume that something similar to javas string builder is used internally.

Saying this, I think not only Functional languages would profit from this test when lists are used wrong, but perhaps a Java as well, when not the wrong operation is choose but the wrong data type.

I have to say though, I'm not aware if java actually uses strings or something else for this tests that wouldnt be affected...

Good points, guys. I didn't fully understand the concept of problem-specifications, at first; now I see why this is better implemented at a track-specific level.

I also think this is one for the track specific tests. In JS and TS, rna-transcription is purposefully simple and allows for O(n) (and that'll stay). In fact, there are plenty of languages where this can not be optimised.

Since we already have 3+ agreeing to move this to the track level, let's close this. @miread would you like to open an issue or even PR at the Elixir repo?

Thanks @SleeplessByte - I've already opened up an issue and a PR to resolve it. ;)

Was this page helpful?
0 / 5 - 0 ratings