Menu

#59 Write self-tests for every relevant module

v2.1
closed
None
v1.1
not_relevant
Enhancement_Request
Tests
3-moderate
2022-03-08
2012-07-24
No

Currently, there are some unit tests for SASUnit itself, to be found in \saspgm\test, but not all the modules have been tested. There should be unit tests for every module of SASUnit.

Testing should first concentrate on all assertion macros. Second, internal macros (beginning with _sasunit_) should be tested. Macros used by testers directly should already have been tested in many usage scenarios and so their priority is lowest. Some of them (for instance the two driver macros initsasunit.sas and reportsasunit.sas) might be impossible to unit test.

With self tests, the following issues have to considered:

  • There are two helper macros for tests of assertions. They check the contents of the database. marktest.sas stores the ids of the assertion to be tested in macro variables. assertdbvalue.sas checks whether there are the correct values in the database.
  • Tests for assertions must also cover situations where an assertion fails, so the expected outcome is that an error is displayed in the report. This must be verified by manual inspection. In order to facilitate this, the phrase "must be red" should be prepended to the corresponding descriptive texts of tests and of test cases.
  • When writing tests for reporting, manual inspections ("white" outcome) must often be used.
  • Some tests might be rather complex, for instance _sasunit_checkszenario_test.sas which tests the detection process for changed test scenarios and changed units under test.
  • A full test of the SASUnit platform involves executing all unit tests and doing inspections for every outcome which "must be red" or any "white" outcome.

Related

Tickets: #223

Discussion

  • Klaus Landwich

    Klaus Landwich - 2019-07-01
    • assigned_to: Klaus Landwich
    • Milestone: default --> v2.1
     
  • Klaus Landwich

    Klaus Landwich - 2019-07-01

    Implement a minimal version by triggering test coverage via an empty scenario.
    Then see if a "real" scenario is necessary.

     
  • Klaus Landwich

    Klaus Landwich - 2022-03-02
    • status: open --> assigned
     
  • Klaus Landwich

    Klaus Landwich - 2022-03-02

    "Empty" scenarios are created for all modules.
    Some of them need test cases.

     

    Last edit: Klaus Landwich 2022-03-08
  • Klaus Landwich

    Klaus Landwich - 2022-03-08
    • status: assigned --> closed
     
  • Klaus Landwich

    Klaus Landwich - 2022-03-08

    At least every module has an "empty" scenarios. Some modules show 0% test coverage. For those we need to check if test cases are suitable and create those test cases.
    Some modules will not be called within a SASUnit run (e.g. _setup_sasunit). Check if test cases will provide test coverage, otheriwse note down in the scenario or delete those scenarios.

    These actions will be covered by a new ticket.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB