language-boogie-0.1.1: Interpreter and language infrastructure for Boogie.

Safe HaskellSafe-Inferred

Language.Boogie.Tester

Contents

Description

Automated specification-based tester

Synopsis

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

Methods

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

Constructors

ExhaustiveSettings 

Fields

esIntRange :: [Integer]

Input range for an integer variable

esIntMapDomainRange :: [Integer]

Input range for an integer map domain

esGenericTypeRange :: [Type]

Range of instances for a type parameter of a generic procedure under test

esMapTypeRange :: [Type]

Range of instances for a type parameter of a polymorphic map

data RandomSettings Source

Settings for random testing

Constructors

RandomSettings 

Fields

rsRandomGen :: StdGen

Random number generator

rsCount :: Int

Number of test cases to be generated (currently per type in rsGenericTypeRange, if the procedure under test is generic)

rsIntLimits :: (Integer, Integer)

Lower and upper bound for integer inputs

rsIntMapDomainRange :: [Integer]

Input range for an integer map domain

rsGenericTypeRange :: [Type]

Range of instances for a type parameter of a generic procedure under test

rsMapTypeRange :: [Type]

Range of instances for a type parameter of a polymorphic map

Testing results

data Outcome Source

Outcome of a test case

Instances

outcomeDoc :: Outcome -> DocSource

Pretty-printed outcome

data TestCase Source

Description of a test case

Constructors

TestCase 

Fields

tcProcedure :: Id

Procedure under test

tcLiveIns :: [Id]

Input parameters for which an input value was generated

tcLiveGlobals :: [Id]

Global variables for which an input value was generated

tcInput :: [Value]

Values for in-parameters

tcOutcome :: Outcome

Outcome

Instances

testCaseDoc :: TestCase -> DocSource

Pretty-printed test case

data Summary Source

Test session summary

Constructors

Summary 

Fields

sPassCount :: Int

Number of passing test cases

sFailCount :: Int

Number of failing test cases

sInvalidCount :: Int

Number of invalid test cases

sUniqueFailures :: [TestCase]

Unique failing test cases

Instances

summaryDoc :: Summary -> DocSource

Pretty-printed test session summary