|
DeveloperGuide
How to work with or contribute to the source code.
Prerequisites
Background InfoPlease see the UserGuide Wiki Steps1) Use SVN to check out the source code. (See the Source tab, above.) This will give you a copy of all the source files. 2) Simply type: ant to build the system. This will invoke Ivy to download and install all necessary 3rd party libraries, which include WattDepot and various QA tools used by this project. 3) If modifying the code, run: ant -f verify.build.xml afterwards. This will run a number of automated QA tools (including Checkstyle, PMD, and FindBugs). Quality AssuranceAs stated above, our project uses automated QA tools. They are downloaded (if required), installed, and run as part of the build process when using Ant. To make sure your code adheres to our standards, please invoke ant –f verify.build.xml when adding code to the system. This runs the tools but does not produce reports. In order to view reports from a tool, invoke the command as shown below. You can then find a detailed report in the appropriate sub-directory of the build/ directory.
DocumentationOur documentation is here on Google Project Hosting, in the Javadoc comments and the generated Javadoc API, and throughout the code in the form of non-javadoc comments. To create the Javadoc API html pages, execute: ant –f javadoc.build.xml and point your browser at: <project root>/build/javadoc/index.html Automated TestingYou can find the JUnit test cases in the src directory and they are named Test*.java. They are run automatically when compiling or verifying the system. To produce a report, invoke: ant –f junit.build.xml and point your browser at: <project root>/build/junit/index.html Code Coverage of JUnit TestsTo create a code coverage report using Jacoco, execute: ant -f jacoco.build.xml and point your browser at: <project root>/build/jacoco/report/index.html Manual TestingManual testing is accomplished by running the program with valid and invalid input, and examining the output. For example, manual testing is used to check that the input-processing loop continues to loop regardless of the quality of input given. It is also used to check the formatting of command output. To test to see how bad input is handled, use an invalid tower or lounge name, incorrect command name, or a bad or an improperly formatted date. Enhancing the CodeTo add a command to the system, first add the new command name in the static final Array commands located in: <project root>/src/edu/Hawaii/halealohacli/command/Commands.java Then, implement your new command in the <project root>/src/edu/Hawaii/halealohacli/command directory, for example: <project root>/src/edu/Hawaii/halealohacli/command/MaxPowerSince.java Your new class should follow the pattern of the existing classes and must implement the methods declared in the Command interface: <project root>/src/edu/Hawaii/halealohacli/command/Command.java It would be easiest to use an existing command as a template, change the class name, and then add the functionality you desire. Development Guidelines for Collaborators
Coding StandardsIn our project we adhere to strict Java CodingStandards. They have their own Wiki page. These standards are based upon those found in the book The Elements of Java Style We also use an Eclipse Java Code formatting template eclipse.format.xml which can be found in Downloads. Continuous IntegrationOur project uses the Jenkins server for continuous integration. The URL is: http://dasha.ics.hawaii.edu:9859/job/hale-aloha-cli-jz/ Please do not committ code unless it passes the Ant verify target. |