OITools Documentation

Class diagram

class diagram

DataModel documentation

  • Data Model TODO
  • DataModel.java is a class generate references files: DataModelsV1.xml & DataModelsV2.xml (contains Rules and Tables description), and Failures.xml (contains all Failures).

    • Rules is an object which contains all informations on the rules defined by the standard or common sense.
    • Failures is an object which contains all informations to storing all objects for error handling (like Rules). TODO UML
    • DataModel is a class whose purpose is to creating files, the goal is to browse the code and active all failures.
      • This passage in the code is a special case, indeed, when DataModel.java is running a flag is active and this flag allows to force the passage even if the conditions are not met. Obviously this case is specific to this java class and can generate aberrated values. But this is not disturbing, because the goal is above all the capture of the rules (where the values are not collected) and the capture of the failures (where the values are just examples).
      • In order to be able to pass in all places where an failure can be generated, it was necessary to prepare several cases. Failure can be generated when a file is loader, so we had to load at least a version 1 file and a version 2 file. Failure can also be generated when the structure of an OIFITS is created in memory, so it was necessary to create a minimum of two memory structures in version 1 and another in version 2.
      • We also made the choice, to trigger some failure we cannot use the flag (to not generate a fatal error) but a modified OIFITS file. For example to trigger the failure of an invalid file, the use of a truncated OIFITS file. The passage in the code is therefore several times with different cases. In each of these cases the Checker is created in the beginning and to be given to all methods. This allows a total harvest of failures in the end.

  • DataModel: is two files, one by version of the standard, which regroup all informations on Rules. In a first time, we have the list of Rules: their description, location in the standard, version of the standard and we can show their applyTo (the table / keyword / column, where this rule applies). In a second time, we have the list of Tables: their keywords and columns related and each Rules on these Tables.

  • Failures: is a file, which regroup all informations on Failures. It is a collection of all the errors that can happen on the Tables as well as their keywords and their columns.

Junit Tests

  • TODO: Test update ? (History order) / (Hierarch) *see strict compare Nom.tam.fits

Tests documentation

  • Creation of the first test files DumpOIFitsTest and LoadOIFitsTest. These are test files for checking the OIFitsLoader:
    • DumpOIFitsTest displays file information and loads the contents file in the oifits folder and saves all information that we think is important to OIFits files (keywords, columns, values, ...) in a .properties file. This information is stored in a reference folder (which is supposed to not be modified).
    • LoadOIFitsTest loads the .properties information and compares it with our files in the oifits folder.
  • So we can see if changes in our code could alter the recovery of information from files.

  • Added about thirty OIFits files to the oifits folder to test.
    • They were chosen for their differences (Nwave = 1, Multi Table, Various instruments, file version 2, image ...) with a small search algorithm: FindFilesTool.

  • Creation of the files for the mutualization of the test code: JUnitBaseTest and AbstractFileBaseTest (child class)
    • JUnitBaseTest is the class that manages the recovery of files and folders as well as the paths of these.
    • AbstractFileBaseTest is the abstract class that handles the common code between Dump & Load OIFitsTest.

  • Creation of two classes DumpFitsTest and LoadFitsTest, which are the addition to DumpOIFitsTest and LoadOIFitsTest for image management.

  • Creation of WriteOIFitsTest and its counterpart for images WriteFitsTest. This test loads the OIFits files and creates a copy, and then compares the copy to the file that is loader again. This test permits to test the rewrite of the files, since the files are load a number of small fixes and improvements are made.

  • Creation of two classes CreateOIFileV1Test and CreateOIFileV2Test. These two classes of tests make it possible to create a complete file in version 1 or version 2. The two OIFits files created are very good bases for the other tests. They allow to test the writing of an OIFits file

  • Creation of OIFitsViewerTest test to export csv, xml (OIDB).

  • Creation of FormatTest, this is a small test that checks the validity range of the dates of an OIFits file.

  • Creation of FitsValidatorTest, this is the test of validation of OIFits files. It is being rewritten.

  • Creation of DumpDataModelTest, it's just a call to the hand of DataModel to create it at the same time as the launch of the tests and also performs a better code coverage.

  • Creation of MoreCoverageTest, it's just a call to functions that were not covered by other tests in order to have better code coverage and prevent regression.

-- CharleenKemps - 20 Oct 2017

Edit | Attach | Watch | Print version | History: r11 | r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r7 - 2018-02-05 - CharleenKemps
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback