Testing logical formulae