Add captcha to registration form
You can use CAPTCHA module. To add captcha in in drupal registration form there is no need to edit any single line of code. First you download and install the module then go to module settings page (/admin/user/captcha/captcha/settings) and enable the captcha for user registration form.