You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jesse Glick <je...@sun.com> on 2006/06/01 21:20:00 UTC

Re: and junit4 (long)

Stefan Bodewig wrote:
>> 3. enhancements to junit
>> 
>> -a method "isFailure" on the assertion failure classes, for 
>> checking (through reflection in ant) for failures vs errors.
> 
> Yes, that would be handy.  But they shouldn't have dropped the 
> difference between errors and failures in the first place.

Whatever you think of the decision to drop that distinction (personally 
I am on the fence about it), the job of the task is to provide a wrapper 
for the tool the way it is intended to be used, so for junit4 that means 
report output should not differentiate between the two.

I *did* include differentiation in the patch I did in Ant head. But that 
is only because the existing junit3-based reporting framework counts 
failures and errors separately, and it would be confusing for one or the 
other column to always be zero.

-J.

-- 
jesse.glick@sun.com  x22801  netbeans.org  ant.apache.org
       http://google.com/search?q=e%5E%28pi*i%29%2B1


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Structure of Ant (OO Design)

Posted by Hayden Melton <hm...@ec.auckland.ac.nz>.
> So you analyse each of the source files to determine which other
> source files they depend on.  This seems to be a Java-centric
> analysis in that it relies on the source files containing a class
> each?  Is that correct?  Ie would this be able to analyse source
> files that contain many classes (like in other languages which don't
> have the general 1 class/source file structure of Java)?

Yeah my analysis is Java-centric. In other languages there might be multiple
(top-level classes) per source file. Other people have suggested similar
analyses for other languages (see John Lakos, Large Scale C++ Software Design
http://www.amazon.com/gp/product/0201633620/002-6391393-4360864?v=glance&n=283155
)

