CS 257: Software Design

EncodingHelper, Phase 2

Continue with the partner you worked with to get set up in IntelliJ, Bitbucket, and git.

The other day in class, I asked you to suggest features for a character-encoding programmer's utility. Not surprisingly, most of the features centered on the translation among the many different ways of representing characters and strings.

For the next phase of this project, you will develop core computational methods for the EncodingHelper, along with JUnit tests to ensure the correctness of those methods. In the third and final phase of the project, you will build on the computational core to develop the command-line interface of a useful program.

The EncodingHelperChar class

You will implement two classes: EncodingHelperChar and EncodingHelperCharTest. Each EncodingHelperChar object represents a single Unicode character, which can be initialized via several constructors. The class also has a collection of methods that (once you implement them) will return various representations of the character. The comments in EncodingHelperChar.java describe the methods you need to implement. Do not change the method signatures.

The EncodingHelperCharTest class is yours to implement as you see fit. It should consist of JUnit test cases, at least one per method (including constructors) in EncodingHelperChar. For some of the methods, you may want to implement multiple tests for various boundary cases.

For the getCharacterName method in EncodingHelperChar, you will need the file UnicodeData.txt. Because git compresses data and UnicodeData.txt is only a bit over 1MB, you can just download a copy of this file and include it in your EncodingHelper repository.

Notes about IntelliJ

To create your EncodingHelperCharTest.java in IntelliJ: click on the word EncodingHelperChar in the class declaration at the top of EncodingHelperChar.java. IntelliJ should show you a little yellow lightbulb. Click on that and select "Create Test" and then use the wizard that pops up.

You may discover that when you first create your test file, the "@Test" lines show up in red to indicate an error. Click on Test to get the red lightbulb. Then click on the red lightbulb and select the option that adds JUnit to your classpath. You should never have to do that again for your installation of IntelliJ.

Handing it in

Submit your program by committing it to your bitbucket repository and tagging it with a tag named "phase2".

Have fun!