Skip to content
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

simple-cipher: update tests and add version file #1475

Closed
FridaTveit opened this issue Jun 5, 2018 · 16 comments
Closed

simple-cipher: update tests and add version file #1475

FridaTveit opened this issue Jun 5, 2018 · 16 comments

Comments

@FridaTveit
Copy link
Contributor

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.

@FridaTveit FridaTveit added the code label Jun 5, 2018
@RonakLakhotia
Copy link
Contributor

@FridaTveit Can I give this a try?

@sjwarner-bp
Copy link
Contributor

Go for it @RonakLakhotia 🎉

@RonakLakhotia
Copy link
Contributor

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

@sjwarner-bp
Copy link
Contributor

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 🙂

@RonakLakhotia
Copy link
Contributor

sure. No problem 👍

@FridaTveit
Copy link
Contributor Author

@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? 🙂

@RonakLakhotia
Copy link
Contributor

RonakLakhotia commented Aug 15, 2018

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

@anurag-rai
Copy link
Contributor

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?

@FridaTveit
Copy link
Contributor Author

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! 😄

@hgvanpariya
Copy link
Contributor

@FridaTveit : anyone is working on this ?

@FridaTveit
Copy link
Contributor Author

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

@anurag-rai
Copy link
Contributor

please feel free to work on it :)

@hgvanpariya
Copy link
Contributor

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

@hgvanpariya
Copy link
Contributor

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

hgvanpariya added a commit to hgvanpariya/java that referenced this issue Oct 12, 2018
hgvanpariya added a commit to hgvanpariya/java that referenced this issue Nov 6, 2018
hgvanpariya added a commit to hgvanpariya/java that referenced this issue Nov 18, 2018
@RonakLakhotia
Copy link
Contributor

@FridaTveit is this issue still valid?

@FridaTveit
Copy link
Contributor Author

@RonakLakhotia yes 🙂

FridaTveit pushed a commit that referenced this issue Mar 18, 2019
* Update version file v2.2.0 --> v2.3.0

* Add exceptions for value not found

* Update tests

* Remove unrelated changes

* Remove checkstyle violations

* Make Code quality changes

* Make design changes

* Fix code quality issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants