Java: simple-cipher: update tests and add version file

Created on 5 Jun 2018  路  16Comments  路  Source: exercism/java

The simple-cipher tests should be updated to exactly match the canonical data. Also a version file should be added to match the canonical data version.

code hacktoberfest

Most helpful comment

@FridaTveit I think I get your point. Will give it a try now and get back to you if I face issues. Thanks 馃槃

All 16 comments

@FridaTveit Can I give this a try?

Go for it @RonakLakhotia :tada:

@FridaTveit @sjwarner-bp for the case of "Key is made only of lowercase letters", what should be the input string?

I might be misunderstanding, but I also find that bit of the canonical data confusing.

The input object is empty, which is quite different to the rest of them.

I'll take a closer look at the exercise when I am able to, and see if I can make sense of it, otherwise we might have to ask someone in the problem specifications repo :slightly_smiling_face:

sure. No problem 馃憤

@RonakLakhotia I think what you want to test is:

Cipher cipher = new Cipher();
String key = cipher.getKey();

And then check that key only contains lowercase letters. So you don't need an input string because you're not actually encrypting or decrypting anything, you're just checking the key. Does that make sense? 馃檪

@FridaTveit I think I get your point. Will give it a try now and get back to you if I face issues. Thanks 馃槃

Hi, is this open to be discussed? Or is @RonakLakhotia still working on it?
Basically, I wanted to ask:

  1. Three Test modules are currently present but do not match the three cases in the problem-spec. Does this need a rewrite to exactly the spec? The spec has no mention of default Key.
  2. The second case of spec mentions "Substitution cipher". Does it imply default key?
  3. Some extra test cases are currently written (handling of invalid keys) but these are not mentioned in the spec. Will these test cases still be included in the test modules?

Hi @anurag-rai 馃檪 I think it's been long enough that it's safe to assume @RonakLakhotia is not working on it anymore. To answer your questions:

  1. It doesn't really matter if we use three test files or one as long as we use the same tests as the canonical data. I believe we've used three files in this case since the exercise has three distinct steps and rather a lot of tests so it might be easier for the user if they're split into different test files. We've added a hints section to the README explaining how the different test files work. Does anyone else have any strong feelings about using one test file or several @exercism/java? 馃檪
    The first few tests in the canonical data are for "Random key cipher" which will use a randomly generated key which I believe is what you mean by a default key 馃檪

  2. The second case supplies a key to be used for each test 馃檪

  3. If we have tests that aren't in the canonical data then they should be removed. There are a few exceptions when we've needed to test for edge cases that occur in Java but not all other languages. In that case the added test should include a comment explaining why it's deviating from the canonical data. However I can't see anything like that in the simple cipher tests 馃檪

Does that help? Thanks for wanting to contribute! 馃槃

@FridaTveit : anyone is working on this ?

@hgvanpariya I don't think so unless @anurag-rai is working on it? 馃檪

please feel free to work on it :)

Thank you , I'm working on this ...

@FridaTveit : need your code review comments ....

@FridaTveit is this issue still valid?

@RonakLakhotia yes 馃檪

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FridaTveit picture FridaTveit  路  4Comments

stkent picture stkent  路  3Comments

jtigger picture jtigger  路  3Comments

FridaTveit picture FridaTveit  路  6Comments

FridaTveit picture FridaTveit  路  6Comments