In fact, Java can have multiple classes declared in one source file (nested
classes and inner classes. But since a source file is the usual `physical' unit
we deal with as programmers it makes sense to look at dependencies between
.java files.


>  From you analysis, does the 'flatter' the structure have any
> correlation with the complexity of the code, or any other 'quality'
> metric?

Yip --- the flatter (and more `acyclic') the graph, the easier the system should
be to understand, test and reuse. I have explained the reasons why on my
research page:

http://www.cs.auckland.ac.nz/~hayden/research.htm

> Sorry to bug you about this, but I'm fairly interested in this (from
> a layman's perspective), and I've got a fairly easy day at work so
> I'm free to send inquiring emails :)

The raw data is available for Ant, along with the tool I used to collect the
data. My tool says that these classes are all (transitively) mutually dependent
in ant 1.6.5:

org.apache.tools.ant.filters.TokenFilter
org.apache.tools.ant.types.RegularExpression
org.apache.tools.ant.util.regexp.Regexp
org.apache.tools.ant.filters.BaseFilterReader
org.apache.tools.ant.types.selectors.ContainsRegexpSelector
org.apache.tools.ant.loader.AntClassLoader2
org.apache.tools.ant.types.selectors.DateSelector
org.apache.tools.ant.types.selectors.BaseSelectorContainer
org.apache.tools.ant.filters.PrefixLines
org.apache.tools.ant.AntClassLoader
org.apache.tools.ant.types.Reference
org.apache.tools.ant.filters.EscapeUnicode
org.apache.tools.ant.types.AntFilterReader
org.apache.tools.ant.types.selectors.NotSelector
org.apache.tools.ant.filters.HeadFilter
org.apache.tools.ant.taskdefs.condition.Condition
org.apache.tools.ant.ProjectHelper
org.apache.tools.ant.filters.ExpandProperties
org.apache.tools.ant.AntTypeDefinition
org.apache.tools.ant.filters.util.ChainReaderHelper
org.apache.tools.ant.types.AbstractFileSet
org.apache.tools.ant.types.EnumeratedAttribute
org.apache.tools.ant.types.selectors.modifiedselector.DigestAlgorithm
org.apache.tools.ant.helper.ProjectHelper2
org.apache.tools.ant.util.JavaEnvUtils
org.apache.tools.ant.PropertyHelper
org.apache.tools.ant.types.Path
org.apache.tools.ant.taskdefs.Definer
org.apache.tools.ant.types.selectors.ExtendSelector
org.apache.tools.ant.DynamicAttributeNS
org.apache.tools.ant.DynamicAttribute
org.apache.tools.ant.UnsupportedElementException
org.apache.tools.ant.BuildEvent
org.apache.tools.ant.types.selectors.BaseSelector
org.apache.tools.ant.types.FilterSetCollection
org.apache.tools.ant.types.FilterChain
org.apache.tools.ant.RuntimeConfigurable
org.apache.tools.ant.TypeAdapter
org.apache.tools.ant.types.selectors.DepthSelector
org.apache.tools.ant.util.JAXPUtils
org.apache.tools.ant.util.LineTokenizer
org.apache.tools.ant.input.DefaultInputHandler
org.apache.tools.ant.DirectoryScanner
org.apache.tools.ant.types.FileList
org.apache.tools.ant.types.selectors.MajoritySelector
org.apache.tools.ant.taskdefs.Manifest
org.apache.tools.ant.Executor
org.apache.tools.ant.taskdefs.DefBase
org.apache.tools.ant.types.selectors.SizeSelector
org.apache.tools.ant.util.FileUtils
org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector
org.apache.tools.ant.types.selectors.MappingSelector
org.apache.tools.ant.SubBuildListener
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.Substitution
org.apache.tools.ant.Project
org.apache.tools.ant.types.selectors.DifferentSelector
org.apache.tools.ant.types.selectors.PresentSelector
org.apache.tools.ant.filters.TailFilter
org.apache.tools.ant.helper.AntXMLContext
org.apache.tools.ant.input.InputHandler
org.apache.tools.ant.helper.ProjectHelperImpl
org.apache.tools.ant.filters.ClassConstants
org.apache.tools.ant.taskdefs.Antlib
org.apache.tools.ant.util.LoaderUtils
org.apache.tools.ant.types.Mapper
org.apache.tools.ant.PathTokenizer
org.apache.tools.ant.types.selectors.SelectorContainer
org.apache.tools.ant.taskdefs.AntlibDefinition
org.apache.tools.ant.filters.StripLineBreaks
org.apache.tools.ant.filters.StripLineComments
org.apache.tools.ant.types.FilterSet
org.apache.tools.ant.util.regexp.RegexpMatcherFactory
org.apache.tools.ant.ComponentHelper
org.apache.tools.ant.types.selectors.SelectSelector
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.PatternSet
org.apache.tools.ant.types.selectors.FilenameSelector
org.apache.tools.ant.types.Description
org.apache.tools.ant.types.selectors.SelectorScanner
org.apache.tools.ant.util.CompositeMapper
org.apache.tools.ant.util.ContainerMapper
org.apache.tools.ant.taskdefs.Typedef
org.apache.tools.ant.taskdefs.condition.Os
org.apache.tools.ant.types.selectors.TypeSelector
org.apache.tools.ant.types.selectors.FileSelector
org.apache.tools.ant.TaskContainer
org.apache.tools.ant.types.selectors.AndSelector
org.apache.tools.ant.types.selectors.BaseExtendSelector
org.apache.tools.ant.TaskAdapter
org.apache.tools.ant.filters.StripJavaComments
org.apache.tools.ant.filters.TabsToSpaces
org.apache.tools.ant.types.selectors.DependSelector
org.apache.tools.ant.util.regexp.RegexpFactory
org.apache.tools.ant.UnsupportedAttributeException
org.apache.tools.ant.filters.LineContainsRegExp
org.apache.tools.ant.DynamicElement
org.apache.tools.ant.BuildListener
org.apache.tools.ant.taskdefs.PreSetDef
org.apache.tools.ant.filters.ReplaceTokens
org.apache.tools.ant.Task
org.apache.tools.ant.types.selectors.ExtendFileSelector
org.apache.tools.ant.types.selectors.NoneSelector
org.apache.tools.ant.UnknownElement
org.apache.tools.ant.types.selectors.ContainsSelector
org.apache.tools.ant.types.FileSet
org.apache.tools.ant.Location
org.apache.tools.ant.util.regexp.RegexpMatcher
org.apache.tools.ant.DynamicElementNS
org.apache.tools.ant.BuildException
org.apache.tools.ant.Target
org.apache.tools.ant.types.DirSet
org.apache.tools.ant.IntrospectionHelper
org.apache.tools.ant.types.selectors.OrSelector
org.apache.tools.ant.filters.BaseParamFilterReader
org.apache.tools.ant.filters.LineContains
org.apache.tools.ant.util.ClasspathUtils




> On the other hand I suppose I should really read your research
> properly as you've probably described exactly how and where your
> analysis works/fails

Yeah, you should take a gander. Pretty much everything I have said in this email
is explained there. It might be a bit wordy, but I have tried to be thorough.

Incidentally, I have posted to a number of mailing lists results that I have
collected from analysing various applications. All the feedback I get from
developers about their feelings on the quality of the design of their system
w.r.t. transitive compilation dependencies is very useful for my research.


Cheers,
/
Hayden.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Structure of Ant (OO Design)

Posted by Kev Jackson <fo...@gmail.com>.
On 5 Jun 2006, at 10:07, Hayden Melton wrote:

> Ant-1.6.5 there are 117 .java files involved in a big dependency  
> cycle.
> That is the height of the biggest red bar. The yellow bars show the
> distribution of another metric I have devised CRSS which aims to  
> quantify how
> "flat" the structure of a system is.


So you analyse each of the source files to determine which other  
source files they depend on.  This seems to be a Java-centric  
analysis in that it relies on the source files containing a class  
each?  Is that correct?  Ie would this be able to analyse source  
files that contain many classes (like in other languages which don't  
have the general 1 class/source file structure of Java)?

 From you analysis, does the 'flatter' the structure have any  
correlation with the complexity of the code, or any other 'quality'  
metric?

Sorry to bug you about this, but I'm fairly interested in this (from  
a layman's perspective), and I've got a fairly easy day at work so  
I'm free to send inquiring emails :)

On the other hand I suppose I should really read your research  
properly as you've probably described exactly how and where your  
analysis works/fails

Kev

--
"Society in every state is a blessing, but government even in its  
best state is but a necessary evil; in it's worst state an  
intolerable one" - Thomas Paine


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Structure of Ant (OO Design)

Posted by Hayden Melton <hm...@ec.auckland.ac.nz>.
> Is your analysis in any way similar to how PMD defines it's cyclic
> complexity metric?  I always thought that PMD did a good job of
> warning developers of potentially 'smelly' code.

No, it has nothing to do with McCabe's cyclomatic complexity, which basically
tries to quantify the complexity of the control flow in a method (i.e. how many
different paths there are through if-statemetns, loops etc).

Basically what I'm doing is lookin at compilation dependencies among source
files. So if A.java depends on B.java, and B.java depends on C.java, and C.java
depends on A.java, then A.java and B.java and C.java are all in a dependency
cycle.

Graphically:

    - -> A -> B -> C --
   `                   |
    \_ _ _ _ _ _ _ _ _/

So in Ant-1.6.5 there are 117 .java files involved in a big dependency cycle.
That is the height of the biggest red bar. The yellow bars show the
distribution of another metric I have devised CRSS which aims to quantify how
"flat" the structure of a system is.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Structure of Ant (OO Design)

Posted by Kev Jackson <fo...@gmail.com>.
On 3 Jun 2006, at 13:16, Hayden Melton wrote:

> http://www.cs.auckland.ac.nz/~hayden/corpus.htm

<quote>

If you're too busy to read my research page, and want to use these  
graphs to tell a "good" from "bad" structure: big red bars are bad.

</quote>

Love that!  Still not sure how to interpret the graphs, but at least  
from that description, the less red on the graph the better :)

Is your analysis in any way similar to how PMD defines it's cyclic  
complexity metric?  I always thought that PMD did a good job of  
warning developers of potentially 'smelly' code.

How do you generate the data to build the graphs?  Do you have an ant  
task to analyse the ant code?! :)

Good stuff to see anyway, shame I'm not smart enough (nor  
conscientious enough to read your research page thoroughly) to  
understand all of it apart from the overview you so eloquently  
provided (quoted above)

Thanks for this
Kev

--
"I call it the State where everyone, good or bad, is a poison- 
drinker: the State where universal slow suicide is called - life" -  
Friedrich Nietzsche


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Structure of Ant (OO Design)

Posted by Hayden Melton <hm...@ec.auckland.ac.nz>.
Hi all,

I am a PhD student at the University of Auckland, New Zealand. As part of my
research I have performed an empirical study on a large corpus of open-source
Java software. Several of the applications in the corpus (Ant, Tomcat, JMeter,
POI) are from the Apache Software Foundation. If you are a developer of Ant you
might be interested to know that there are 117 source files all involved in a
big dependency cycle (Strongly connected component). Other applications like
Azureus, Soot and ArgoUML have strongly connected components involving ~1000
classes. In any case, a comparison of Ant to all the other applications in the
corpus is available on my webpage:

http://www.cs.auckland.ac.nz/~hayden/corpus.htm

The page also contains a graph that shows the evolution of dependencies through
around 10 versions of Ant, starting at Ant-1.1.

/
Hayden Melton

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org