Skip to content

unitTest

EranOfek edited this page Nov 18, 2023 · 4 revisions

unitTest in AstroPack/MAATv2 - Usage and tasks

The unitTest objective is to test existing code in order to make sure it is correct and operational after changes to other pieces of code were done.

Instructions

We usually keep a unitTest function for each class or subpackage. The unitTest of classes is always a static method of the class and it is kept in a separate file. For example, the unitTest of some packages and classes:

AstroCatalog.unitTest
celestial.coo.unitTest

When you write a unitTest:

  • The unitTest function help should contain information about its nature - i.e., unitTest of celestial.coo
  • Do not use message logging in unitTest
  • The purpose of the unitTest function is to fail with some meaningful error if the unitTest failed and to return true if it was successful.
  • The outcome of the unitTest should be deterministic (e.g., independent of a random number generator).
  • The unitTest should not take long to run.
  • The unitTest should test common and basic operations.
  • Always test the uniTest in a linux OS - This is our default OS.

Run All unitTest files

To run all unitTest functions use:

R=tools.unitTester.testAll()

Status of unitTest

In the following table, we keep notes on the status of unitTest functions.

Image Processing

Background

Image processing classes

High-level image processing tools

Spectra processing

Pipelines

Start-to-end examples

Celestial coordinates and mechanics

Astrophysics

Time series analysis

  • [timeSeries - Time series analysis tools]
    • [arma]
    • [bin]
    • [detrend]
    • [fit]
    • [fold]
    • [interp]
    • [period]
    • [rand]
    • [stat]
    • [time]
    • [xcorr]
    • [timeDelay]

Telescopes

Virtual observatory and catalogs

General tools

For developers

  • [Developers]
Clone this wiki locally