Tips for Assignment 1

  1. Start Eclipse and create a workspace for your CS414 assignment projects. 
    This is a directory for Eclipse to store Java, class and metadata files in.

    workspace.cs414


  2. Create a Java Project for assignment 1.
    You may select File --> New --> (project, class, etc.), or Right-Click on the Package Explorer pane to create new items.
    Provide a project name (cs414dla1), use an execution environment that is JavaSE-1.6 or higher. Create separate folders for source and class files.

    create a Java Project for assignement 1

  3. Select the new project. Using the menu options, create a package with the name cs414dl.a1.yourEid.

    create a package for assignement 1

  4. Next, consider how to approach the assignment. It is clear that the Implementation of the methods should be done after the test cases.

    "Remember that you're doing test-first development.
    Write a unit test first, then write the code that will pass it. Iterate on this.
    You'll turn in your test code in addition to the code for World and Coordinate classes."


    However, Eclipse will create empty test stubs for any method signatures it finds in the classes under test (World and Coordinate).
    So, it is helpful to define at least one method, so you can see what a stub looks like.

  5. Create a "World" Java class and define the method signatures.  You can change them later if you need to.
    ***Please be sure to put it in a package named according to the instructions.

    create a World class. Please use a package.

  6. Create  a "Coordinate" Java Class and method signatures as you did the "World" class.


  7. Create a New JUnit Test Case for the World Class. 
    Eclipse defaults to naming this "WorldTest," which is fine.


    New JUnit Test Case for World Class


  8. Choose the methods in World that you wish to create test stubs for.
    You will only be offered methods which you have already defined headers for.
    You may be asked to add JUnit to the build path. Do so.
    Implement test methods

  9. Implement WorldTest. 
    Create JUnit tests for the methods in World.
    Investigate the types of assertions you may use from the TestCase superclass.
    Create dummy test methods and "Run... JUnit Tests" to see how things work.
    Implement CoordinateTest the same way.

    Implement tests

  10. Implement the TestAll class so that it will run all the other tests (see the Fowler text).

  11. Create an overview.txt document in the Eclipse project (File --> New --> File) as described in the assignment.

  12. Create a jar to submit in RamCT.  Select the project in Eclpse, and click  File --> Export...
    Select Java --> Jar File  <Next>
    Check ONLY "Export java source files and resources"
    Name the jar file "a1-yourEID.jar" and place it somewhere easy for you to find. 
    Select "Create Source Folder Structure".
    Click Finish.

    export the a1.jar file


  13. Use a file explorer or the command line 'jar' utility to check the contents of the file.
    Are all of the required files inside?  Are your source files in the package directory?
    Note that the actual file sizes will be much larger than the ones shown in the figure.

    Confirm jar

  14. Check the a1-bob.jar file into the RamCT assignment 1 drop box.