Loading ...
Sorry, an error occurred while loading the content.
 

Testable Languages

Expand Messages
  • Carl Manaster
    Hi, all, ... And I d like to encourage the group here to begin the discussion - if it s not already underway elsewhere - of what that could mean. I d very
    Message 1 of 98 , Nov 13, 2007
      Hi, all,

      Michael Feathers tossed off, in a recent thread:

      > hoping to see testability as a use case for
      > language design in my lifetime

      And I'd like to encourage the group here to begin the discussion - if
      it's not already underway elsewhere - of what that could mean. I'd
      very much like to see the language that emerges from that use case -
      and I'm pretty sure I'd like to use it.

      For my part, I find it easiest to think about language and (other)
      development tools together; that is, the implications of a testable
      language I envision through their manifestations in (for notable
      example) the IDE. We have some of that with JUnit integration in
      Eclipse and other Java IDEs and nUnit integration into Visual Studio,
      and it's great to have that, but in what ways could it be better? I
      like the notion of some kind of special status for test code that
      gives it access to things that might not be accessible to production
      code, and an execution context that refuses to execute untested or
      failing code - of course the tests need a different execution context
      or code could never be tested. I am also fond of the notion of inline
      tests - not in a nearby or parallel package, not in a separate class,
      but right there in the code: THIS is what this function is required to
      do. But I can also see that getting messy.

      Michael, what do you imagine a highly testable language would look
      like? How would it differ from today's languages, and what impact
      would testability have on development and deployment tools? Anyone
      else?

      Peace,
      --Carl

      --
      http://undisclosed-recipients.blogspot.com
      http://www.flickr.com/photos/carlmanaster/sets/228603/
    • Donaldson, John (GEO)
      Well, here s a coda to this thread. Lots of good and thoughtful replies - for which thanks. I ve blended a couple together and here s what I ve got. By the
      Message 98 of 98 , Nov 19, 2007
        Well, here's a coda to this thread. Lots of good and thoughtful replies - for which thanks. I've blended a couple together and here's what I've got. By the way, I have a data structure which is document->parts->checkableAttributes, so a composite makes sense.

        I've got a composite which is CheckDocument. That loads several CheckParts, each of which in turn load different CheckAttributes.

        Then a call to CheckDocument.IsValid descends through all the Part checkers and attribute checkers.

        In each level I loop through the checkers (the loop is in the base class), and use the "&=" operator - it works fine in C#.

        Which has definitely reduced the scope of the memorized condition!

        Before I started, it looked like a scary refactoring - but TDD made it not scary, pretty fast, more-or-less error-free. A joy to do really, because now the code is much better.

        John D.
      Your message has been successfully submitted and would be delivered to recipients shortly.