CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

Shrinking and showing functions (Functional pearl)

Koen Claessen (Institutionen för data- och informationsteknik, Programvaruteknik (Chalmers))
2012 ACM SIGPLAN Haskell Symposium, Haskell 2012. Copenhagen, 13 September 2012 (0362-1340). Vol. 47 (2012), 12, p. 73-80.
[Konferensbidrag, refereegranskat]

Although quantification over functions in QuickCheck properties has been supported from the beginning, displaying and shrinking them as counter examples has not. The reason is that in general, functions are infinite objects, which means that there is no sensible show function for them, and shrinking an infinite object within a finite number of steps seems impossible. This paper presents a general technique with which functions as counter examples can be shrunk to finite objects, which can then be displayed to the user. The approach turns out to be practically usable, which is shown by a number of examples. The two main limitations are that higher-order functions cannot be dealt with, and it is hard to deal with terms that contain functions as subterms.

Nyckelord: counter example, quickcheck, testing

Denna post skapades 2012-11-14. Senast ändrad 2016-07-01.
CPL Pubid: 166072


Läs direkt!

Länk till annan sajt (kan kräva inloggning)