Uploaded image for project: 'test.check'
  1. TCHECK-87

New stats feature: Adds ability to assign labels to test cases to report the test case distribution when running a test

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Patch:
      Code and Test

      Description

      Inspired in the analog feature that exists in Haskell's QuickCheck. Adds a classify fn that is intended to be used as a wrapper of prop/for-all, returning a property (a generator) appropriate for test.check/quick-check that will augment the result-map returned by the underlying property, adding the collected labels under the :labels key. Also triggers a new event :stats in the default-reporter-fn whose default implementation calls test.check.stats/print, printing the classification of trials with the following format:

      12.7% :lt-30
      14.5% :gte-30
      29.1% :lt-30, :lt-20
      43.6% :lt-30, :lt-10, :lt-20
      

      (note that multiple labels might be assigned to some test cases)

      I think it answers the question "How could we collect stats about the sorts of things generated?" from the test.check design page

        Attachments

          Activity

            People

            • Assignee:
              nberger Nicolás Berger
              Reporter:
              nberger Nicolás Berger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: