Oscon Talk


This talk is in preparation for the O'Reilly Open Source Conference to be held in Portland, Oregon the week of July 7, 2003.


Fit for XP and Open Source


Outline

  • Fit in Test-Driven Development
  • Demo of Fit with Word and Wiki
  • Integrating Fit and Open Source


Start with a Story

For the purpose of sharing unpaid interest of some bonds, compute elapsed days assuming every month has 30 days and every year 360 days.


Add an Example

For example, treat Feburary 15 to March 15 as 30 days even though it is actually 28.


Write as a Table

from to 30/360() actual
Feb 15, 2003 Mar 15, 2003 30 28
Feb 15, 2003 Mar 16, 2003 31 29


Name an Interpreter

Demo.CalendarFixture
from to thirty360() actual()
Feb 15, 2003 Mar 15, 2003 30 28
Feb 15, 2003 Mar 16, 2003 31 29


Run the Example

Demo.CalendarFixture
from to thirty360() actual()
Feb 15, 2003 Mar 15, 2003 30 28
Feb 15, 2003 Mar 16, 2003 31 29

http:run.cgi


Presto: Executable Spec

Story: 30/360 Financial Calendar

For the purpose of sharing unpaid interest of some bonds, compute elapsed days assuming every month has 30 days and every year 360 days.

Demo.CalendarFixture
from to thirty360() actual()
Feb 15, 2003 Mar 15, 2003 30 28
Feb 15, 2003 Mar 16, 2003 31 29

http:run.cgi


run.cgi Examined

  curl $HTTP_REFERER input.html
  java fit.FileRunner input.html output.html


FileRunner Examined

  String tags[] = {"table", "tr", "td"};
  Parse tree = new Parse(input, tags);
  (new Fixture()).doTables(tree);
  tree.print(output);


eg.CalendarFixture Examined

  class CalendarFixture extends ColumnFixture {
    Date from;
    Date to;
    int thirty360() { ... }
    int actual() { ... }


Now Multiple Years

... and every year 360 days.

Demo.CalendarFixture
from to thirty360() actual()
Feb 15, 2003 Mar 15, 2003 30 28
Feb 15, 2003 Mar 16, 2003 31 29
Feb 15, 2002 Mar 15, 2003 390 393

http:run.cgi


Process Check

Ward: have you passed that previous test? If not, go back and pass it before continuing this talk.


Table Formats

  • Customers can define them.
  • You can coax them.
  • We help with samples.


Customers Like Word & Excel

  • Easy to "add column"
  • Both read & write html
  • We just look for <td>'s


Standard Fixtures


Implementations

  • Java & clone
  • C++, Delphi
  • Perl, Python, Ruby
  • CLOS, Scheme, Smalltalk


Related Projects


Check it Out

http://fit.c2.com


Fit and Open Source

  • OK Ward. It's my turn!

Fit and Open Source

  • Fit helps foster communication between Managers, Developers and Testers in the enterprise
  • Fit is also well suited to personal Open Source projects
  • Perl Modules


Brian's Song

  • Brian Ingerson
  • Perl Hacker
  • YAML Language Designer
  • Friend of Ward's

Fit and Perl


A Kwiki in Every Pot

  • I run a kwiki in every module directory
  • For Fit tests and documentation and notes
  • By subclassing kwiki I can write pages to special places

Visual vs Textual Harness


World Domination

  • I can change the way the Perl world does testing.
  • Module::Install
  • Seamless to Users

A New Deal

  • More power to module authors
  • Large-grained tests
  • User submitted tests/bug reporting

Multilingual Modules


FreePAN

  • A CPAN for all languages
  • Implement the same modules in multiple languages
  • FIT could be the specification language

 

Last edited July 11, 2003
Return to WelcomeVisitors