I've got a problem.I find really difficult to foresee the effect that my changes to the code will have over the whole application, either when I have to add new features or re-factor it. Very often it is not until testing time that I find out that I should have done things in a different way or that those changes produce an unexpected behavior.I would like to know how you guys approach changes in the code, how you get to know how those changes will affect your current code, what tips or tricks work best for you, or any recommended readings about the matter. Any help will be sincerely appreciated!Thanks a lot guys
How to choose the best approach when adding features/refactoring code
productivity
For me, the answer is getting to know your code base. When you jump in the middle of a project, there are lots of things already in place and you won't know how everything pieces together. The more you work, the more you know about the system and the easier it will be to foresee some of the effects a change might have on your system as a whole.The other big things is ask other people. Talk to your coworkers about what you want to change and how you think they should be changed. They likely have a better understanding of sections of code you don't spend much time in. They will be able to give you a heads up on if your potential changes might effect their section of the code.EDIT:If you are the most senior person on the project, still talk to people. Even if you are the only one on the project, talking out a problem helps. You don't even need a real person to talk to.Beyond that, take lots of notes. A brain dump on to a piece of paper from yesterday can be very helpful to remind yourself what you were thinking about last time you were working. You can also generate a UML diagram of your code base to see how everything is interconnected. Print that out, date it, and put it on your wall. The date is important because things are always changing and you need to know when it is time to make new notes or diagrams.