Is there any best practice for mapping?
For example if we are creating functions then is there any best practice for inputs and outputs for functions?
I think you need to elaborate the question a little bit.
The only best practice that comes to my mind is to keep it simple.
Only use scripting if it is actually necessary. Be careful if and when using connector calls (as a guideline don't); cache data instead.
Some of the practices that I follow are:
1. Use 'Boomi Suggest' only when your source and destination fields are similar. Otherwise it will complicate your mapping rather than helping you.
If you are mapping only a few fields, say about 5-10, you do not require Boomi Suggest.
2. Create a mapping plan. Know what are your source and destination fields and their formats before mapping them.
3. As Leif Jacobsen mentioned, use scripting only if absolutely necessary.
4. Add default values where the destination fields are absolutely required
I don't understand your reasoning on 1. boomi suggest is based more on how how other people map similar profiles and very little on how similar the profiles are to each other. similarity between source and destination is only used as a last resort by boomi suggest.
As a integration best practices, if you have any generic MAP shapes that can be re-used across your project or integration processes, keep them in a common folder including your generic user-defined functions, by doing this you can reference them whenever needed and also make sure that you have own this common folders and have proper governance around it.
You can also use OOTB Boomi Suggest which will save your time in mapping fields more than 20 fields, but take extra care and look for high confidence level mapping and quickly go through the mappings once done to avoid any surprises at a later stage as mapping plays a very important role in any integration.
While you defined the inputs and outputs for user-defined functions, make sure you provide a meaning full name and do not use input 1 or input 2 if its not required. Make sure the process or functions you defined should be in easily readable format and it should be maintainable/re-usable.
Retrieving data ...