您可以使用注释来标记代码。除此之外,有没有办法将代码块或代码行标记为仅用于测试目的的实验/代码?如何在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