1. The document provides tips for getting code changes integrated into the Moodle core codebase. It discusses following the proper development process, using the tracker, getting community support, coding style, code reviews, testing, and other best practices.
2. Common pitfalls to avoid include not following all steps of the process, not getting feedback from the community, violating coding standards, disagreeing with code reviewers, and not thoroughly testing code.
3. The document demonstrates how to write automated tests using Behat and emphasizes the importance of testing, as it helps catch regressions and prevents future bugs. Testing code is a key part of getting a change integrated into Moodle core.