CN108446122A - A kind of parameter consistency verification method and device - Google Patents

A kind of parameter consistency verification method and device Download PDF

Info

Publication number
CN108446122A
CN108446122A CN201810239209.1A CN201810239209A CN108446122A CN 108446122 A CN108446122 A CN 108446122A CN 201810239209 A CN201810239209 A CN 201810239209A CN 108446122 A CN108446122 A CN 108446122A
Authority
CN
China
Prior art keywords
tables
call
parameter
argument
length
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
Application number
CN201810239209.1A
Other languages
Chinese (zh)
Other versions
CN108446122B (en
Inventor
庄为
李诗宇
许佳丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201810239209.1A priority Critical patent/CN108446122B/en
Publication of CN108446122A publication Critical patent/CN108446122A/en
Application granted granted Critical
Publication of CN108446122B publication Critical patent/CN108446122B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

This application provides a kind of parameter consistency verification method and devices, the information of parameter and argument is obtained from source code, and obtain parameter length and the whether identical result of argument length, in the case that different, export the location information of parameter and argument in source code, can programming by prompting personnel, programming personnel can correct in time, to avoid occurring the problem of memory accessing outside in the process of running.Compared with the mode manually investigated, there is higher accuracy.

Description

A kind of parameter consistency verification method and device
Technical field
This application involves electronic information field more particularly to a kind of parameter consistency verification methods and device.
Background technology
In the source code that Common business Oriented Language is write, formal parameter (abbreviation parameter) refers to fixed in subprogram (called program) The suction parameter of justice.When essential parameter (abbreviation argument) refers to main program (homophony program) call subroutine, the parameter of transmission.
Due to error of programmer etc., in source code, parameter may be different from the length of argument.In this situation Under, the compiling in source code and operational process, it may appear that because memory is visited caused by the memory headroom occupancy of parameter is inconsistent Ask the problem of crossing the border.
In the prior art, the appearance of this problem is avoided by way of manual review source code, but this mode is easy Omit, so, can not avoid completely because parameter memory headroom occupy it is inconsistent caused by memory accessing outside Problem.
Invention content
This application provides a kind of parameter consistency verification method and devices, it is therefore intended that solves because of parameter and argument Caused by memory headroom occupancy is inconsistent the problem of memory accessing outside.
To achieve the goals above, this application provides following technical schemes:
A kind of parameter consistency verification method, including:
From the program of source code, the length information of parameter and argument is obtained;
Whether the length of the length and argument that compare parameter is identical, and generates comparison result;
If the comparison result indicates that the length of the length and the argument of the parameter differs, the shape is exported Ginseng and location information of the argument in the source code.
Optionally, the length information of the acquisition parameter and argument includes:
The length information of the parameter and the argument is stored in preset tables of data, the tables of data includes:E_ PARM_LIST tables and C_PARM_LIST tables;
The E_PARM_LIST tables are used to store the length information of the parameter of the entrance of described program;
C_PARM_LIST tables are used to store the argument length information in the CALL sentences in described program.
Optionally, the E_PARM_LIST tables are additionally operable to:
Storage be the entrance of the unique number of parameter distribution, described program belonging to the parameter unique number, The title of the serial number of the parameter and the parameter.
Optionally, the C_PARM_LIST tables are additionally operable to:
Store the unique of the CALL sentences in the described program belonging to the unique number for argument distribution, the argument The title of number, the serial number and the argument of the argument.
Optionally, the tables of data further includes:
PGM tables, the information for storing the program in the source code;
PGM_ENTRY tables:Access information for storing described program;
CALL_STMT tables:Information for storing the CALL sentences in described program;
Wherein, the PGM tables include unique number, the title of described program and the described program distributed for described program Store path;
The PGM_ENTRY tables include:The entrance institute of the unique number, described program distributed for the entrance of described program The title and described program of the entrance of the unique number of the program of category, the serial number of the entrance of described program, described program Location information of the entrance in the source code;
The CALL_STMT tables include:Belonging to the unique number of the distribution of the CALL sentences, the CALL sentences Program location information in the source code of unique number, the serial number, the CALL sentences of the CALL sentences, The title for the program called by the CALL sentences, the title of the entrance for the program called by CALL sentences and dynamic call Mark.
Optionally, the tables of data further includes:
DYN_CALL_MAP tables and DYN_CALLED_PGM tables;
The DYN_CALL_MAP tables are used to store the relationship between CALL sentences variable name and possible program name, Described in variable name deposit in the target fields of the CALL_STMT tables;The possible program name is deposited in described The called_pgm fields of DYN_CALLED_PGM tables;
The DYN_CALLED_PGM tables store the change of the possible program name for storing in dynamic call sentence Measure possible value.
Optionally, whether the length of the length for comparing parameter and argument is identical includes:
The length of the parameter of described program is searched from the tables of data, and passes through the corresponding pass between the tables of data The call sentences for calling the parameter, length and the shape found of the argument in the call sentences are searched by system Whether the length of ginseng is identical;
And/or the length from the argument in the call sentences for searching described program in the tables of data, and pass through the number According to the correspondence between table, the parameter that the call sentences call is searched, compares the parameter that the call sentences found call Length it is whether identical as the length of the argument found.
A kind of parameter consistency verification device, including:
Acquisition module, for from the program of source code, obtaining the length information of parameter and argument;
Whether the length of comparison module, length and argument for comparing parameter is identical, and generates comparison result;
Output module, if indicating the length of the length of the parameter and the argument not phase for the comparison result Together, then the location information of the parameter and the argument in the source code is exported.
Optionally, the acquisition module is specifically used for:
The length information of the parameter and the argument is stored in preset tables of data, the tables of data includes:E_ PARM_LIST tables and C_PARM_LIST tables;
The E_PARM_LIST tables are used to store the length information of the parameter of the entrance of described program;
C_PARM_LIST tables are used to store the argument length information in the CALL sentences in described program.
Optionally, the E_PARM_LIST tables are additionally operable to:
Storage be the entrance of the unique number of parameter distribution, described program belonging to the parameter unique number, The title of the serial number of the parameter and the parameter.
Optionally, the C_PARM_LIST tables are additionally operable to:
Store the unique of the CALL sentences in the described program belonging to the unique number for argument distribution, the argument The title of number, the serial number and the argument of the argument.
Optionally, the tables of data further includes:
PGM tables, the information for storing the program in the source code;
PGM_ENTRY tables:Access information for storing described program;
CALL_STMT tables:Information for storing the CALL sentences in described program;
Wherein, the PGM tables include unique number, the title of described program and the described program distributed for described program Store path;
The PGM_ENTRY tables include:The entrance institute of the unique number, described program distributed for the entrance of described program The title and described program of the entrance of the unique number of the program of category, the serial number of the entrance of described program, described program Location information of the entrance in the source code;
The CALL_STMT tables include:Belonging to the unique number of the distribution of the CALL sentences, the CALL sentences Program location information in the source code of unique number, the serial number, the CALL sentences of the CALL sentences, The title for the program called by the CALL sentences, the title of the entrance for the program called by CALL sentences and dynamic call Mark.
Optionally, the tables of data further includes:
DYN_CALL_MAP tables and DYN_CALLED_PGM tables;
The DYN_CALL_MAP tables are used to store the relationship between CALL sentences variable name and possible program name, Described in variable name deposit in the target fields of the CALL_STMT tables;The possible program name is deposited in described The called_pgm fields of DYN_CALLED_PGM tables;
The DYN_CALLED_PGM tables store the change of the possible program name for storing in dynamic call sentence Measure possible value.
Optionally, the comparison module is specifically used for:
The length of the parameter of described program is searched from the tables of data, and passes through the corresponding pass between the tables of data The call sentences for calling the parameter, length and the shape found of the argument in the call sentences are searched by system Whether the length of ginseng is identical;
And/or the length from the argument in the call sentences for searching described program in the tables of data, and pass through the number According to the correspondence between table, the parameter that the call sentences call is searched, compares the parameter that the call sentences found call Length it is whether identical as the length of the argument found.
Parameter consistency verification method and device described herein obtain the information of parameter and argument from source code, And obtain parameter length and whether argument length is identical as a result, in the case that different, parameter and argument are exported in source generation Code in location information, can programming by prompting personnel, programming personnel can correct in time, to avoid in compiling or operational process There is the problem of memory accessing outside.Compared with the mode manually investigated, there is higher accuracy.
Description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with Obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of flow chart of parameter consistency verification method disclosed in the embodiment of the present application;
Fig. 2 is the schematic diagram of the disclosed tables of data established of the embodiment of the present application;
Fig. 3 is a kind of structural schematic diagram of parameter consistency verification device disclosed in the embodiment of the present application.
Specific implementation mode
Parameter consistency verification method disclosed in the embodiment of the present application can carry out before the operation of the source code of program, with Avoid the problem that in the process of running because the memory headroom of parameter and argument occupy it is inconsistent caused by memory accessing outside.
In the following embodiment of the application, illustrated by taking the program that Common business Oriented Language is write as an example.It should be noted that Parameter consistency verification method described herein, however it is not limited to the program write with Common business Oriented Language.
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
Fig. 1 is a kind of parameter consistency verification method disclosed in the embodiment of the present application, is included the following steps:
S101:In the source code for the program write from Common business Oriented Language, the length information of parameter and argument is obtained.
Optionally, it other than length information, can also obtain and argument and the relevant other information of parameter, such as CALL Sentence, program information etc..
Specifically, as shown in Fig. 2, establishing following data table:
1, PGM tables:For storing program (the hereinafter referred to as COBOL journeys in the source code that Common business Oriented Language to be analyzed is write Sequence) information.In Fig. 2, the PK in PGM tables indicates major key, and id is the unique number distributed for cobol program, and pgm_name is The title of cobol program, data_set are the store path (optional) of cobol program, and the purpose for showing store path is, such as There is the identical program of title in fruit, then can be distinguished by store path.
2, PGM_ENTRY tables:Access information for storing cobol program includes being distributed for the entrance of cobol program (it should be noted that in Fig. 2, the id in different tables only indicates the number of the meaning with the table to unique number id, and non-specific Number citing, in practice, in order to distinguish different meanings, different types of numerical value and/or word can be used in different tables Mother, as number), the unique number pgm_id of cobol program belonging to the entrance of cobol program, wherein pgm_id is established Correspondence (FK1 in table 2 indicates to quote other tables of data), the COBOL of PGM_ENTRY tables and the cobol program in PGM tables The serial number entry_seq of the entrance of program (is here different entrances it is possible that having the entrance of multiple cobol programs Allocation order is numbered), the entrance of the title entry_name of the entrance of cobol program and cobol program is in source code Which row location information row_num (specifically indicates).
3, E_PARM_LIST tables:The information of the parameter of entrance for storing cobol program, wherein the packet of parameter The unique number entry_id of the entrance of the cobol program belonging to the unique number id distributed for parameter, parameter is included (with PGM_ ENTRY tables establish correspondence), the serial number parm_seq of parameter (be here different shapes it is possible that having multiple parameters Join allocation order number), the length parm_length of the title parm_name of parameter and parameter.
4, CALL_STMT tables:Information for storing the CALL sentences in cobol program, the information of CALL sentences include: The cobol program belonging to unique number id, CALL sentence for the distribution of CALL sentences unique number pgm_id (establish with The correspondence of PGM tables), the serial number call_seq of CALL sentences (be here difference it is possible that having multiple CALL sentences CALL sentence allocation orders number), location information row_num (specifically indicate which row) of the CALL sentences in source code, By the title target for the program that CALL sentences call, the title target_ of the entrance for the program called by CALL sentences Entry_name and dynamic call identify dyn_call_flag, this is identified as the first numerical value, indicate there are dynamic call, should It is identified as second value, indicates that dynamic call is not present.
5, C_PARM_LIST tables:For storing the argument information in CALL sentences, including:For unique volume of argument distribution The unique number called_id (establishing the correspondence with CALL_STMT tables) of CALL sentences belonging to number id, argument, argument Serial number parm_seq, argument title parm_name and argument length parm_length.
6, DYN_CALL_MAP tables:When CALL sentences are dynamic call sentences, the target fields of CALL_STMT tables are protected What is deposited is variable name, rather than program name, and the possible value of the variable deposits in the called_pgm of DYN_CALLED_PGM tables In field.This table is used to safeguard that the record mapping relations between CALL_STMT tables and DYN_CALLED_PGM tables, field to include dynamic State calls the variable of number call_stmt_id (the establishing the correspondence with CALL_STMT tables) and dynamic call of CALL sentences The mark dyn_pgm_id (establishing the correspondence with DYN_CALL_MAP tables) for the program name that may be stored.
7, DYN_CALLED_PGM tables:The program information that variable for storing dynamic call may store, including:It is Number id, called main program host_pgm, the name variable var_ for the program name distribution that the variable that state is called may store Name, dynamic call location information row_num and called program name called_pgm of the variable in source code. In the present embodiment, multiple dynamic call CALL sentences are allowed to be associated with the same DYN_CALLED_PGM tables record, at this moment row_ Num only preserves the position of one of CALL sentences.
According to source code, above table is filled in, wherein 6 and 7 in source code in the case of used dynamic call mode It needs to fill in, otherwise, without filling in.When CALL sentences are dynamic call sentences, the target fields of CALL_STMT tables preserve Be variable name, rather than program name, the program name which may store deposit in DYN_CALLED_PGM tables, pass through DYN_ CALL_MAP tables are mapped to CALL sentences.
Specifically, the heads PROCEDURE DIVISION and ENTRY sentences can be defined from the argument in source code, determine The length (01 layer or 77 layers of variable-length) of parameter.Optionally, REDEFINE sentences has been used to redefine parameter in source code Length in the case of, by the original definition for the parameter determined according to the heads PROCEDURE DIVISION and ENTRY sentences The maximum in the length for the parameter that length and REDEFINE sentences redefine, the length of the parameter as acquisition are filled up to above-mentioned In E_PARM_LIST tables.It should be noted that Redefine sentences are the parts that above-mentioned parameter defines or argument defines, it can The centre of definition can be appeared in, it is also possible to not have.
Length (01 layer or 77 of argument can be determined from program name and argument used in the CALL sentences in source code Layer variable-length).It optionally, will be according in the case of having used REDEFINE sentences to redefine the length of argument in source code It is redefined according to the original definition length and REDEFINE sentences for the argument that program name and argument are determined used in CALL sentences The length of the maximum in the length of argument, the argument as acquisition is filled up in above-mentioned C_PARM_LIST tables.
The case where for dynamic call, then stores the variable name of program name in CALL sentences, is manually matched by contingency table Set the probable value of the variable name.
S102:Whether the length of the length and argument that compare parameter is identical, and generates comparison result.
Specifically, " upward analytic approach " and/or " downward analytic approach " can be used, comparison result is obtained.
" the upward analytic approach " refers to the length of the parameter of program to be verified being searched from table shown in Fig. 2, and pass through Correspondence between each tables of data shown in Fig. 2 searches the call sentences and these call languages for having invoked the parameter The length of argument in sentence.Whether the length for comparing argument is identical as the length of parameter.
Scene for examined program as callee carries out following operation:
1, by all records identical with the id of examined program of pgm_id in PGM_ENTRY, as candidate program entrance.
2, by CALL_STMT tables, the program name pointed by target it is identical as the pgm_name of examined program and Target_entry_name all records identical with the entry_name of candidate program entrance in PGM_ENTRY, as candidate CALL sentences.
And situation there are two types of " program names pointed by target ":One is be exactly target fields when non-dynamic calling Value;When another kind is dynamic call, the called_ of the record of DYN_CALLED_PGM tables need to be found by DYN_CALL_MAP tables The value of pgm fields.There may be multiple programs to correspond to the same CALL sentences when dynamic call, as long as there are one meeting, then correspond to CALL_STMT tables be recorded as candidate CALL sentences.
3, it checks:Judge that the corresponding E_PARM_LIST records of candidate program entrance are corresponding with candidate CALL sentences C_PARM_LIST record parameter length it is whether consistent.
" the downward analytic approach " refers to, from the length of the argument in the call sentences for searching described program in the tables of data Degree compares the length for the parameter called by the call sentences that the correspondence between each tables of data described in Fig. 2 is found Whether the length for the argument spent and found is identical, i.e.,:
Scene for examined program as caller carries out following operation:
The records identical with the id of examined program of pgm_id in each CALL_STMT are led to as candidate CALL sentences It crosses candidate's CALL sentences and finds all program names pointed by its target, and then find the id of these program in PGM, then Find that above-mentioned id is consistent and entry_name is identical as the candidate target_entry_name of CALL sentences in PGM_ENTRY tables Record as candidate program entrance.It is checked for these candidate's CALL sentences and corresponding candidate program entrance.
Wherein, " program name pointed by target " and " content checked " is as defined above.
It, can will be to be verified if all programs in code are carried out with the extension consistency verification of parameter and argument In the parameter of program and the information solicitation of argument to table shown in Fig. 2, according to the information in table, it can select " upward analytic approach " Or one kind in " downward analytic approach ".
If the extension consistency for carrying out parameter and argument to the subprogram in code is verified, to use and " divide upwards Analysis method " and " downward analytic approach ".
S103:If the comparison indicate that the length of parameter and the length of argument differ, then exports parameter and argument exists Location information in source code.If the comparison indicate that the length of parameter is identical as the length of argument, parameter can be exported The length consistent information of length and argument, or be not processed.
Specifically, RESULT tables shown in Fig. 2 can also be generated, for storing comparison result, wherein pgm_id is indicated The number (establishing the correspondence with PGM tables) of examined program, SEQ is expressed as the serial number of comparison result distribution, Row_num indicate check specific code sentence (may be simply referred to as checkpoint, it may be possible to the row_num in PGM_ENTRY tables, May be the row_num in CALL_STMT tables, when this is according to result record is generated, what is handled is to be examined entering for program The degree of lip-rounding is joined or the argument of Call sentences) location information in examined program, msg indicates comparison result (comparison result Further include the program name belonging to corresponding parameter or argument and position in a program in different situations to be identical or different It sets).
Process shown in FIG. 1, obtains the information of parameter and argument from source code, and obtains parameter length and argument length It is whether identical as a result, in the case that different, the location information of output parameter and argument in source code can prompt to compile Cheng personnel, programming personnel can correct in time, the problem of memory accessing outside occur to avoid in compiling or operational process.With The mode manually investigated is compared, and has higher accuracy.
Fig. 3 is a kind of parameter consistency verification device disclosed in the embodiment of the present application, including:Acquisition module, comparison module And output module.
Wherein, acquisition module is used for from the program of source code, obtains the length information of parameter and argument.Comparison module is used It is whether identical in the length of the length and argument that compare parameter, and generate comparison result.If output module is used for the comparison As a result it indicates that the length of the length and the argument of the parameter differs, then exports the parameter and the argument in the source Location information in code.
The specific implementation of the function of above-mentioned modules, may refer to embodiment of the method, and which is not described herein again.
Described device can replace artificial investigation, the position letter of the inconsistent parameter and argument of length in output program Breath, to efficiently avoid the problem that internal storage access crosses boundary.
If the function described in the embodiment of the present application method is realized in the form of SFU software functional unit and as independent production Product are sold or in use, can be stored in a computing device read/write memory medium.Based on this understanding, the application is real Applying the part of a part that contributes to existing technology or the technical solution can be expressed in the form of software products, The software product is stored in a storage medium, including some instructions are used so that a computing device (can be personal meter Calculation machine, server, mobile computing device or network equipment etc.) execute each embodiment the method for the application whole or portion Step by step.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), with Machine accesses various Jie that can store program code such as memory (RAM, Random Access Memory), magnetic disc or CD Matter.
Each embodiment is described by the way of progressive in this specification, the highlights of each of the examples are with it is other The difference of embodiment, just to refer each other for same or similar part between each embodiment.
The foregoing description of the disclosed embodiments enables professional and technical personnel in the field to realize or use the application. Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein General Principle can in other embodiments be realized in the case where not departing from spirit herein or range.Therefore, the application It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest range caused.

