Hi everyone, this is my first time here. I’m working through the C track and having fun with the exercises, and I found a couple bugs in the test suite that I downloaded through the CLI which were not present in the test suite online, and gave me a bit of a surprise when my code that was running well on my machine failed on submission.
I’d like to correct the tests so that anyone coming to the exercise in the future will have an easier time of it. Should I create a pr for this, and what would be the process for that? Thanks.
all but 1 of the tests had TEST_IGNORE(); at the start of the body,
so none were being run. also, test_serine_rna_sequence_4 expected a sequence of 1 protein, but had its count set to 2, and test_incomplete_rna_sequence_can_translate_if_valid_until_a_stop_codon expected 2 proteins, but had its count set to 1.
The TEST_IGNORE macros are meant to help you focus on one test at a time, similarly to Test Driven Development (TDD).
Write your solution so that it passes the current test, clean up your code, and then move on to the next test by removing or commenting out the next TEST_IGNORE(); line.
Oh, I see. I was mistaken about the intent of the tests. Nonetheless, there are those errors in the expected count of those two tests that create false positives.
Is this not too rudimentary an exercise to expect users to write code to pass 31 different but related tests one at a time? To my mind, that method of development might lead new users to design for the individual test cases, so they would miss the big picture and fail to create a solution that was idiomatic and clear.
Oh, thanks for replying with the test cases there.
the CLI version is exercism version 3.1.0. How do I check the downloaded exercise version? I noticed when I tried to download a fresh copy that it downloaded my previous submission, instead.
Is this not too rudimentary an exercise to expect users to write code to pass 31 different but related tests one at a time?
A lot of programmers find TDD and the “red-green-refactor” cycle helpful. It’s pretty well-known with a lot of publications, talks, and success stories.
But you are not required to follow that methodology. If you want you can delete or comment out those TEST_IGNORE() lines all at once. Do what you like and what helps you the most.
AFAIK the version of the CLI has nothing to do with the content that it downloads. I don’t think our exercises have version numbers.
Do you mind comparing the two tests “manually”?
The exercism CLI downloads your latest submission. If you want to start all over you could go to the online editor and use the menu on the upper right corner (the “meatballs menu” with the three dots ···) to revert the exercise to the original stub.
But if an exercise (description, stubs, tests, makefiles, …) gets updated you have to explicitly opt in. Do you see a banner “This exercise has been updated. Update to the latest version and see if your tests still pass.” at the top of Protein Translation in C on Exercism ?
A lot of programmers find TDD and the “red-green-refactor” cycle helpful. It’s pretty well-known with a lot of publications, talks, and success stories.
I definitely use tests everywhere possible in my own code, although sometimes when prototyping those tests are pretty basic themselves.
My question was more to do with whether this would be a useful granularity of testing for beginners. I realize it’s subjective, but I believe that following each test as intended will cause some users to get lost in the sauce with writing a little code to pass one test, failing the next one, adding some logic to pass that case, and rinse-and-repeat ad nauseam. I could be way off, of course – I’m not the beginner I’m thinking of, and I didn’t start to learn by that approach, either. I was trying to think from a newcomer’s perspective, which is at least a good exercise in and of itself.
I did try starting the exercise all over, and the bugs with the count in the test are not present. My guess is that I somehow did something when I commented out the ignore macros. Or possibly, it was butterflies?