Add security code validation and test cases