Claims (14)

1. a kind of parameter consistency verification method, which is characterized in that including:
From the program of source code, the length information of parameter and argument is obtained;
Whether the length of the length and argument that compare parameter is identical, and generates comparison result;
If the comparison result indicates that the length of the length and the argument of the parameter differs, export the parameter and Location information of the argument in the source code.
2. according to the method described in claim 1, it is characterized in that, the length information of the acquisition parameter and argument includes:
The length information of the parameter and the argument is stored in preset tables of data, the tables of data includes:E_PARM_ LIST tables and C_PARM_LIST tables;
The E_PARM_LIST tables are used to store the length information of the parameter of the entrance of described program;
C_PARM_LIST tables are used to store the argument length information in the CALL sentences in described program.
3. according to the method described in claim 2, it is characterized in that, the E_PARM_LIST tables are additionally operable to:
Storage is the unique number, described of the entrance of the unique number of parameter distribution, described program belonging to the parameter The title of the serial number of parameter and the parameter.
4. according to the method described in claim 2, it is characterized in that, the C_PARM_LIST tables are additionally operable to:
Store unique volume of the CALL sentences in the described program belonging to the unique number for argument distribution, the argument Number, the title of the serial number and the argument of the argument.
5. according to the method described in claim 2, it is characterized in that, the tables of data further includes:
PGM tables, the information for storing the program in the source code;
PGM_ENTRY tables:Access information for storing described program;
CALL_STMT tables:Information for storing the CALL sentences in described program;
Wherein, the PGM tables include depositing for unique number, the title of described program and the described program distributed for described program Store up path;
The PGM_ENTRY tables include:Belonging to the entrance of the unique number, described program distributed for the entrance of described program The title of the entrance of the unique number of program, the serial number of the entrance of described program, described program and entering for described program Location information of the mouth in the source code;
The CALL_STMT tables include:For the journey belonging to the unique number of the distribution of the CALL sentences, the CALL sentences Location information in the source code of the unique number of sequence, the serial number, the CALL sentences of the CALL sentences, by institute State the title of the program of CALL sentences calling, the title of the entrance for the program called by CALL sentences and dynamic call mark.
6. according to the method described in claim 5, it is characterized in that, the tables of data further includes:
DYN_CALL_MAP tables and DYN_CALLED_PGM tables;
The DYN_CALL_MAP tables are used to store the relationship between CALL sentences variable name and possible program name, wherein institute State the target fields that variable name deposits in the CALL_STMT tables;The possible program name deposits in the DYN_ The called_pgm fields of CALLED_PGM tables;
For the DYN_CALLED_PGM tables for storing in dynamic call sentence, the variable for storing the possible program name can The value of energy.
7. according to claim 2-6 any one of them methods, which is characterized in that the length of the relatively length and argument of parameter Whether degree is identical to include:
The length of the parameter of described program is searched from the tables of data, and by the correspondence between the tables of data, is looked into Look for the call sentences for calling the parameter, the length of the length of the argument in the call sentences and the parameter found Whether degree is identical;
And/or the length from the argument in the call sentences for searching described program in the tables of data, and pass through the tables of data Between correspondence, search the parameter that the call sentences call, compare the length for the parameter that the call sentences found call Whether the length for the argument spent and found is identical.
8. a kind of parameter consistency verifies device, which is characterized in that including:
Acquisition module, for from the program of source code, obtaining the length information of parameter and argument;
Whether the length of comparison module, length and argument for comparing parameter is identical, and generates comparison result;
Output module, if indicating that the length of the length and the argument of the parameter differs for the comparison result, Export the location information of the parameter and the argument in the source code.
9. device according to claim 8, which is characterized in that the acquisition module is specifically used for:
The length information of the parameter and the argument is stored in preset tables of data, the tables of data includes:E_PARM_ LIST tables and C_PARM_LIST tables;
The E_PARM_LIST tables are used to store the length information of the parameter of the entrance of described program;
C_PARM_LIST tables are used to store the argument length information in the CALL sentences in described program.
10. device according to claim 9, which is characterized in that the E_PARM_LIST tables are additionally operable to:
Storage is the unique number, described of the entrance of the unique number of parameter distribution, described program belonging to the parameter The title of the serial number of parameter and the parameter.
11. device according to claim 9, which is characterized in that the C_PARM_LIST tables are additionally operable to:
Store unique volume of the CALL sentences in the described program belonging to the unique number for argument distribution, the argument Number, the title of the serial number and the argument of the argument.
12. device according to claim 9, which is characterized in that the tables of data further includes:
PGM tables, the information for storing the program in the source code;
PGM_ENTRY tables:Access information for storing described program;
CALL_STMT tables:Information for storing the CALL sentences in described program;
Wherein, the PGM tables include depositing for unique number, the title of described program and the described program distributed for described program Store up path;
The PGM_ENTRY tables include:Belonging to the entrance of the unique number, described program distributed for the entrance of described program The title of the entrance of the unique number of program, the serial number of the entrance of described program, described program and entering for described program Location information of the mouth in the source code;
The CALL_STMT tables include:For the journey belonging to the unique number of the distribution of the CALL sentences, the CALL sentences Location information in the source code of the unique number of sequence, the serial number, the CALL sentences of the CALL sentences, by institute State the title of the program of CALL sentences calling, the title of the entrance for the program called by CALL sentences and dynamic call mark.
13. device according to claim 12, which is characterized in that the tables of data further includes:
DYN_CALL_MAP tables and DYN_CALLED_PGM tables;
The DYN_CALL_MAP tables are used to store the relationship between CALL sentences variable name and possible program name, wherein institute State the target fields that variable name deposits in the CALL_STMT tables;The possible program name deposits in the DYN_ The called_pgm fields of CALLED_PGM tables;
For the DYN_CALLED_PGM tables for storing in dynamic call sentence, the variable for storing the possible program name can The value of energy.
14. according to claim 9-13 any one of them devices, which is characterized in that the comparison module is specifically used for:
The length of the parameter of described program is searched from the tables of data, and by the correspondence between the tables of data, is looked into Look for the call sentences for calling the parameter, the length of the length of the argument in the call sentences and the parameter found Whether degree is identical;
And/or the length from the argument in the call sentences for searching described program in the tables of data, and pass through the tables of data Between correspondence, search the parameter that the call sentences call, compare the length for the parameter that the call sentences found call Whether the length for the argument spent and found is identical.
CN201810239209.1A 2018-03-22 2018-03-22 Parameter consistency verification method and device Active CN108446122B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810239209.1A CN108446122B (en) 2018-03-22 2018-03-22 Parameter consistency verification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810239209.1A CN108446122B (en) 2018-03-22 2018-03-22 Parameter consistency verification method and device

