西安电子科技大学硕士学位论文
Java程序中异常流的测试与可视化研究:耿耀君申请学位级别:硕士专业:
计算机软件与理论指导教师:王力20080201
摘要
异常处理机制是提高软件健壮性,可靠性的重要手段之一.它将程序中的正常
控制代码和错误处理代码分离,为程序员开发高可靠的软件提供了条件.但它也
给程序中引入了新的控制流和数据流.由于这些控制流和数据流的特殊性,它们很难在白盒测试中被覆盖.这使得异常处理代码中的错误很难被排除.本文研究了Java程序中异常流的测试和可视化
问题.在静态分析部分,本文提出了计算程序中未处理异常的递归模型,并给出了利用此递归模型提取程序中的异常流信息的算法.同时在静态分析部分本文也给出可视化程序中异常流的相关算法.在动态测试部分,本文提出了以错误植入思想为指导,利用Javadebugger对程序中的异常流进行测试的方法.相关实验表明本文提出的方法具有一定的可行性.
关键词:异常处理机制软件测试
静态分析控制流图
Abstract
Exceptionhandlingmechanis
misthereliability
one
ofthemostimportantmethodsforimproving
error
and
robustnessofsoftware.Itseparatestheconditionfor
handling
develop
codefromthe
normalcode,whichprovides
programmer
to
morerobust
software.Buttheexceptionhandling
mechanism
alsointroducesthenewcontrolflows
andthenewdataflowsintheprogram.Becausetheparticularityofthecontrolflows
and
thedataflows,they
are
the
rarelycoveredinthewhite-boxtesting,whichmakes
error
intheexceptionhandlingcodehardlyexclude.Thispaperstudiesthetestingand
visualizationoftheexceptionalflowinJavaprograms.Instaticanalysissection,thepaperpresents
a
recursivemodelforcalculatingthe
unhandled
exceptionin
the
programs
and
thenprovides
on
analgorithm
forextractingtheexceptionflowinformation
intheprogramsbased
themodel.Simultaneously,inthestaticanalysissection,the