100%(1)1 out of 1 people found this document helpful
This preview shows page 1 - 2 out of 2 pages.
CS1027A Computer Science Fundamentals IILab 2General lab instructions to help labs run smoothly•Read through the lab instructions before coming to the lab. •Do the pre-lab preparation. Overview and preparationWe work with our own classes, and Javadoc. Upon completion of this lab, you should be able to do the following: •Use a test harness to aid in testing methods of a class. •Add to the classes defined in Topic 1 of our lecture notes. •Create Java class documentation using the tool Javadoc. •Use the classes defined in Topic 1 of our lecture notes in an application. Make sure you show the result(s) of each Exercise to your TA, to get your marks for the lab. Preparation:make sure you understand the parts of a class definition: instance variable declaration, constructor definition, method definition. Read this introduction to Javadoc.Exercise 1: Adding a Test Harness to the Person classTo make testing easier for a person who is writing code for a class, she can add a main method that acts asa "test harness". A test harness is a main method that consists of calls to methods that you wish to test, andis conventionally the last method of the class. If you have a test harness, you do not need to have a separate application program in order to test your class: the test harness is part of the class you are testing.