CS 232
Algorithms
Skyline
Testing
Steven K. Andrianoff
Coty Collins
David B. Levine
Computer Science Department
St.
Bonaventure University
Copyright, 2013
Objective
By the conclusion of this lab period, you will have:
1. Gained experience with unit testing and the Corona Test Generator.
2. Authored test cases for the Skyline project.
Background
The goal is to create a simple JUnit test. You may have done this before by hand, but the Corona Test Generator is a tool to make Unit test generation quick and easy.
Instructions:
Launch Eclipse and start a new project. Add Corona.jar, SkylineHelper.jar, Hopeful.jar, and Buggy.jar to your project.
Add Corona.jar, SkylineHelper.jar and either Hopeful.jar or Buggy.jar to the build path of your new project. To do so, right click on the particular .jar file and choose Build Path:Add to Build Path.
Right-click on the project and choose Build Path:Add Libraries. Choose to add JUnit and select version 4.
Right-click on Corona.jar and select Run as...:Java Application. This will launch the Corona Test Generator. Select CoronaJavaFrame as your application to run.
Enter your name in the name field. Then choose to Add Stateless Test. Test the makeSkyline method within the Skyline class. Name the test according to the convention discussed in class, i.e. “test(Your initials)2014OneBuilding”. Enter the appropriate data for the input parameters, the output parameters and the comments (Notes field). Press Okay when you are done with this test.
When your test suite is complete, click on the Generate button. This will generate the JUnit code for the tests; save the file somewhere OUTSIDE your project. Then, using Windows Explorer, copy the file and using Eclipse paste it in to the src folder. You should see the file containing your TestCase in the default package. You can then run the generated test case by right-clicking on it, and selecting Run as...:JUnit Test. If the expected output matches the actual output derived from the given input, you will see a green bar and a summary of the tests run.
You are now ready to add more tests. You can return to the Corona Test Generator window and add more. You may save your progress at any time as demonstrated in class. You can also test "bogus" tests by removing Hopeful.jar from the Build Path and adding Buggy.jar in its place.
To Hand In:
The file that you named in step 6, can serve as your submission to phase I although you should check that comments are "up to snuff".
Assignment Type (see Academic Practices and Policies Document):
Individual assignment, no collaboration.