Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
CUS 1185 Data Security and Cryptography
This assignment assesses your basic knowledge of Java and JUnit, which you will need for future assignments and projects.
To complete the assignment, you must complete the following tasks:
(If you do not know how to extract a “tar.gz” archive, you should be able to find plenty of resources on how to do that online–ask on Ed Discussion otherwise.)
○ Directory <dir>/src contains, in a suitable directory, the Java interface edu.gatech.seclass.MyStringInterface. It also contains an exception class edu.gatech.seclass.MyIndexOutOfBoundsException, which is used by the interface.
○ Directory <dir>/test contains, in a suitable directory, a template JUnit test class edu.gatech.seclass.MyStringTest.
○ File <dir>/lib/junit-platform-console-standalone-1.9.0.jar, a JUnit library to be used for the assignment
○ Replace the text “<Add test description here>” 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). When testing for an expected exception, make sure to assert as follow:
assertThrows(<exception_class_name>.class, () ->
mystring.<method_name>(..args))
○ Consider, for example, test case testCountStringsS2():
@Test
@Timeout(value = 5000, unit = TimeUnit.MILLISECONDS)
// Description: <Add test description here>
public void testCountStringsS2() {
fail(“Not yet implemented”);
}
In your submission, you should have a corresponding, complete test for method
countStrings in class MyString, together with a concise description of the
purpose of the method, such as:
@Test
@Timeout(value = 5000, unit = TimeUnit.MILLISECONDS)
// Description: Count strings in an empty string
public void testCountStringsS2() {
<actual test, including the oracle>
}
Submission
To submit your solution, you should:
like the following:
submission.txt
gpburdell1
81b2f59
As soon as you submit, your assignment will be graded by compiling your code and running it against both your test cases and a set of test cases, written by the instructors.
All tests must pass.1 After that, which should take a few minutes at most, you will see a report with your grade and some corresponding feedback. The feedback should be self-explanatory (e.g., “ERROR: You have 16 tests instead of 15.”), but please let us know otherwise.