Publications (2)

Publication Number Publication Date
CN108446122A true CN108446122A (en) 2018-08-24
CN108446122B CN108446122B (en) 2021-10-29

Family

ID=63196630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810239209.1A Active CN108446122B (en) 2018-03-22 2018-03-22 Parameter consistency verification method and device

Country Status (1)

Country Link
CN (1) CN108446122B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5802372A (en) * 1992-09-13 1998-09-01 Nec Corporation Language processing system
US6149318A (en) * 1997-04-15 2000-11-21 Samuel C. Kendall Link-time and run-time error detection, and program instrumentation
US6481007B1 (en) * 1999-06-03 2002-11-12 Oracle Corporation Optimizing parameter passing
CN1979427A (en) * 2005-12-08 2007-06-13 中兴通讯股份有限公司 Method for automatically memory leakage and memory out-of-range in inlaid system
CN101145129A (en) * 2007-07-18 2008-03-19 中兴通讯股份有限公司 Embedded system memory write-overflow detection method and system
CN103309804A (en) * 2013-04-08 2013-09-18 中国电子科技集团公司第十研究所 Automatic code rule checking platform
CN103778061A (en) * 2014-01-17 2014-05-07 南京航空航天大学 Automatic detection and correction method for array out-of-bound errors
CN106919454A (en) * 2017-01-25 2017-07-04 福建三元达网络技术有限公司 Memory pool positioning problems method and its system based on LTE protocol stack
US20170329585A1 (en) * 2016-05-12 2017-11-16 Fujitsu Limited Apparatus and method to compile a variadic template function

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5802372A (en) * 1992-09-13 1998-09-01 Nec Corporation Language processing system
US6149318A (en) * 1997-04-15 2000-11-21 Samuel C. Kendall Link-time and run-time error detection, and program instrumentation
US6481007B1 (en) * 1999-06-03 2002-11-12 Oracle Corporation Optimizing parameter passing
CN1979427A (en) * 2005-12-08 2007-06-13 中兴通讯股份有限公司 Method for automatically memory leakage and memory out-of-range in inlaid system
CN101145129A (en) * 2007-07-18 2008-03-19 中兴通讯股份有限公司 Embedded system memory write-overflow detection method and system
CN103309804A (en) * 2013-04-08 2013-09-18 中国电子科技集团公司第十研究所 Automatic code rule checking platform
CN103778061A (en) * 2014-01-17 2014-05-07 南京航空航天大学 Automatic detection and correction method for array out-of-bound errors
US20170329585A1 (en) * 2016-05-12 2017-11-16 Fujitsu Limited Apparatus and method to compile a variadic template function
CN106919454A (en) * 2017-01-25 2017-07-04 福建三元达网络技术有限公司 Memory pool positioning problems method and its system based on LTE protocol stack

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ASLANIA: "C++中将数组作为形参时防止访问越界的几种方法", 《CSDN:HTTPS://BLOG.CSDN.NET/THECOLDONE/ARTICLE/DETAILS/50759044》 *

