The best practice is to develop and test the method outside the database. You can use your own debugging tools to verify functionality.
Be sure your tests include the following:
- Limit checks on the input values
- Limit checks on the return value (for scalar and aggregate UDFs) or on the output argument values (for table UDFs)
- Proper handling of NULLs
- Exception handling