您可以使用註釋來標記代碼。除此之外,有沒有辦法將代碼塊或代碼行標記爲僅用於測試目的的實驗/代碼?如何在eclipse中將代碼標記爲測試代碼/未經測試/實驗/修復/不完整?
僞代碼在Java中 -
public SpecialObject importantMethod(){
System.out.println("Ready to go into if else"); // Test Code: Delete Later !
if(condition after a big series of method calls){
System.out.println("Entered into if"); // Test Code: Delete Later !
//execute code which is critical to program
}else
{
System.out.println("Entered into else"); // Test Code: Delete Later !
//execute code which is critical to program
}
return specialObject;
}
public void anotherImportantMethod(){
SpecialObject obj = importantMethod();
//do something important with obj
}
您可以使用[任務標籤](http://stackoverflow.com/questions/4388292/how-do-i-enable-todo-fixme-xxx-task-tags-in-eclipse)。 – 2013-03-25 12:39:38