Font Size: a A A

MC/DC Test Case Generation Technology Based On Code Transformation

Posted on:2020-12-18Degree:MasterType:Thesis
Country:ChinaCandidate:Y X LiFull Text:PDF
GTID:2428330623456420Subject:Computer technology
Abstract/Summary:PDF Full Text Request
With the rapid development of recent computer software industry,the computer software system is increasingly complex,and the quality issue of software has become a major restriction of the development of computer technology.Software testing is a major method to evaluate software quality and reliability,which is a vital process for the safety-critical software system used in the aerospace,autonomous driving,medical and other fields.These systems need extremely high reliability otherwise it can lead to disastrous consequences.Therefore,people formulated software certification standards and proposed a set of rigorous requirements for the safety-critical system,and these requirements have to be considered in software testing.For example,one requirement of the aviation software certification standard that is suitable for the safety-critical system means that the test cases for testing these systems must fulfill the modified condition/decision coverage(MC/DC)criterion.The MC/DC criterion is a rigorous code coverage criterion that aims to identify all the involved conditions can affect the outcome of the decision.Currently,a majority of testers design test data manually.However,the manual generation of test data can be inefficient and error-prone,resulting in high test cost and difficulty in guaranteeing software quality.The dynamic symbolic execution technology can automatically generate test cases for the under-test software.This technology can reduce the high cost caused by manual testing and largely improves test efficiency,and this technology has been widely adopted in recent years.However,the existing dynamic symbolic execution technique performs test generation with a target of branch coverage,which cannot fulfill the MC/DC criterion.To solve this problem,this thesis proposes a test case generation approach based on the code transformation,optimizing the current test generation process with dynamic symbolic execution technology,so that generating test cases that fulfill the criterion of MC/DC.This research analyses the source code of the program to be tested and generates conditional constraints for decisions,then adding these constraints to the source code by code transformation.When the dynamic symbolic executing technology generating test cases,these conditional constraints could guide the symbolic execution technology to discover specific routes and consequently generate the test cases that fulfill the MC/DC criterion.This thesis designs and implements a code transformation tool based on Clang compiler.The code transformation tool could finish above-mentioned work automatically and combine this tool with the dynamic symbolic execution tool KLEE,finally generating the test cases that fulfill the MC/DC criterion.This thesis applies the mentioned approach in 14 small programs and 12 Coreutils programs.The results of a serial of experiments indicate that the proposed approach can enhance the coverage ratio of MC/DC for test cases effectively.A coverage ratio of 100% was achieved when generating test cases for small programs with the proposed approach.Moreover,compared with pure dynamic symbolic execution,the MC/DC coverage of test cases generated by the proposed approach for Coreutils programs averagely increased by 14.66%,reached 98.01%.
Keywords/Search Tags:Test data generation, MC/DC, Source code transformation
PDF Full Text Request
Related items