Andrea Aime ha scritto:
> Justin Deoliveira ha scritto:
>>> One thing that I was not sure about was the usage of the svn log to
>>> report numbers of test classes and the like. On one side, it's a way
>>> to give a concrete information about the testing, on the other side
>>> it might be perceived as trying to look (too) good. Opinions?
>>>
>> I think that information would be in general good to have, I would be 
>> curious as to what the ratio of code to test code is. I guess whether we 
>> are trying to "show off" or not would depend on the numbers... for 
>> instance they may be embarrassing :)
> 
> Rough but quick computation (on trunk, giving up on removing white 
> space, comments and the like):
> cat `find . -name *.java` | wc -l --> 331976
> cat `find . -name *.java` | wc -l --> 33885
> non test code: 297991
> % of test over non test: 11.3%
> 
> Note this is a unfair towards test code, as non test code has
> javadocs, surely more code comments, and copyright headers.
> But it's a ballpark idea, I think it's fair to assume the actual
> ratio is more towards 15%-20%

Hmmm... making a better estimate is possible by removing whitespace
and comment lines. Here is an attempt trying to shave off white lines,
block comments and lines with just a comment (assuming for simplicity
that those starting with "*" are most of the time javadoc comments and 
lines ending with */ are also the end of a multiline block comment):

cat `find . -name *.java` | grep -v "^[ \t]*$" | grep -v "^[ \t]*//" | 
grep -v "^[ \t]*/\*" | grep -v "^[ \t]*\*" | grep -v ".*\*/" | wc -l
183556

cat `find . -name *Test.java` | grep -v "^[ \t]*$" | grep -v "^[ \t]*//" 
| grep -v "^[ \t]*/\*" | grep -v "^[ \t]*\*" | grep -v ".*\*/" | wc -l
24938

non test code: 158618
% of test over non test: 13.58%

Hmmm... I expected it to be higher, but it's not so bad. Most of our
tests are functional so they tend to exercise a lot of the GeoServer
code (startup, configuration, catalog access, data access, service code
and so on).

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to