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

RE: [XP] Physical System Analogy

Expand Messages
  • Arrizza, John
    ... Just a thought: If the probability of an event is high then the likelihood of a defect is low. In other words, if an event occurs a lot then defects, if
    Message 1 of 25 , Jul 6, 2001
      > -----Original Message-----
      > From: Hugo Garcia [mailto:xpjava@...]
      > Good question. I will have to ponder for a while.
      > --- "Arrizza, John" <john.arrizza@...> wrote:
      > > > -----Original Message-----
      > > > From: Hugo Garcia [mailto:xpjava@...]
      > > > Still a casual description but by measuring the
      > > > probrabilities of events you avoid the mechanistic
      > > > view of things.
      > >
      > > Is there a correlation between probabilities of
      > > events and the locality of defects or of complex code?

      Just a thought: If the probability of an event is high then the likelihood
      of a defect is low. In other words, if an event occurs a lot then defects,
      if any, will manifest themselves more often therefore they tend to get
      fixed. (This also seems to jive with my experience.)

      In a sense, this is one of the reasons behind Unit Testing. It causes events
      to occur with (almost) even probability.

      back to legacy systems:
      On first blush, this implies that the first Unit Tests should be written for
      the least used code. But perhaps there is low-use code and then there is
      low-use code. An example of the latter is dead code. No point in unit
      testing that. Ditto but less so for code that implements low priority/low
      use features.

      So what's left? Code that implements high-use features but is invoked "once
      in a while".

      And that implies this snippet:
      1) Identify and remove all dead code by running a line coverage tool while
      running the system over all features.
      2) Identify code implementing high-use features by running a line coverage
      tool while those features are run.
      3) Write Unit Tests for the remaining code in all of the classes identified
      in step1.

      let me know what you think...
      John
    Your message has been successfully submitted and would be delivered to recipients shortly.