Invariant-based online software anomaly detection and selective regression testing