lab2.html - CS1027A Computer Science Fundamentals II Lab 2 General lab instructions to help labs run smoothly Read through the lab instructions before

lab2.html - CS1027A Computer Science Fundamentals II Lab 2...

This preview shows page 1 - 2 out of 2 pages.

CS1027A Computer Science Fundamentals II Lab 2 General lab instructions to help labs run smoothly Read through the lab instructions before coming to the lab. Do the pre-lab preparation. Overview and preparation We 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 class To make testing easier for a person who is writing code for a class, she can add a main method that acts as a "test harness". A test harness is a main method that consists of calls to methods that you wish to test, and is 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.
Image of page 1
Image of page 2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture