GoogleCodeArchive / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

Low Test Coverage of PNode #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I started running some code metrics on PNode, I found that it had a
instruction coverage (as opposed to line coverage) of 45.6%.  A scary
number considering PNode is the core to the entire library :|. No to say
that it hasn't performed exceptionally well regardless, but just that in
this particular way, some improvement (which I'm more than happy to do
could be made).

Attached you will find a patch that bumps the instruction coverage up to
90.1% and adds 100 (hopefully quality) unit tests on top of the existing 11.

A couple minor changes were needed to get the number as high as it is, and
some more drastic changes will be needed to get it higher (I think). Those
changes are found in issue 86, but I've kept position so that I didn't
break the previous interface. I've marked position as @deprecated though.

Let me know what you think.

Original issue reported on code.google.com by allain.lalonde on 12 Jul 2009 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago
There are 2 commented tests in there that I believe should pass but don't.

Original comment by allain.lalonde on 12 Jul 2009 at 3:05

GoogleCodeExporter commented 9 years ago
I've committed the changes offered in the patch.

Original comment by allain.lalonde on 13 Jul 2009 at 12:17

GoogleCodeExporter commented 9 years ago
Portions of this patch should be reconsidered, as a binary incompatible change 
has
been made:

$ clirr.sh -o piccolo2d-core-1.3-SNAPSHOT-r446.jar -n
piccolo2d-core-1.3-SNAPSHOT-r447.jar
ERROR: 7006: edu.umd.cs.piccolo.PNode: Return type of method 'public
edu.umd.cs.piccolo.activities.PInterpolatingActivity animateToColor(jav
a.awt.Color, long)' has been changed to 
edu.umd.cs.piccolo.activities.PColorActivity
INFO: 7011: edu.umd.cs.piccolo.PNode: Method 'public
edu.umd.cs.piccolo.activities.PActivity 
animateToRelativePosition(java.awt.geom.Point2D
, java.awt.geom.Point2D, java.awt.geom.Rectangle2D, int)' has been added
INFO: 7007: edu.umd.cs.piccolo.PNode: Method 'public void
position(java.awt.geom.Point2D, java.awt.geom.Point2D, 
java.awt.geom.Rectangle2D,
int)' has been deprecated

Original comment by heue...@gmail.com on 13 Jul 2009 at 2:31

GoogleCodeExporter commented 9 years ago
Test coverage has been improved via several other commits.

Original comment by heue...@gmail.com on 28 Jul 2009 at 1:41