Add more unit tests and robustness for method name search