In Salesforce context
1. Poor Customization(Point and Click and Coding)
2. Bad Configuration(Report, List Views, etc)
3. Bad design and not following standard and best practices
How to overcome?
Following are some possible ways
1. Utilize Salesforce out of box feature rather than building custom solution.
2. Follow Salesforce standard and best practices.
3. Implement exception handling in the code and capture all the exceptions in a Custom object to handle it.
4. Set API usage notification – https://www.infallibletechie.com/2017/04/api-usage-notifications-in-salesforce.html as a proactive step to catch the API limits.
5. Set Up Governor Limit Email Warnings in Salesforce – https://www.infallibletechie.com/2017/04/set-up-governor-limit-email-warnings-in.html.
6. Increase the API version of the component when you get an opportunity to update/enhance it.
7. Use Salesforce Optimizer – https://www.infallibletechie.com/2017/02/salesforce-optimizer.html.
8. Use Code Scanner from Salesforce – https://www.infallibletechie.com/2015/03/how-to-check-code-quality-in-salesforce.html.
7. Use Field Trip AppExchange to find the usage of fields.
8. Use Salesforce Adoption Dashboards AppExchange product to find the user adoption.
9. Develop Test Class to test your code instead of cheating to achieve code coverage.
10. Utilize Trailhead, Release notes from Salesforce, Certifications, etc.
11. Utilize Query Plan for SOQLs – https://www.infallibletechie.com/2015/07/query-plan-in-salesforce.html.
12. Apex Exception Email in Salesforce – https://www.infallibletechie.com/2018/08/apex-exception-email-in-salesforce.html
13. Check access Metrics for Your Visualforce Pages in Salesforce and deprecate unused Visualforce pages – https://www.infallibletechie.com/2019/06/how-to-access-metrics-for-your.html
14. Review Critical Updates periodically.
15. Use Data Factories for Test Classes.
16. Use some tools to analyze the code regularly.