java - audit checker for comments -
i have java program runs automatically every morning , contains several methods independent of each other. have testing, comment out of methods not using. problem bc forget uncomment code , program may run few days without catching on not running.
is there way set automated check this?
solution: have decided add counter count number methods run , return error when number wrong.
auditing randomly inserted comments? bad idea.
use revision control, git project, if aren't already. things simple:
(if use revision control, down @ #2, , ignore rest of answer)

in above image 'remote repository' store pristine, current development version (no testing-comments).
set unit tests execute pulling latest sources repository.
for hacking around, pull separate copy (in image 'local repository', , corresponding 'working directory') , commenting/uncommenting/testing there.
unless 'push' changes 'remote repository', unit tests run non-commented, clean version available on 'remote repository'.
when done testing , have worthwhile added code, commit , 'push' 'remote repository'.
next time tests run, have new (good) code.
profit.
note: 'remote repository' , 'local repository' terms. can on same machine too.
Comments
Post a Comment