My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
DeveloperGuide  
How to work with or contribute to the source code.
Updated Nov 28, 2011 by zach.tom...@gmail.com

Prerequisites

  • Java JDK 1.6+
  • Ant
  • Eclipse (optional)

Background Info

Please see the UserGuide Wiki

Steps

1) 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 Assurance

As 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.

  • ant –f checkstyle.build.xml
  • ant –f pmd.build.xml
  • ant –f findbugs.build.xml

Documentation

Our 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 Testing

You 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 Tests

To 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 Testing

Manual 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 Code

To 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

  • Open a related Issue before making any significant code changes.
  • CC the other developers when you do this so they are aware of your work.
  • Do not commit any code that does not pass verify.build.xml.

Coding Standards

In 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 Integration

Our 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.


Sign in to add a comment
Powered by Google Project Hosting