The Assignment 1 Test Suite

For Assignment 1, you will submit a .jar file to CMS containing all of your classes and source code. See the Assignment 1 description for instructions on creating this .jar file.

Part of your grade will be based on automated testing of this .jar.

A1ComplianceTool.jar (v3) contains the same tests that we will use for grading. You are strongly encouraged to run this tool on your .jar before you turn in your assignment. It will catch simple errors, such as forgetting to include your source code in the .jar, and it may also reveal subtle errors in your implementations.

The test suite can also test your individual classes, so you can debug without continually re-building your .jar.

How to run the test suite

  1. Download A1ComplianceTool.jar (v3)
  2. Add it to your Eclipse project as a library, in the same way you added cs2110a1.jar.



  3. Create a new run configuration. The main class is cs2110.assignment1.test.A1ComplianceTool.
    (clicking on the "search" box will let you find this by typing "A1")
    Put the full path to your assignment .jar file as the argument. (put the path in quotes if it contains spaces)




  4. The test suite produces a report in the console. Reading through this report should give you a good idea of where your program breaks. A successful run looks like this:
    [Assignment 1 Compliance Tool version 1]
    [Random seed = 12345   (this will differ for grading)]
       Opening my_assignment.jar...
    [OK]     Load Jar File
    [OK]     Contains correct DNAParser implementation
    [OK]       Search Jar for implementations
    [OK]       Check implementations for correctness
               >>>>>>>> ljp37.assignment1.MyDNAParser implements DNAParser
    [OK]         Test implementation correctness
    [OK]           Has constructor "public Classname(String DNA)"
    [OK]           Test one gene
    [OK]           Test unterminated gene
    [OK]           Test zero genes
    [OK]           1000 random DNA sequences of length 50
    [OK]           1000 random DNA sequences of length 900
    [OK]         Source code included in Jar
    [OK]     Contains correct Genome implementation
    [OK]       Search Jar for implementations
    [OK]       Check implementations for correctness
               >>>>>>>> ljp37.assignment1.MyGenome implements Genome
    [OK]         Test implementation correctness
    [OK]           Has default constructor
    [OK]           Test one gene
    [OK]           Test random genes
    [OK]         Source code included in Jar
    [OK]     Contains correct SpeciesReader implementation
    [OK]       Search Jar for implementations
    [OK]       Check implementations for correctness
               >>>>>>>> ljp37.assignment1.MySpeciesReader implements SpeciesReader
    [OK]         Test implementation correctness
    [OK]           Has constructor "public Classname(String filename) throws IOException"
                 [OK]      DOS line breaks (\r\n)
                 [OK]      UNIX line breaks (\n)
    [OK]           Determine line break type
    [OK]           Test Biscuit.dat
    [OK]           Test Biscuit.dat with gratuitous whitespace
    [OK]           Assorted species collection
    [OK]           Non-existent file throws exception
    [OK]         Source code included in Jar
    -------------------------------------------------------------
    Summary of top-level tests:  4 successful out of 4
    SUCCESS
    
    
  5. To individually test your SpeciesReader, Genome, and DNAParser implementations, create a run configuration for each.

    The main classes, respectively, are:
    1. cs2110.assignment1.test.SpeciesReaderTest.main
    2. cs2110.assignment1.test.GenomeTest.main
    3. cs2110.assignment1.test.DNAParserTest.main
    Each main class takes a single command-line argument, the full java path to your class.


If I pass all the tests, will I get a 100% grade?

Not necessarily. We will also be inspecting your source code for comments, style, etc. Additionally, we will recompile all of your sources and subject them to the test suite.

Can I have the source code for the test suite?

Sure! testSuiteSource.zip contains the code for the test suite, version 2. It does not contain code for the reference implementation cs2110.assignment1.solution.*, so this source will not be sufficient for you to rebuild the test suite. The test suite also depends on the TestNG unit test library.