gap-system / gap

Main development repository for GAP - Groups, Algorithms, Programming, a System for Computational Discrete Algebra
https://www.gap-system.org
GNU General Public License v2.0
812 stars 161 forks source link

Defining and revising assertion levels #564

Open hulpke opened 8 years ago

hulpke commented 8 years ago

This is prompted by @stevelinton 's remark in #562:

Since the standard tests now use assertions we should define what the different assertion levels achieve. As a start for discussion (copying from the suggestion for level 1):

Level 1: The tests should not cause more than 10% overhead in runtime and should not trigger calculations that might have side-effects, such as changing the state of the random number generator, storing attributes or setting properties. (This would imply that even an element test or a test for a group being solvable should be assertion level 2).

Level 2: Tests may cause side-effects but should not be expected to cause more than 50% overhead in runtime. It should be possible to run even longer-runtime tests with this assertion level being set.

Level 3: Tests that may increase runtime significantly, but will be safe to run (i.e. they cannot corrupt data structures or assume a set-up of data structures that is more specific than documented.

Level 5: Tests that may assume extra properties of the data structures or objects used which may not hold in general.

By this the homomorphism assertions should move to level 3 (and many other assertions to level 2)

olexandr-konovalov commented 8 years ago

@hulpke - thanks! My comments:

hulpke commented 8 years ago

@alex-konovalov

stevelinton commented 8 years ago

These are guidelines, not rigid rules, and it is very easy to change the level of an assertion in a fix if it is found to be too low (or too high).

Tests should pass at all assertion levels up to 4, although 4 might take a long time and package and library code should be tested at all these levels at some stage before a release.

Based on the criteria above, level 1 would be appropriate for the continuous integration testing run on every PR. Level 2 should be sensible for nightly testing and levels 3 and 4 are probably saved for release preparation.

Level 5 allows assertions that may only be appropriate in specific contexts, so is never used for automated testing.

olexandr-konovalov commented 7 years ago

I think this should be documented somewhere, and this will allow us to close the issue. Practical parts would be merging #549 in combination with setting assertion levels globally, perhaps via implementing #527.

fingolfin commented 7 years ago

However, I don't think this needs to be in 4.9 -- we want to get that out soon, and there are other more important things we should take care of first. So I propose to remove the milestone, or change it to 4.10.

olexandr-konovalov commented 7 years ago

@fingolfin agree - was going to suggest the same by same reasons. Will put 4.10.