简体   繁体   English

我可以获取Java程序测试用例的执行跟踪吗?

[英]Can i get the execution trace for a test case for a java program?

I want to run a java program with some test input values and when the execution ends I want to know the complete execution trace, for each conditional statement - what path was followed. 我想运行一个带有一些测试输入值的Java程序,当执行结束时,我想知道每个条件语句的完整执行跟踪-遵循什么路径。 Is there anything that can help me with this? 有什么可以帮助我的吗?

当然,只需使用调试API即可

You may want to have a look at AspectJ . 您可能需要看一下AspectJ

You can transparently intercept and log code execution using this. 您可以使用此方法透明地拦截和记录代码执行。 I'm not sure you can intercept every (say) if() statement, but you can certainly intercept method calls etc., and you should hopefully then be able to derive the execution flow from there. 我不确定您是否可以拦截每个(例如) if()语句,但是您当然可以拦截方法调用等,并且您应该希望能够从那里派生执行流程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM