Objective
To become familiar with the cmsc132 resources used during the development of class projects. Those resources are:
- Eclipse
- CVS Repository
- JUnit Testing
- Submit Server
Description
-
Eclipse - If you have never used Eclipse you should go through the tutorial and Eclipse installation instructions available at: http://www.cs.umd.edu/eclipse/ . Make sure that you have installed the course management plug-ins as described in the installation document
http://www.cs.umd.edu/eclipse/EclipseTutorial/install.html
If you have used Eclipse before and/or took cmsc131 keep in
mind that you need to have Eclipse 3.3 (the version available through the install link above);
-
CVS Repository - You will be provided with an CVS Repository account that will allow you to:
- Retrieve the initial code distribution associated with a project
- Work from home and school seamlessly (in case you use two computers)
- Backup your work
You can find your CVS Repository account login id and password by accessing http://grades.cs.umd.edu/
. The following web page:
http://www.cs.umd.edu/class/spring2008/cmsc132/resources/cvsRepositoryAccount.shtml
provides all the information you need to set up a connection to your CVS Repository account from Eclipse. Keep in mind you only need to do this once in the semester and once from any computer
you plan to use. Once you have established a connection to your repository, you will be able to retrieve ("check out") project code distributions. In addition, any changes to code
associated with a project will be transferred to the CVS Repository (as long as you are connected to the internet). If you took cmsc131, keep in mind that your old CVS Repository account
is no longer valid.
-
JUnit Testing - JUnit is a testing infrastructure that allow us to write tests for Java code. Every project in this class
is associated with up to four JUnit test modules/classes. Each module/class includes one or more tests. The modules are:
- PublicTests.java - Java class provided with the code distribution for a project.
- ReleaseTests.java - Although you don't have access to this class, you will be able to see whether you pass the tests associated with it by using the submit server (more information
below).
- SecretTests.java - You don't have access to this class and you cannot see the results of the tests.
- StudentTests.java - These are tests you write.
To run a JUnit test in Eclipse choose the JUnit module and select "Run"→"Run As"→"JUnit Test". If you see a green bar your code just passed all the tests associated with the module. Otherwise (brown bar) at least one of the module
tests failed. The following link:
http://www.cs.umd.edu/eclipse/EclipseTutorial/JUnitTesting.pdf
provides information
on how to create JUnit test modules.
- Submit Server - Each time you submit a project via the Eclipse "Submit Project" option a copy of the project is sent to the submit server. Notice that you have a copy of your
code in the CVS Repository and also in the Submit Server (if you have submitted your project). The Submit server allow us to run public, release, secret, and student tests. When you
submit your project all those tests are run. In the submit server you will be able to see the results of public tests; however, you cannot see the results of secret tests. For
release tests you have a limited number of chances (tokens) to see the results. For example, if a project is said to have three release tokens, that implies you have three chances in a 24
hour period to test your code. After a token is used you need to wait 24 hours to use that token again. Notice that you have to explicitly ask for release testing and release
testing is only available after you have passed all the public tests. The earlier you start working on a project the more tokens you will have available.
The submit server also provides code coverage information. Code
coverage represents a measure of how good tests are. If every line of code
in a project is tested by a JUnit test module then you have 100% test coverage. For
this homework you are expected to write tests that provide reasonable code coverage. Additional information
about this requirement will be provided in lecture.
Keep in mind that we use submit server results to compute part the grade associated
with a project therefore you must verify that your project works in the
submit server.
Miscellaneous
- In cmsc132 Eclipse projects are created using the project layout option
named "Create separate folders for sources and class files".
- Make sure you use Java 5 or 6.
What you need to do
For this homework you will implement two methods of a class named Utilities.
A description of the methods you need to implement can be found at javadoc. In
addition you should write tests in the in the file named StudentTests.java (the JUnit
test module) which you will find with the code distribution. Keep in mind that you cannot add any methods to
the Utilities class.
The homework's code distribution is available by
by checking out the module named sampleProj. Verify the quality of
your tests by using the information generated by the submit server and as
described in lecture. Keep in mind that there is no late deadline associated
with this homework.