Also Published As

Publication number Publication date
CN108446122B (en) 2021-10-29

Similar Documents

Publication Publication Date Title
CN107957957A (en) The acquisition methods and device of test case
CN107665171A (en) Automatic regression test method and device
CN107688591B (en) A kind of actuarial treating method and apparatus
CN103927607A (en) Data processing method and device
CN107391384A (en) A kind of SQL statement detection method and system
CN109542789A (en) A kind of code coverage statistical method and device
CN105912460A (en) Software test method and system based on QTP
CN112181804A (en) Parameter checking method, equipment and storage medium
CN111414410B (en) Data processing method, device, equipment and storage medium
CN105630475A (en) Data label organization system and organization method
CN108255702A (en) A kind of test case creation method, apparatus, equipment and storage medium
CN106354536A (en) Method and device of loading ELF file of Linux system in Windows system
CN108008936A (en) A kind of data processing method, device and electronic equipment
CN109690571A (en) Group echo system and method based on study
CN108776678A (en) Index creation method and device based on mobile terminal NoSQL databases
CN114429103A (en) Chip verification method and device, electronic equipment and storage medium
CN103326930B (en) Open platform interface automatic detecting method and system
CN106227769A (en) Date storage method and device
CN109033365A (en) A kind of data processing method and relevant device
CN110362569A (en) The method of calibration and device of tables of data, electronic equipment, storage medium
CN108984421A (en) A kind of information cuing method and device
CN107766253A (en) A kind of method of the automatic maintenance test script based on model change
CN106776348A (en) Testing case management and device
CN108446122A (en) A kind of parameter consistency verification method and device
CN110516009A (en) The method for building up of index system establishes device, storage medium and processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant