Home > Articles > Software Development & Management > Agile

Like this article? We recommend

Let's Try That Again


We'll begin with nothing more than a simple test:


public class CustomerTest
extends TestCase { public void testToXML()
throws Exception { Customer c =
new Customer(); } }

This doesn't compile, so we'll write the simplest module that will make it compile:

public class Customer
{
}

This compiles, and the test runs. Now we can add more to the test:

public void testToXML() throws Exception
{
  Customer c = new Customer();
  c.name = "John Smith";
  c.address = "55 Somewhere, City, State Zip";
  c.email = "jsmith@somewhere.com";
  c.phone = "111-222-3333";
  c.fax = "444-555-6666";
  c.cellPhone = "777-888-9999";
}

Again, this doesn't compile, so we add just enough to Customer to make it compile.

public class Customer
{
  public String name;
  public String address;
  public String email;
  public String phone;
  public String fax;
  public String cellPhone;
}

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.