Testing and Security Analysis of Smart Contracts