CN104572476A - Software safety testing method based on program slicing - Google Patents
Software safety testing method based on program slicing Download PDFInfo
- Publication number
- CN104572476A CN104572476A CN201510051325.7A CN201510051325A CN104572476A CN 104572476 A CN104572476 A CN 104572476A CN 201510051325 A CN201510051325 A CN 201510051325A CN 104572476 A CN104572476 A CN 104572476A
- Authority
- CN
- China
- Prior art keywords
- program
- dynamic
- slicing
- javascript
- static
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000003068 static effect Effects 0.000 claims abstract description 68
- 238000004458 analytical method Methods 0.000 claims abstract description 26
- 238000012360 testing method Methods 0.000 claims abstract description 17
- 238000001514 detection method Methods 0.000 claims description 17
- 238000010998 test method Methods 0.000 claims description 11
- 230000006870 function Effects 0.000 claims description 10
- 238000010835 comparative analysis Methods 0.000 claims description 6
- 230000009466 transformation Effects 0.000 claims description 6
- 238000004422 calculation algorithm Methods 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 238000011076 safety test Methods 0.000 claims description 4
- 238000013459 approach Methods 0.000 claims description 3
- 238000007781 pre-processing Methods 0.000 claims description 3
- 238000013519 translation Methods 0.000 claims description 3
- 230000006399 behavior Effects 0.000 abstract description 9
- 238000005516 engineering process Methods 0.000 abstract description 8
- 238000011160 research Methods 0.000 description 6
- 238000013461 design Methods 0.000 description 4
- 238000012795 verification Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000006378 damage Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000009863 impact test Methods 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention provides a software safety testing method based on program slicing. By the method, a program slicing technology is discussed, and an unreachable path detecting scheme based on program slicing is raised. The software safety testing method comprises the following steps of inputting JavaScript language codes extracted from a webpage; converting the JavaScript language codes into LLVM (low level virtual machine) intermediate representation; and respectively performing static program slicing and dynamic program slicing on the LLVM intermediate representation. Inputting of programs is not assumed during static program slicing, analysis is based on static information of the programs completely, and a slicing result contains an unreachable path. In dynamic program slicing, a path behavior carried out under certain specific inputting is concerned, and path behaviors caused by all possible inputting of variables are not concerned, so that a dynamic slicing result does not contain the unreachable path. By the combination of the static program slicing and the dynamic program slicing, the unreachable path in the program can be detected, so that the testing efficiency of software is improved.
Description
Technical field
The present invention gives a kind of design proposal of the software security method of testing based on program slice, be mainly used in solving the problem that the infeasible paths that may exist in the JavaScript script language code in webpage is detected, belong to software security field tests.
Background technology
Along with developing rapidly of Internet technology, create many web application services, multipad also becomes webization more, and the function of browser also becomes more and more.Browser, except browsing webpage, plays the function of desktop programs originally gradually, becomes the multifunctional service platform of people's routine office work, amusement, transaction, communication.The universal of web application makes the security of web technology will become a large problem.What stand in the breach is exactly the security of web application software.
Software is a series of according to the computer data of particular order tissue and the set of instruction, and the awareness of safety of developer's coding and the development of ability and new web technology will inevitably cause the web application developed more or less to there is certain fault.The basic goal of software test is exactly the fault will eliminated as much as possible in software, and make software before being taken into use, its fault density is low as far as possible or reach acceptable degree.Along with the raising of web application complicacy, adopt the mistake in traditional software testing technology discovery and positioning software more and more difficult.
The international soft project meeting of doctor M.Weiser 1981 Nian reports the achievement in research of relevant procedures microtomy.Such problem can be run into: be more prone to build, understand and safeguard if a large program will become after being decomposed into a series of little module in program design and analytic process; In practical programs analysis and debug process, analyst sometimes only can be interested in a part of behavior of program, and program slice is from these behaviors of observation; If this interested behavior can be expressed as " in some program statement centralized definition or the value using some variable ", so this specification is just referred to as a slice criterion; Utilize data stream analysis techniques to find likely to the program code that this specific behavior has an impact, these codes are referred to as a program slice of this program; According to the definition of M.Weiser, program slice itself is also an executable program, and its behavior should be of equal value with that particular subset of source program.
Program slice is a kind of important process analysis and understanding technology, and the process of cutting into slices to program is exactly remove the code irrelevant with point of interest, and the statement only retaining specific calculation relevant carrys out routine analyzer.Program slice is paid close attention to the data dependence between program point and is controlled the interact relation such as dependence, and by carrying out section acquisition program slice to a program, this section contains may to the influential whole statement of the value of the variable being positioned at a specific program point.Program slicing technique has a wide range of applications in program debug, regression test, software maintenance, program comprehension and reverse-engineering etc.Software test based on program slice to be decomposed software according to certain slice criterion and cuts out, thus while simplifying procedures, make program slice code still reflect the Partial Feature of source program.
JavaScript a kind ofly has a client-side scripting language of relative safety based on object and event-driven, also be a kind of literal translation formula script being widely used in client Web exploitation simultaneously, be generally comprised within the HTML statement of webpage, performed by web browser.Be usually used in adding dynamic function to html web page, such as respond the various operations of user.At present for traditional C ++, the microtomy of the static instruction such as Java tended to ripe, but it is less to carry out the research of program slice for dynamic languages such as JavaScript.This has two main causes, and one is in the web1.0 epoch, and JavaScript is only used in the verification to simple customer end, and code is relatively simple and amount is few, and has arrived the web2.0 epoch, and JavaScript has just been used to complicated operation to realize several functions.Two is that JavaScript and HTML is frequent alternately, and itself has again dirigibility and dynamic, analyzes comparatively difficulty.Therefore, the research carrying out program slice for JavaScript just seems very important.
For the problem of web safety, Chinese scholars has made a large amount of research work, proposes many effective solutions, achieves remarkable achievement.Such as, but due to a variety of causes, developer is inconsiderate, and it is inaccessible for there are some paths in code, namely these path programs are carried out any input and all cannot be performed.Therefore, the existence of infeasible paths brings difficulty can to the test based on path, the adequacy of impact test.The statement of infeasible paths may be comprised in the code of JavaScript script containing some, the efficiency being conducive to improving safety test is detected to it.
At present, the research for program infeasible paths adopts Static Analysis Method mostly.Static Analysis Method refers to be analyzed program when not executive routine, and morphology grammer, data stream, control flow check etc. namely by analyzing source code excavate the potential problems of program.Some means such as main use symbol assessment, linear solution and rule-based verification.Although these technology have established certain basis for testing research, there is very large restriction owing to not considering the factor such as complicacy and accessible Program Type.
Because static analysis is carried out before program is run, it can suppose that all paths of program all can reach.But in program, having some paths to be inaccessible, which kind of namely adopts input all can not by this path.The possibility of result that so static analysis produces can comprise some statement that can't really run in practical implementation, i.e. infeasible paths.And in data links, if selected test data is the statement be positioned at for those on infeasible paths, so can't really testedly arrive in test process, this causes a large amount of wastes by the generation phase of test data.In other words, the information of infeasible paths can improve the accuracy of static analysis.
A part of infeasible paths can be determined by the correlativity detecting static branch.For the conditional branching of on a certain paths, if its result can thus before statement or branch determine, then it has static coherence.Experiment proves, for large program, can detect about have the conditional statement of 9% to 40% to have correlativity in the compilation phase.Therefore, the infeasible paths of some is had can to detect before program is run.
Although static method can get rid of a part of infeasible paths, a large amount of infeasible paths is still had to enter the dynamic test stage.Early stage dynamic test can not directly on one's own initiative be adopted an effective measure for infeasible paths, usually takes the method limited after a test.More common method is limit search number of times and the degree of depth etc., namely visiting property performs unsuccessfully thinks that path is unreachable, and the limitation of the method is very large, is easy to the loss causing path, by can the method be improved in conjunction with some other good search algorithm, but limited efficiency.
List of references:
[1]M.Weiser.Program Slicing.In proceeding of ICSE`81of the 5
thinternationalconference on Software engineering,439-4491981.
[2]Hongchang Zhang,Shujuan Jiang,Rong Jin.An Improved Static Program SlicingAlgorithm Using Stack Trace[A].Proceedings of 2011IEEE 2nd InternationalConference on Software Engineering and Service Science(ICSESS 2011)[C].2011.
Summary of the invention:
Technical matters: the object of the invention is the design proposal proposing a kind of software security method of testing based on program slice, the thought of program slice is applied in the detection to infeasible paths in program by the method, proposes a kind of infeasible paths detection scheme based on program slice.The JavaScript script language code that the method is extracted from webpage, by converting thereof into as LLVM intermediate representation, then respectively static routine section and dynamic program slicing are carried out to it, and section result is comprehensively analyzed, build the detection scheme of a program infeasible paths, thus improve the testing efficiency of software.Final purpose is a kind of software security method of testing based on program slice of exploitation.
Technical scheme: the design proposal that the present invention proposes a kind of software security method of testing based on program slice, the thought of program slice is applied in the detection to infeasible paths in program, proposes a kind of infeasible paths detection scheme based on program slice.The JavaScript script language code that the method is extracted from webpage, by converting thereof into as LLVM intermediate representation, then respectively static routine section and dynamic program slicing are carried out to it, and section result is comprehensively analyzed, build the detection scheme of a program infeasible paths.Due to static routine section any hypothesis is not done to the input of program, the analysis done completely with the static information of program for foundation, so can infeasible paths cover section result in.But for dynamic program slicing, what its was paid close attention to is the path behavior performed under certain specific input, and can not pay close attention to the path behavior that all possible input of variable causes, therefore the result of Dynamic Slicing often can not contain infeasible paths.Herein static routine section is combined with dynamic program slicing, be applied in the safety test of JavaScript script language code, with the infeasible paths in trace routine, thus improve the testing efficiency of software.
LLVM is the frame system of framework compiler, writes form with C++, for optimizing with the compilation time of the program of random procedure language compilation, link time, working time and free time, keeps open to developer, and compatible existing script.To the developer paying close attention to technique of compiling, one of major advantage of LLVM is to provide the intermediate code irrelevant with language.This makes can be interconnected by different language through LLVM, meanwhile, issues the adjustable that intermediate code but not object code can play its potential and don't injury program on the target system better.
Because the cut into slices analysis done of static routine is be foundation with the static information of program completely, therefore static routine section can all possible execution route of routine analyzer.But may to there are some paths in these paths be inaccessible, namely these paths do not perform by any input, so often comprise some infeasible paths in the result of static routine section.But dynamic program slicing only considers the situation of program under certain specific initial conditions, can avoid infeasible paths well.
Do not contain the program of infeasible paths for one and call the turn, when slice criterion is identical, when input value covers all possible situation, the union of dynamic program slicing result should be identical with static routine section.And for a program containing infeasible paths, when slice criterion is identical, when the input value of dynamic program slicing contains the All Paths of this program, its result should be less than static routine section result, and this few part is out exactly the infeasible paths of program.
By above-mentioned analysis, the present invention proposes an infeasible paths detection scheme based on program slice, namely respectively static routine section and dynamic program slicing are carried out to same program, then both results are analyzed, thus find out the infeasible paths in program.By the code of JavaScript script being converted to LLVM intermediate representation of equal value, LLVM instrument is utilized to carry out static routine section and dynamic program slicing to it respectively.Result of being cut into slices by static routine all may the union of dynamic program slicing result of input value be made comparisons with containing, and obtains the infeasible paths in program.
Infeasible paths detection method of the present invention is by by the code conversion of JavaScript script being LLVM (Low Level Virtual Machine underlying virtual machine) intermediate representation, respectively static routine section and dynamic program slicing are carried out to intermediate representation, then Treatment Analysis is carried out to the result obtained, find out the infeasible paths in program, improve the testing efficiency of software.
The thought of program slice is applied in the detection to infeasible paths in program, propose a kind of infeasible paths detection method based on program slice, the one literal translation formula script JavaScript code that the method is extracted from webpage, by converting thereof into as underlying virtual machine LLVM (Low Level VirtualMachine) intermediate representation, then respectively static routine section and dynamic program slicing are carried out to it, and section result is comprehensively analyzed, build the detection method of a program infeasible paths, static routine section is combined with dynamic program slicing, be applied in the safety test of JavaScript script language code, with the infeasible paths in trace routine, improve the testing efficiency of software, this method of testing, its step comprised is:
Step 1) extract the code segment of the JavaScript script in webpage, the script of webpage forms primarily of two parts, only having the HTML (Hypertext Markup Language) HTML of label and content of text (Hyper TextMark-up Language) and being nested in HTML is the JavaScript statement block that it adds dynamic function, and this method is only concerned about the part of the JavaScript statement block wherein realizing dynamic function;
Step 2) pre-service is carried out to the code segment of JavaScript script, in order to cut into slices to JavaScript script easily, first need to do some pre-service to the source program code of JavaScript, comprise labeled statement, routine analyzer traffic flow information, the definition of record variable and quote attribute, determines the dominance relation between statement, and morphology grammatical analysis is carried out to program, thus know the related data stream information in source program;
Step 3) convert JavaScript script language code to LLVM intermediate representation, due to the dynamic of JavaScript script, directly section is carried out and inconvenience to JavaScript, after above-mentioned preprocessing process, this method adopts the method code of JavaScript script being converted to LLVM intermediate representation of equal value to carry out program slice to it, and by the corresponding relation of JavaScript source code and LLVM intermediate representation stored in transformation warehouse, then respectively static routine section and dynamic program slicing are carried out to the LLVM intermediate representation after conversion;
Step 4) static routine section is carried out to LLVM intermediate representation, adopt the data stream sliced sheet algorithm of doctor M.Weiser, namely the data stream of static state used when calculation procedure is cut into slices and the analytical approach of control flow check, any hypothesis is not done to the input of program, the all possible execution route of routine analyzer, first calculate directly related variable statement, then calculate indirect correlation variable and indirect correlation statement according to control dependence, the static routine obtained section result is designated as S;
Step 5) utilize semiology analysis to obtain the different dynamic execution path of program, the dynamic execution path of program due to the difference of input not unique often, need all different dynamic execution path of acquisition program, the i.e. union of code segment dynamic program slicing under various input condition, to cut into slices with the static routine of code segment do comparative analysis, thus the infeasible paths in trace routine, therefore the method that symbolization performs explores the different execution routes of program, the input for the different execution route of program is designated as I respectively
1, I
2..., I
n, for determining that the dynamic program slicing of program is prepared;
Step 6) according to step 5) the different input condition I that obtains
1, I
2..., I
nrespectively dynamic program slicing is carried out to LLVM intermediate representation, first to rely on according to immediate data the statement calculating the current dynamic input value of all impacts, then determine which statement can cause the execution of dynamic input value place fundamental block by static cost control dependency analysis, then the current statement affecting execution by dynamic input value is found according to execution history, just terminate until the dynamic input value in Work List cuts into slices to calculate after all performing, the dynamic program slicing result obtained is designated as D respectively
1, D
2..., D
n;
Step 7) by step 6) the different dynamic program slicing result D that obtains
1, D
2..., D
nbe combined, obtain the dynamic program slicing result set D of whole program
uwith step 5) in the static slicing result S of program that obtains do comparative analysis, if a program is not containing infeasible paths, so when the input value of dynamic program slicing contains the whole possible situation of this program, the result that its section result should be cut into slices with static routine matches, i.e. D
u=S, if the result that the result set of dynamic program slicing is cut into slices than static routine is few, so this few part is out exactly the infeasible paths of program, and the program infeasible paths result obtained is designated as L, i.e. L=S-D
u;
Step 8) according to the corresponding relation of the JavaScript source code deposited in transformation warehouse and LLVM intermediate representation, by step 7) in infeasible paths result L convert back the form of JavaScript source code.
Beneficial effect: as the software security method of testing based on program slice, the present invention combines the infeasible paths that static routine section and the section of dynamic program slicing two broad aspect come in trace routine substantially, the detection method that it is different from the past, has following Some features and innovation:
(1) due to the dynamic of JavaScript script, directly carry out section and inconvenience to JavaScript, the present invention adopts and carries out indirect program slice by the method source code of JavaScript script being converted to LLVM intermediate representation.
(2) program dynamic execution path due to input difference not unique often, the all different dynamic execution path of acquisition program is needed in the present invention, therefore the method that symbolization performs explores the different execution routes of program, input for the different execution route of program is recorded, respectively for determining that the dynamic program slicing of program is prepared.
(3) analyze in conjunction with static routine section result and dynamic program slicing result, the part that the result set of the dynamic program slicing result of cutting into slices than static routine is few is the infeasible paths of program, and this method makes the testing result of calling program infeasible paths more accurate, credible.
Accompanying drawing explanation
Fig. 1 is the software security method of testing overall flow block diagram based on program slice.
Embodiment:
The present invention proposes a kind of design proposal of the software security method of testing based on program slice, the JavaScript script language code that the method is extracted from webpage, by converting thereof into as LLVM intermediate representation, then respectively static routine section and dynamic program slicing are carried out to it, and section result is comprehensively analyzed, build the detection scheme of a program infeasible paths.Introduce the detailed description of infeasible paths detection method in the present invention below:
1. pretreatment module
The present invention will extract the code segment of JavaScript script from webpage, by means such as static routine section and dynamic program slicings, detects in program whether there is infeasible paths.
The script of webpage forms primarily of two parts, only has the html language of label and content of text and is nested in HTML as it adds the JavaScript statement block of dynamic function.This method is only concerned about the part of the JavaScript statement block wherein realizing dynamic function, carries out program slice analysis to this part.Therefore, first to extract the code segment of JavaScript script from webpage, usually be nested in the code segment that html tag <script> and </script> is exactly directly JavaScript script.
Then this method needs to carry out pre-service to the code segment of JavaScript script.In order to cut into slices to JavaScript script easily, first need to do some pre-service to the source program code of JavaScript, comprise labeled statement, routine analyzer traffic flow information, the definition of record variable and quote attribute, determine the dominance relation etc. between statement, and morphology grammatical analysis is carried out to program, thus know the related data stream information etc. in source program.Be exactly specifically read source program by row in a text mode, and mark successively every line statement give every bar statement add that the content of corresponding line number to every bar statement distinguishes, whether judgment variable is defined herein or is cited judges whether every bar statement exists domination point.Then morphology grammatical analysis is carried out, for construction procedures dependency graph is prepared.
The most important thing is in the task of this module JavaScript script language code to be converted to LLVM intermediate representation (IR).Due to the dynamic of JavaScript script, directly section is carried out and inconvenience to JavaScript, after above-mentioned preprocessing process, by the method code of JavaScript script being converted to LLVM intermediate representation of equal value, program slice is carried out to it, and by the corresponding relation of JavaScript source code and LLVM intermediate representation stored in transformation warehouse, then respectively static routine section and dynamic program slicing are carried out to the LLVM intermediate representation after conversion.
2. static routine section module
Static routine section is carried out to the LLVM intermediate representation obtained in module 1.Static routine Slicing Algorithm have employed the data stream sliced sheet algorithm of Weiser.Namely the data stream of static state used when calculation procedure is cut into slices and the analytical approach of control flow check, any hypothesis is not done to the input of program, the all possible execution route of routine analyzer, first calculate directly related variable statement, then calculate indirect correlation variable and indirect correlation statement according to control dependence.The static routine obtained section result is designated as S.
3. dynamic program slicing module
Dynamic program slicing is carried out to the LLVM intermediate representation obtained in module 1.First semiology analysis will be utilized to obtain the different dynamic execution path of program.The dynamic execution path of program due to the difference of input not unique often, the all different dynamic execution path of acquisition program is needed in the present invention, the i.e. union of code segment dynamic program slicing under various input condition, to cut into slices with the static routine of code segment do comparative analysis, thus the infeasible paths in trace routine.Therefore the method that symbolization performs explores the different execution routes of program, the input for the different execution route of program is designated as I respectively
1, I
2..., I
n, for determining that the dynamic program slicing of program is prepared.
According to the different input condition I acquired
1, I
2..., I
nrespectively dynamic program slicing is carried out to LLVM intermediate representation.First to rely on according to immediate data the statement calculating the current dynamic input value of all impacts.Then determine which statement can cause the execution of dynamic input value place fundamental block by static cost control dependency analysis.Then the current statement affecting execution by dynamic input value is found according to execution history.Just terminate until the dynamic input value in Work List cuts into slices to calculate after all performing.The dynamic program slicing result obtained is designated as D respectively
1, D
2..., D
n.
4. results analyses module
The different dynamic program slicing result D that dynamic program slicing module is got
1, D
2..., D
nbe combined, obtain the dynamic program slicing result set D of whole program
u, do comparative analysis with the cut into slices static slicing result S of the program got in module of static routine.If program is not containing infeasible paths, so when the input value of dynamic program slicing contains the whole possible situation of this program, the result that its section result should be cut into slices with static routine matches, i.e. D
u=S.If the result that the result set of dynamic program slicing is cut into slices than static routine is few, so this few part is out exactly the infeasible paths of program, and the program infeasible paths result obtained is designated as L, i.e. L=S-D
u.
According to the corresponding relation of the JavaScript source code deposited in transformation warehouse and LLVM intermediate representation, the infeasible paths result L above-mentioned analysis drawn converts back the form of JavaScript source code.
Claims (1)
1. the software security method of testing based on program slice, it is characterized in that, the thought of program slice is applied in the detection to infeasible paths in program, propose a kind of infeasible paths detection method based on program slice, the one literal translation formula script JavaScript code that the method is extracted from webpage, by converting thereof into as underlying virtual machine LLVM intermediate representation, then respectively static routine section and dynamic program slicing are carried out to it, and section result is comprehensively analyzed, build the detection method of a program infeasible paths, static routine section is combined with dynamic program slicing, be applied in the safety test of JavaScript script language code, with the infeasible paths in trace routine, improve the testing efficiency of software, this method of testing, its step comprised is:
Step 1) extract the code segment of the JavaScript script in webpage, the script of webpage forms primarily of two parts, only having the HTML (Hypertext Markup Language) HTML of label and content of text and being nested in HTML is the JavaScript statement block that it adds dynamic function, and this method is only concerned about the part of the JavaScript statement block wherein realizing dynamic function;
Step 2) pre-service is carried out to the code segment of JavaScript script, in order to cut into slices to JavaScript script easily, first need to do some pre-service to the source program code of JavaScript, comprise labeled statement, routine analyzer traffic flow information, the definition of record variable and quote attribute, determines the dominance relation between statement, and morphology grammatical analysis is carried out to program, thus know the related data stream information in source program;
Step 3) convert JavaScript script language code to LLVM intermediate representation, due to the dynamic of JavaScript script, directly section is carried out and inconvenience to JavaScript, after above-mentioned preprocessing process, this method adopts the method code of JavaScript script being converted to LLVM intermediate representation of equal value to carry out program slice to it, and by the corresponding relation of JavaScript source code and LLVM intermediate representation stored in transformation warehouse, then respectively static routine section and dynamic program slicing are carried out to the LLVM intermediate representation after conversion;
Step 4) static routine section is carried out to LLVM intermediate representation, adopt the data stream sliced sheet algorithm of doctor M.Weiser, namely the data stream of static state used when calculation procedure is cut into slices and the analytical approach of control flow check, any hypothesis is not done to the input of program, the all possible execution route of routine analyzer, first calculate directly related variable statement, then calculate indirect correlation variable and indirect correlation statement according to control dependence, the static routine obtained section result is designated as S;
Step 5) utilize semiology analysis to obtain the different dynamic execution path of program, the dynamic execution path of program due to the difference of input not unique often, need all different dynamic execution path of acquisition program, the i.e. union of code segment dynamic program slicing under various input condition, to cut into slices with the static routine of code segment do comparative analysis, thus the infeasible paths in trace routine, therefore the method that symbolization performs explores the different execution routes of program, the input for the different execution route of program is designated as I respectively
1, I
2..., I
n, for determining that the dynamic program slicing of program is prepared;
Step 6) according to step 5) the different input condition I that obtains
1, I
2..., I
nrespectively dynamic program slicing is carried out to LLVM intermediate representation, first to rely on according to immediate data the statement calculating the current dynamic input value of all impacts, then determine which statement can cause the execution of dynamic input value place fundamental block by static cost control dependency analysis, then the current statement affecting execution by dynamic input value is found according to execution history, just terminate until the dynamic input value in Work List cuts into slices to calculate after all performing, the dynamic program slicing result obtained is designated as D respectively
1, D
2..., D
n;
Step 7) by step 6) the different dynamic program slicing result D that obtains
1, D
2..., D
nbe combined, obtain the dynamic program slicing result set D of whole program
uwith step 5) in the static slicing result S of program that obtains do comparative analysis, if a program is not containing infeasible paths, so when the input value of dynamic program slicing contains the whole possible situation of this program, the result that its section result should be cut into slices with static routine matches, i.e. D
u=S, if the result that the result set of dynamic program slicing is cut into slices than static routine is few, so this few part is out exactly the infeasible paths of program, and the program infeasible paths result obtained is designated as L, i.e. L=S-D
u;
Step 8) according to the corresponding relation of the JavaScript source code deposited in transformation warehouse and LLVM intermediate representation, by step 7) in infeasible paths result L convert back the form of JavaScript source code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510051325.7A CN104572476B (en) | 2015-01-30 | 2015-01-30 | A kind of infeasible paths detection method based on program slice |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510051325.7A CN104572476B (en) | 2015-01-30 | 2015-01-30 | A kind of infeasible paths detection method based on program slice |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104572476A true CN104572476A (en) | 2015-04-29 |
CN104572476B CN104572476B (en) | 2017-06-30 |
Family
ID=53088608
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510051325.7A Expired - Fee Related CN104572476B (en) | 2015-01-30 | 2015-01-30 | A kind of infeasible paths detection method based on program slice |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104572476B (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105787369A (en) * | 2016-02-29 | 2016-07-20 | 南京邮电大学 | Android software security analysis method based on slice measurement |
CN106021116A (en) * | 2016-06-07 | 2016-10-12 | 北京信息科技大学 | Inaccessible function call path detection method in complex system |
CN106933572A (en) * | 2017-02-20 | 2017-07-07 | 南京邮电大学 | A kind of measurement model based on the section of LLVM intermediate representation programs |
CN106951303A (en) * | 2017-02-20 | 2017-07-14 | 南京邮电大学 | A kind of LLVM intermediate representation program dicing methods based on information flow analysis |
CN106951366A (en) * | 2017-03-09 | 2017-07-14 | 南京邮电大学 | A kind of dead code detection method of C language based on program slicing technique |
CN107358099A (en) * | 2017-06-09 | 2017-11-17 | 南京邮电大学 | Useless change quantity measuring method based on LLVM intermediate representation program microtomies |
CN107808097A (en) * | 2016-09-09 | 2018-03-16 | 安提特软件有限责任公司 | JavaScript path enumerations |
CN109815153A (en) * | 2019-02-19 | 2019-05-28 | 北京天诚同创电气有限公司 | The static slicing method and apparatus of PLC program and motor start-up and shut-down control program |
CN110262804A (en) * | 2019-06-13 | 2019-09-20 | 南京邮电大学 | JavaScript based on program slice continues transmitting style method for transformation |
CN110334302A (en) * | 2019-05-24 | 2019-10-15 | 北京因特睿软件有限公司 | Complicated Web application front end motion time analyses method |
CN111737131A (en) * | 2020-06-23 | 2020-10-02 | 南京大学 | Code error positioning method based on probability alignment |
CN113347096A (en) * | 2021-08-06 | 2021-09-03 | 湖南三湘银行股份有限公司 | Transmission processing method of third party payment data |
CN114564156A (en) * | 2022-02-10 | 2022-05-31 | 深圳市纵维立方科技有限公司 | Model slicing method and device, 3D printing system and electronic equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101873323A (en) * | 2010-06-21 | 2010-10-27 | 南京邮电大学 | Web service platform based on program slicing technique |
CN101901188A (en) * | 2010-07-23 | 2010-12-01 | 哈尔滨工程大学 | Reachable path-based software testing method |
-
2015
- 2015-01-30 CN CN201510051325.7A patent/CN104572476B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101873323A (en) * | 2010-06-21 | 2010-10-27 | 南京邮电大学 | Web service platform based on program slicing technique |
CN101901188A (en) * | 2010-07-23 | 2010-12-01 | 哈尔滨工程大学 | Reachable path-based software testing method |
Non-Patent Citations (2)
Title |
---|
XIAOYU ZHOU: "Slincing Concurrent Programs Based on Program Reachability Graphs", 《IEEE》 * |
王庆坛: "一种改进的程序可达基路径生成方法", 《计算机工程》 * |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105787369A (en) * | 2016-02-29 | 2016-07-20 | 南京邮电大学 | Android software security analysis method based on slice measurement |
CN105787369B (en) * | 2016-02-29 | 2018-08-17 | 南京邮电大学 | Android software safety analytical method based on slice measurement |
CN106021116A (en) * | 2016-06-07 | 2016-10-12 | 北京信息科技大学 | Inaccessible function call path detection method in complex system |
CN106021116B (en) * | 2016-06-07 | 2018-07-13 | 北京信息科技大学 | Unreachable function call path detection method in complication system |
CN107808097A (en) * | 2016-09-09 | 2018-03-16 | 安提特软件有限责任公司 | JavaScript path enumerations |
CN106951303A (en) * | 2017-02-20 | 2017-07-14 | 南京邮电大学 | A kind of LLVM intermediate representation program dicing methods based on information flow analysis |
CN106933572A (en) * | 2017-02-20 | 2017-07-07 | 南京邮电大学 | A kind of measurement model based on the section of LLVM intermediate representation programs |
CN106951303B (en) * | 2017-02-20 | 2020-09-22 | 南京邮电大学 | LLVM intermediate representation program slicing method based on information flow analysis |
CN106951366A (en) * | 2017-03-09 | 2017-07-14 | 南京邮电大学 | A kind of dead code detection method of C language based on program slicing technique |
CN107358099A (en) * | 2017-06-09 | 2017-11-17 | 南京邮电大学 | Useless change quantity measuring method based on LLVM intermediate representation program microtomies |
CN107358099B (en) * | 2017-06-09 | 2020-05-05 | 南京邮电大学 | Useless variable detection method based on LLVM intermediate representation program slicing technology |
CN109815153A (en) * | 2019-02-19 | 2019-05-28 | 北京天诚同创电气有限公司 | The static slicing method and apparatus of PLC program and motor start-up and shut-down control program |
CN109815153B (en) * | 2019-02-19 | 2024-01-26 | 北京天诚同创电气有限公司 | Static slicing method and device for PLC program and motor start-stop control program |
CN110334302B (en) * | 2019-05-24 | 2021-09-10 | 北京因特睿软件有限公司 | Complex Web application front-end runtime analysis method |
CN110334302A (en) * | 2019-05-24 | 2019-10-15 | 北京因特睿软件有限公司 | Complicated Web application front end motion time analyses method |
CN110262804A (en) * | 2019-06-13 | 2019-09-20 | 南京邮电大学 | JavaScript based on program slice continues transmitting style method for transformation |
CN111737131B (en) * | 2020-06-23 | 2023-08-08 | 南京大学 | Code error positioning method based on probability alignment |
CN111737131A (en) * | 2020-06-23 | 2020-10-02 | 南京大学 | Code error positioning method based on probability alignment |
CN113347096A (en) * | 2021-08-06 | 2021-09-03 | 湖南三湘银行股份有限公司 | Transmission processing method of third party payment data |
CN114564156A (en) * | 2022-02-10 | 2022-05-31 | 深圳市纵维立方科技有限公司 | Model slicing method and device, 3D printing system and electronic equipment |
CN114564156B (en) * | 2022-02-10 | 2024-06-04 | 深圳市纵维立方科技有限公司 | Model slicing method and device, 3D printing system and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN104572476B (en) | 2017-06-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104572476A (en) | Software safety testing method based on program slicing | |
Mei et al. | A static approach to prioritizing junit test cases | |
CN105787367B (en) | A kind of the patch safety detecting method and system of software upgrading | |
US20180107821A1 (en) | Code instrumentation for runtime application self-protection | |
Antal et al. | Static javascript call graphs: A comparative study | |
US20110314337A1 (en) | Method and Apparatus for Locating Input-Model Faults Using Dynamic Tainting | |
Feng et al. | Efficient vulnerability detection based on abstract syntax tree and deep learning | |
CN104881607A (en) | XSS vulnerability detection method based on simulating browser behavior | |
Kim | Finding bad code smells with neural network models | |
Ribeiro et al. | Jaguar: A spectrum-based fault localization tool for real-world software | |
Thomas et al. | Stringer: Measuring the importance of static data comparisons to detect backdoors and undocumented functionality | |
CN110765459A (en) | Malicious script detection method and device and storage medium | |
Lin et al. | Recovering fitness gradients for interprocedural Boolean flags in search-based testing | |
Mitropoulos et al. | Time present and time past: analyzing the evolution of JavaScript code in the wild | |
Moog et al. | Statically detecting javascript obfuscation and minification techniques in the wild | |
CN102141959B (en) | Test case generation method restrained by context-free grammar | |
Bian et al. | SPAPE: A semantic-preserving amorphous procedure extraction method for near-miss clones | |
Rong et al. | How is logging practice implemented in open source software projects? a preliminary exploration | |
Malavolta et al. | JavaScript dead code identification, elimination, and empirical assessment | |
Nguyen et al. | Exploring output-based coverage for testing PHP web applications | |
CN105630678A (en) | Intelligent ammeter software reliability detector and detection method for intelligent ammeter software reliability | |
Wang et al. | Detect related bugs from source code using bug information | |
Baumgartner et al. | Live Code Smell Detection of Data Clumps in an Integrated Development Environment. | |
Bajaj et al. | Dompletion: DOM-aware JavaScript code completion | |
Dhoolia et al. | Debugging model-transformation failures using dynamic tainting |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170630 |
|
CF01 | Termination of patent right due to non-payment of annual fee |