Safe Haskell | Safe-Inferred |
---|
Automated specification-based tester
- testProgram :: TestSettings s => s -> Program -> Context -> [Id] -> [TestCase]
- testSessionSummary :: [TestCase] -> Summary
- class TestSettings s where
- generateIntInput :: State s [Integer]
- generateBoolInput :: State s [Bool]
- combineInputs :: (a -> State s [b]) -> [a] -> State s [[b]]
- mapDomainSettings :: s -> ExhaustiveSettings
- genericTypeRange :: s -> [Type]
- mapTypeRange :: s -> [Type]
- defaultGenericTypeRange :: t -> [Type]
- defaultMapTypeRange :: Context -> [Type]
- data ExhaustiveSettings = ExhaustiveSettings {
- esIntRange :: [Integer]
- esIntMapDomainRange :: [Integer]
- esGenericTypeRange :: [Type]
- esMapTypeRange :: [Type]
- data RandomSettings = RandomSettings {
- rsRandomGen :: StdGen
- rsCount :: Int
- rsIntLimits :: (Integer, Integer)
- rsIntMapDomainRange :: [Integer]
- rsGenericTypeRange :: [Type]
- rsMapTypeRange :: [Type]
- data Outcome
- outcomeDoc :: Outcome -> Doc
- data TestCase = TestCase {
- tcProcedure :: Id
- tcLiveIns :: [Id]
- tcLiveGlobals :: [Id]
- tcInput :: [Value]
- tcOutcome :: Outcome
- testCaseDoc :: TestCase -> Doc
- data Summary = Summary {
- sPassCount :: Int
- sFailCount :: Int
- sInvalidCount :: Int
- sUniqueFailures :: [TestCase]
- summaryDoc :: Summary -> Doc
Running tests
testProgram :: TestSettings s => s -> Program -> Context -> [Id] -> [TestCase]Source
testProgram
settings p tc procNames
:
Test all implementations of all procedures procNames
from program p
in type context tc
;
requires that all procNames
exist in tc
testSessionSummary :: [TestCase] -> SummarySource
Summary of a set of test cases
Configurng test sessions
class TestSettings s whereSource
Test session parameters
generateIntInput :: State s [Integer]Source
How should input values for an integer variable be generated?
generateBoolInput :: State s [Bool]Source
How should input values for a boolean variable be generated?
combineInputs :: (a -> State s [b]) -> [a] -> State s [[b]]Source
How should input values for several variables be combined?
mapDomainSettings :: s -> ExhaustiveSettingsSource
Settings for generating map domains (always exhaustive)
genericTypeRange :: s -> [Type]Source
Range of instances for a type parameter of a generic procedure under test
mapTypeRange :: s -> [Type]Source
Range of instances for a type parameter of a polymorphic map
defaultGenericTypeRange :: t -> [Type]Source
Default range for instantiating procedure type parameters: using a single type bool is enough unless the program contains a function or a map that allows differentiating between types at runtime
defaultMapTypeRange :: Context -> [Type]Source
Default range for instantiating polymorphic maps: all nullary type constructors
data ExhaustiveSettings Source
Settings for exhaustive testing
ExhaustiveSettings | |
|
data RandomSettings Source
Settings for random testing
RandomSettings | |
|
Testing results
Outcome of a test case
outcomeDoc :: Outcome -> DocSource
Pretty-printed outcome
Description of a test case
testCaseDoc :: TestCase -> DocSource
Pretty-printed test case
Test session summary
Summary | |
|
summaryDoc :: Summary -> DocSource
Pretty-printed test session summary