Instructions: Answer as many of the following questions as you can during the lab period. If you are unable to complete the assignment during the lab period it is strongly recommended that you complete it on your own.
Getting Ready: Before going any further, you should:
Calculator
class contains the following two
methods:
/**
* Calculates the inverse of a number
*
* @param x The number
* @return The inverse (i.e., 1.0/x)
*/
public static double inverse(double x)
/**
* Calculates the percentage that a part is of a whole
* (assuming both are non-negative)
*
* @param part The part (i.e., numerator)
* @param whole The whole (i.e., denominator)
* @return A percentage (where 100.0 = 100%)
*/
public static double percent(double part, double whole)
Make sure you understand the purpose of these two methods.
inverse()
method.
inverse()
to fail?
percent()
method.
percent()
to fail?
percent()
method failed?
Series
class.
arithmetic()
method.
arithmetic()
method? (Note: An oracle is a component that can be
used to verify the function of another component.)
arithmetic()
method
using this oracle.
pi(int)
method.
Document
and FormattedDocument
classes and refresh your memory of them. (You used them in the lab
on "Experimenting with Accessibility/Visibility".)
Document
class, which method should you test first,
getDescription()
or getWordCount()
? Why?
getWordCount()
method.
FormattedDocument
class, in what order
should you test the various methods?
getWordCount()
method) important test cases for
the getText()
method.
Copyright 2011