Defects, Fault Modeling, and Test Development Framework for RRAMs