Generlizing liveness test to cope with contexts and be configurable