Static Typing, Test Driven Development and Eclipse

Share the article!


With all this debate going about Static vs Dynamic typing, I decided to “consult” an expert.  Eric Allen, a Ph.D. candidate and a researcher of static typing,  writes in “The Case for Static Types“  several reasons why static typing makes code more robust:

  • Improves robustness through early error detection

  • Increases performance by making required checks at the best times

  • Supplements the weaknesses of unit testing
  • However, he points out a conflict with type checking and unit testing.

    But there’s a problem here: the new tests won’t pass static type checking until we have defined the classes and methods to which the tests refer. These classes and methods can be stubs that we fill in later, but unless we have something in place, the references to them in the tests won’t make sense to the static checker.

    The article is almost a year old, and its most likely that he didn’t have the opportunity of building his tests in the Eclipse environment.   To show you how much easier it has now become, I’ve composed a viewlet that demonstrates Test Driven Development (TDD).  You can watch it here (it’s hosted by

    I think given the arguments presented by Eric Allen, and the utility of Eclipse in doing TDD, the issue of Static vs Dynamic typing should be a closed issue.

    Share the article!

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>