First JPARSEC tests and benchmarks

First JPARSEC tests and benchmarks

JUnit tests are used as the standard tool to test libraries, but it is not the only way to do that. I wrote a couple of tests using it and realized rather quickly that's wasn't the adequate way to go in astronomy. The problem is that ephemerides results are not 'exact', which means that depending on the algorithms selected (JPARSEC supports different IAU resolutions) and theories (JPL ephemerides, Moshier, VSOP87, …) the results will be slightly different. Individual tests are found in each of the clases (main methods), and maybe there I could use JUnit, but I think it is not necessary. Each block is well tested (although I will write at least one test inside each class), so the main concern is to ensure the quality globaly. Another big problem is that JUnit does'nt seem very handy to me if you want to write hundreds of tests, since there's a lot of code you have to write in addition to the tests themselves.

So I have created a very simple Test class in the new jparsec.test package. The tests are written in the tests.txt file, and inside it there are enough comments to understand the tests already implemented (7 types of tests in this first version, and about 70 individual tests). The tests.txt file is a very handy way to add more and more tests without writting a lot of code.

Since ephemerides are not 'exact', the tests should not be oriented to compare double values, but to test astronomical phenomena. I've written my tests using as reference Wikipedia for the planets and the IMCCE for natural satellites (See this for Jupiter and this for Saturn). These first tests shows some inconsistencies between the Wikipedia data and JPARSEC, specially for certain stars eclipsed by planets, like Zuben el Genubi. In fact, 55 tests are fine and 17 are not, so there's some work to do. 4 of those tests that fail are non-critical (mutual eclipses of natural satellites calculated in low-precision mode with JPL elements, in high-precision mode all those tests pass without problems) and I can't solve them. Now I will implement all test types required, later I will investigate all the inconsistencies to solve them.

The new release of JPARSEC has some noticeable changes in the code. In DataSet I have changed the replaceAll method to improve performace, and TimeElement class now uses an AstroDate instance to hold the date instead of a GregorianCalendar. This change implies that the precision when transforming dates in different time scales using TimeScale class is now 0.05 ms or better, instead of the previous precision of 1 ms, since GregorianCalendar holds the date with that precision. This means that almost all programs have been updated, with the possibility of introducing maybe a few errors, but anyway JPARSEC is in testing phase now so if there's any I will discover it soon. I have also added a licenses.txt file to include the licenses of all libraries used in JPARSEC.

JPARSEC now has support for surface plots using SurfacePlotter library, and also for VISAD iso surfaces, that allows to represent surfaces of the same intensity in the datacubes used in astronomical research (this is something very useful to interpret data, and no other software I've seen can do it, so maybe I will write something soon), for the DataCube tool. In my slide show application I have added support for mouse and keyboard events when exporting presentations to PDF. This means that when some object is manipulated with the mouse and keyboard (playing those events previously recorded using xnee package), the slide manipulated is exported to PDF as a video in SWF format. Obviously this can only be done in Linux, where I can play the video using Acrobat 9. Sometimes Acrobat exits due to some kind of error, anyway it seems to work. I also would like to export other objects in U3D format, for example using JReality, but it seems too complicated.

blog/testing1.txt · created: 2011/07/03 14:22 (Last modified 2011/10/15 11:04) by Tomás Alonso Albi
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki