MuCheck-0.2.0.0: Automated Mutation Testing

Safe HaskellNone
LanguageHaskell2010

Test.MuCheck.Mutation

Description

Mutation happens here.

Synopsis

Documentation

genMutants :: String -> FilePath -> IO Int Source

The genMutants function is a wrapper to genMutantsWith with standard configuraton

genMutantsWith :: Config -> String -> FilePath -> IO Int Source

The genMutantsWith function takes configuration function to mutate, filename the function is defined in, and produces mutants in the same directory as the filename, and returns the number of mutants produced.

mutates :: [MuOp] -> Decl -> [Decl] Source

Mutating a function's code using a bunch of mutation operators (In all the three mutate functions, we assume working with functions declaration.)

mutatesN :: [MuOp] -> Decl -> Int -> [Decl] Source

mutate :: MuOp -> Decl -> [Decl] Source

Given a function, generate all mutants after applying applying op once (op might be applied at different places).E.g.: op = "== ">" and there are two instances of "<"

isFunctionD :: String -> Decl -> Bool Source

is the parsed expression the function we are looking for?

permMatches :: Decl -> [MuOp] Source

Generate all operators for permutating pattern matches in a function. We don't deal with permutating guards and case for now.

removeOnePMatch :: Decl -> [MuOp] Source

generates transformations that removes one pattern match from a function definition.

removeOneElem :: Eq t => [t] -> [[t]] Source

generate sub-arrays with one less element

parseModuleFromFile :: String -> Module Source

Parse a module. Input is the content of the file

selectValOps :: (Data a, Eq a, Typeable b, Mutable b, Eq b) => (b -> Bool) -> [b -> b] -> a -> [MuOp] Source

selectValOps' :: (Data a, Eq a, Typeable b, Mutable b) => (b -> Bool) -> (b -> [b]) -> a -> [MuOp] Source

selectIntOps :: (Data a, Eq a) => a -> [MuOp] Source

selectIfElseBoolNegOps :: (Data a, Eq a) => a -> [MuOp] Source

negating boolean in if/else statements

selectGuardedBoolNegOps :: (Data a, Eq a) => a -> [MuOp] Source

negating boolean in Guards