Assignment Task
Your first task is to develop a Java class called MyString that suitably implements the MyStringInterface interface that we provided. (The semantics of the methods in the interface should be obvious from their name, the JavaDoc comments in the code, and the test examples in class MyStringTest--ask on Ed Discussion otherwise.) Class MyString should be in the same package as the interface and should also be saved under.
Your second task is to develop a set of JUnit5 test cases for class MyString by completing the provided template test class MyStringTest, which contains 3 complete test cases and 13 to-be-completed test cases. For each test case in class MyStringTest whose body simply consists of the placeholder “fail("Not yet implemented");”, you must do the following:
- Replace the placeholder instruction with a meaningful test case for the corresponding method, which is indicated in the comments and name of the test.
- Replace the text “” in the test comment with a concise description of the purpose of the test (e.g., “Count strings in an empty string”) without modifying anything else in the comment and making sure that your comment consists of a single line (i.e., does not contain newlines) and does not contain quotes or other special characters.
- Make sure that every test method has a suitable oracle (i.e., either an assertion or an expected exception) and that the tests are not trivial (i.e., are not a copy of the provided one and have a specific purpose). In other words, each test should (1) test a specific piece of the functionality, and (2) check that such a piece of functionality behaves as expected.
- It should be obvious, but please also make sure that all the test cases you created pass when run against your code.
- In addition, at least two of the tests that you develop must result in an expected exception (e.g., NullPointerException)
This IT and Computer Science has been solved by our PHD Experts at My Uni Paper.