Font Size: a A A

Research On Testing Of Java Exception Handling Code

Posted on:2017-01-08Degree:MasterType:Thesis
Country:ChinaCandidate:Z R WangFull Text:PDF
GTID:2308330485961766Subject:Computer technology
Abstract/Summary:PDF Full Text Request
The exception handling mechanism is integrant part for modern programming lan-guage. Exception handling mechanism can be used to separate the normal and abnor-mal process, make designers get the exception structure more effectively, thus handle exception with high proficiency. Java language define lots of exception classes, and all of them are inherited from throwableclass. When abnormal condition occurs, JVM will create exception object and jump to corresponding handling program.There are always difficulties in detecting defects of exception handling code. Cur-rent works includes:static method get exception structure and dynamic method mostly testing, finished testing task and found defects. Current dynamic methods mostly used fault injection technology to change the program running track, and then covered the exception handling code. But fault injection change the source code of program and may lead to the difference with the program behavior of triggering real exception.To solve this problem, this paper present a testing method for Java exception han-dling code based on a classifier, to analysis the influence of different fault injection strategies on program behavior, and train this classifier to provide the fault injection strategy with the less influence, and finish testing task at last. In this paper, the main work includes:· Evaluate how different test strategies influence testing of exception handling code. This paper provide some typical fault injection strategies and fault in-jection by these strategies on open source projects. Instrument source code to collect program trace at the same time. Run the test suite and collect all the traces different fault injection have and real exception has. Compare fault injec-tion traces and real trace to get the influence of different fault injection strategies have on test.· Propose a selection method for test strategies based on a classifier. With this method we can make sure which static attributes of program should be collected and choose method for classifier. We can create a classifier with evaluation result, fault injection strategies, and static attributes of program collected. The classifier can give best strategy for program under test.· Implement the corresponding testing tool JETest for Java language. And design experiment for evaluating method, choosing method, and JETest. Experimental results show that this method can effectively design, generate test cases.
Keywords/Search Tags:Software Testing, Exception Handling Code, Fault Injection, Classifier
PDF Full Text Request
Related items