문제

I'm using Eclipse and Java, but the answer doesn't need to be specific to those. I'm sure platform specific answers will get plenty of upvotes if they're far quicker than non-platform specific ones.

Right now I'm using

    grep "classname" find . -regex .*\.java > uses_classname.txt

to find code that might be affected by a change to the class. If there are only a few lines returned by this, I can look at it manually as it is. Otherwise, I can grep again to find the specific methods I'm modifying. Is there a better way to do this?

도움이 되었습니까?

다른 팁

A good solution is to use JUnit and practice test-driven development. After refactoring, re-running your test cases will tell you whether any existing functionality has been damaged. Moreover, since you are actually testing the code rather than grep'ing over method names, you can get full backtrace, making debugging much easier. A good introduction to JUnit can be found here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top