Algorithms and OOD (CSC 207 2013F) : Labs
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Summary: In this laboratory, you will have the chance to improve your skills regarding code documentation and testing.
Javadoc
Make sure you’ve read the related reading. It might be useful to refer to it by opening it up in a separate tab.
Now it’s time for you to write some comments and generate Javadocs. In the previous lab you had to fix some broken code. Hopefully you’re done fixing it by now and you know how everything works. Your task for today is to thoroughly document every method and generate the Javadoc HTML. Attach those HTML files to the project and push it to your repository.
* Hint: When you generate Javadoc, the HTML files will automatically be added to your project under the doc (documentation) folder.
Unit Testing
Create a JUnit Test Case for your FixedCode class, by right clicking it going to New > JUnit Test Case. Remember that Eclipse will automatically name the class for you so all you have to do is hit next so that you can move onto the Test Methods screen. When you choose the methods you want to test select sumUp()
, removeAs()
, convertToFahrenheit()
, and powerOf()
.
For each test method you must use at least two of the tests provided in the reading, however you must:
assertEquals
test for the methods sumUp()
, convertToFahrenheit()
, and powerOf()
.assertNotSame
test for removeAs()
After you have written your test cases hit run and check to see if all of your methods pass.
If any methods fail, make note of which ones and rewrite the test so that they pass.
* Hint: This may include utilizing tests like assertTrue
or assertFalse
.
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Copyright (c) 2013 Samuel A. Rebelsky.
This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this
license, visit http://creativecommons.org/licenses/by/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.