Automatic invariant detection in dynamic web applications