We must use the Design Principles in Object Oriented Development. The most important priciple is "Open-Closed Principle".
By definition: A module should be OPEN for extension but CLOSED for modification.
In simple words: We can add new features in the module without changing the existing code (CLOSED) but by adding new code (OPEN). By following this principle, we can make sure that by changing the code in the method we are not going to break existing functionality. Let us try to see it using the example.