Quick Index
Objectives



Description


For this challenge the coder will apply smoke tests to a Customer unit (class) in an effort to look for showstopper bugs.

The coder is provided with:


The challenge is to use the unit test to identify bugs, and then resolve the bugs. A "bug summary" must be prepared.

Good luck coder!

Provided Code



Unit (Model)


For this example, we will be testing a unit named Customer.

The Customer class summary and key method summaries are shown below. We will use these summaries when coding the tests.

Customer Structure
class name: Customer
access: public
package: model.business
Customer Method Headers
The smoke tests exercise the following methods:
/** Returns new Customer object with passed lat and long values */
public static Customer fromFirstLastPhone(String firstName, String lastName, String phone)

/**
 * Returns new Customer object with blank name and blank phone
 * Blank name means ivar "name" should be FullName object with blank strings
 * Blank phone means blank (empty) string
*/
public static Customer newInstance()

/** Returns nice display string for this Customer */
public String toString()

FullName Method Headers
Pertinent method headers for the FullName type are shown below (just in case you need them for bug fixes).
/**
 * Returns new FullName object setting two components from params
 * (middle name will be empty string)
*/
public static FullName fromFirstLast(String f, String l)

/** Returns new FullName with all name components as empty strings */
public static FullName newBlank()

/** Returns "nice string" of this FullName */
public String toString()



Project Directory Structure


Here is the project directory structure with primary players noted.

Note that classpath (Java) is also called build path (Eclipse) or source folder (IntelliJ).
+---srcclasspath
| +---model | | +---business | | \---Customer.javaUnit | | \---FullName.java | +---test | | +---cases | | +---business | | \---CustomerTest.javaUnit
Test
| | \---customer-bug-summary.txtBug summary
starter file


Challenge Rules



Note: The referenced "example" is the example from this chapter

Expected Unit Test Output


Once all the showstopper bugs have been identified and fixed this is the expected output when running the unit test.
-- test_newInstance --
 ()

-- test_fromFirstLastPhone --
Asha Gupta (1112223333)


Bug Summary



Note: The referenced "example" is the example from this chapter

Deliverable (Output)


The deliverable (product) for this challenge is the file "customer-bug-summary.txt".