WO2022254487A1 - 情報処理プログラム、情報処理方法および情報処理装置 - Google Patents

情報処理プログラム、情報処理方法および情報処理装置 Download PDF

Info

Publication number
WO2022254487A1
WO2022254487A1 PCT/JP2021/020615 JP2021020615W WO2022254487A1 WO 2022254487 A1 WO2022254487 A1 WO 2022254487A1 JP 2021020615 W JP2021020615 W JP 2021020615W WO 2022254487 A1 WO2022254487 A1 WO 2022254487A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
incompatible
instruction
incompatibility
node
Prior art date
Application number
PCT/JP2021/020615
Other languages
English (en)
French (fr)
Inventor
雅樹 西垣
Original Assignee
富士通株式会社
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 富士通株式会社 filed Critical 富士通株式会社
Priority to EP21943998.1A priority Critical patent/EP4350505A1/en
Priority to PCT/JP2021/020615 priority patent/WO2022254487A1/ja
Priority to JP2023525135A priority patent/JPWO2022254487A1/ja
Publication of WO2022254487A1 publication Critical patent/WO2022254487A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Definitions

  • the present invention relates to an information processing program, an information processing method, and an information processing apparatus.
  • Information processing systems may use software provided by software vendors.
  • software include middleware such as DBMS (Database Management System).
  • the source code of the program executed by the information processing system may be created depending on the specifications of the provided software.
  • a program may send a request to provided software to invoke a software function, such as sending a SQL statement to a DBMS to invoke a database manipulation function.
  • the information processing system may change the software used. For example, when a software vendor upgrades the software, the information processing system may update the software used to the new version. Also, for example, the information processing system may switch to software of the same type provided by another software vendor.
  • a computer system has been proposed that detects incompatibility of the same type of dynamic link library installed on different computers by transferring the dynamic link library and the fault message between computers.
  • an information disclosure activation system has been proposed that obtains disclosure information from a user, calculates a reading value from the disclosure information, and gives consideration to the user who has provided the disclosure information in accordance with the calculated reading value.
  • a system migration support device has also been proposed that determines the correspondence relationship between the APIs of the old system and the APIs of the new system based on the similarity of API (Application Programming Interface) names and the similarity of value ranges.
  • API Application Programming Interface
  • One method of assisting source code modification is to store incompatibility information that defines characteristics of descriptions that may cause defects based on incompatibility, and to modify the source code based on the incompatibility information.
  • a method of searching for an incompatible part in the code is conceivable.
  • the features of the incompatible part specified in the incompatible information are not limited to simple features such as single keywords, but must be complex features that indicate conditions for combinations of two or more language elements. There is Therefore, even if two pieces of incompatible information contain descriptions that are formally different, it is possible that the incompatible locations to be searched for are substantially the same.
  • an object of the present invention is to determine the identity of incompatible information.
  • an information processing program causes a computer to execute the following processes.
  • Information for searching source code that uses the first software for descriptions that are incompatible with the second software, including keywords possessed by two or more language elements and positional relationships between the two or more language elements
  • extracting two or more keywords from the first incompatibility information generating first frequency information based on the frequency of appearance of the same keyword, and generating the first frequency information indicating the order of appearance of the two or more keywords estimated from the condition of the positional relationship; 1 order information is generated.
  • a first similarity between the first frequency information and second frequency information corresponding to the second incompatible information, and a second order corresponding to the first order information and the second incompatible information The identity of the first incompatible information and the second incompatible information is determined based on the second similarity between the information.
  • a computer-executed information processing method is provided. Also, in one aspect, an information processing apparatus having a storage unit and a processing unit is provided.
  • the identity of incompatible information can be determined.
  • FIG. 1 is a diagram for explaining an information processing device according to a first embodiment; FIG. It is a figure which shows the example of the information processing system of 2nd Embodiment.
  • 2 is a block diagram showing an example of hardware of an information processing device;
  • FIG. 10 illustrates an example flow of non-compatible absorption of database products;
  • 2 is a block diagram showing an example of functions of an information processing device;
  • FIG. FIG. 4 is a diagram showing a first example of a syntax tree; It is a figure which shows the example of attribute information.
  • FIG. 10 is a diagram showing an example of a syntax table;
  • FIG. 10 is a diagram showing an example of an instruction table;
  • FIG. FIG. 4 is a diagram showing a first example of incompatibility information;
  • FIG. 10 is a diagram showing a second example of a syntax tree;
  • FIG. 10 is a diagram showing a second example of incompatibility information;
  • FIG. 12 is a diagram (continued) showing the second example of the incompatibility information; It is a figure which shows the example of the source code of SQL procedure.
  • FIG. 11 is a diagram showing a third example of a syntax tree;
  • FIG. 11 is a diagram (continued) showing a third example of a syntax tree;
  • FIG. 13 is a diagram showing a third example of incompatibility information;
  • FIG. 10 is a diagram showing an example of an editor screen;
  • FIG. 10 is a diagram showing a first example of an operating procedure on an editor screen;
  • FIG. 11 is a diagram showing a second example of an operation procedure of the editor screen;
  • FIG. 10 is a diagram illustrating an example of testing incompatibility information;
  • FIG. 11 is a diagram showing a fourth example of incompatibility information;
  • FIG. 10 is a diagram showing an example of a BOW vector table;
  • FIG. 10 is a diagram showing a first generation example of a keyword list;
  • FIG. 11 is a diagram showing a second generation example of a keyword list;
  • FIG. 10 is a diagram showing an example of extraction of incompatible sub-information; It is a figure which shows the example of division
  • 10 is a flow chart showing an example of a procedure for generating incompatibility information
  • 10 is a flowchart (continued 1) showing an example of a procedure for generating incompatibility information
  • FIG. 11 is a flowchart (continuation 2) showing an example of a procedure for generating incompatibility information
  • FIG. 10 is a flowchart (continued 3) showing an example of a procedure for generating incompatibility information
  • 10 is a flow chart showing an example procedure of an incompatibility information test
  • FIG. 10 is a flowchart showing an example of a procedure for determining identity of incompatible information
  • FIG. 10 is a flowchart (continued 1) showing an example of a procedure for determining the identity of incompatible information
  • FIG. 11 is a flowchart (continued 2) showing an example of a procedure for determining identity of incompatible information
  • FIG. 1 is a diagram for explaining an information processing apparatus according to the first embodiment.
  • the information processing apparatus 10 of the first embodiment analyzes incompatibility information for searching for descriptions incompatible with other software from source code dependent on a certain software, and analyzes the incompatibility information and other software. Determine substantial identity with incompatible information. Through identity determination, the information processing apparatus 10 supports accumulation and management of a plurality of pieces of incompatible information, and also supports modification of source code when changing software to be used.
  • the information processing device 10 may be a client device or a server device.
  • the information processing device 10 may also be called a computer, an identity determination device, an incompatible information management device, a development support device, or the like.
  • the information processing device 10 has a storage unit 11 and a processing unit 12 .
  • the storage unit 11 may be a volatile semiconductor memory such as a RAM (Random Access Memory), or may be a non-volatile storage such as a HDD (Hard Disk Drive) or flash memory.
  • the processing unit 12 is, for example, a processor such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), or a DSP (Digital Signal Processor). However, the processing unit 12 may include a specific application electronic circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array).
  • the processor executes programs stored in a memory such as a RAM (which may be the storage unit 11), for example.
  • a collection of processors may be called a multiprocessor or simply a "processor.”
  • the storage unit 11 stores incompatibility information 13.
  • the incompatible information 13 is, for example, information that is newly created and is about to be stored in the knowledge database.
  • the incompatible information 13 may be received from another information processing device such as a terminal device used by the creator of the incompatible information 13 .
  • the incompatibility information 13 is knowledge expressed in a fixed format for searching for descriptions (incompatible parts) that are incompatible with the second software from the source code of the program that uses the first software.
  • the first software corresponds to the migration source software
  • the second software corresponds to the migration destination software.
  • These two pieces of software may be software products provided by software vendors or middleware such as DBMS and Web servers. Also, the two pieces of software may be the same type of software provided by different software vendors, or different versions of software provided by the same software vendor.
  • the source code may define request messages that indicate requests to the software.
  • the request message may be a SQL statement, and the source code may be written in SQL or the SQL procedural language.
  • the languages for describing the requirements of the two software may be similar but not identical.
  • two pieces of software may each support a general-purpose query language such as SQL, while providing their own extensions to the query language.
  • the incompatibility information 13 indicates the features of the incompatibility part included in the source code.
  • the incompatibility information 13 indicates conditions for combinations of two or more language elements included in the source code.
  • Linguistic elements are syntactic unit elements such as sentences, clauses, phrases, and words.
  • a language element may be called a syntactic element.
  • the presence of two or more language elements that satisfy the condition indicated by the incompatibility information 13 corresponds to inclusion of an incompatible part in the source code.
  • the conditions defined by the incompatibility information 13 include conditions for two or more keywords included in two or more language elements and the positional relationship between the two or more language elements.
  • the positional relationship may be a positional relationship in a syntax tree generated by parsing the source code.
  • the incompatibility information 13 may include an instruction string indicating a procedure for searching for two or more language elements that satisfy a condition.
  • the incompatibility information 13 is a search procedure for detecting a first language element with a certain keyword and detecting a second language element with another keyword within a specific search range from the first language element. It may contain an instruction string indicating
  • the processing unit 12 generates frequency information 15 and order information 17 from the incompatibility information 13 .
  • the processing unit 12 extracts two or more keywords from the incompatibility information 13 and generates frequency information 15 based on the frequency of appearance of each of the two or more keywords.
  • the appearance frequency may be the number of appearances of each keyword, or may be the appearance probability, which is the ratio of the number of appearances of each keyword to the size of the incompatible information 13 .
  • the processing unit 12 may extract two or more keyword-attribute pairs for the same language element from the incompatibility information 13 and generate the frequency information 15 so as to indicate the number of appearances of each of the two or more pairs. good. Attributes include, for example, grammatical roles such as imperatives and object types. Extracting attributes in conjunction with keywords takes into account the context in which the keywords are used and distinguishes between multiple roles of the same keyword.
  • the appearance frequency may be the number of appearances of each pair, or the appearance probability, which is the ratio of the number of appearances of each pair to the size of the incompatible information 13 .
  • the frequency information 15 may be a vector listing two or more appearance frequencies, and may be called a BOW (Bug of Words) vector.
  • the processing unit 12 estimates the order of appearance in the source code when the above two or more keywords appear in the source code from the condition of the positional relationship indicated by the incompatibility information 13, and calculates the estimated order of appearance.
  • the order information 17 shown is generated.
  • the order information 17 may be a keyword list in which two or more keywords are arranged in order of appearance.
  • the processing unit 12 extracts from the incompatibility information 13 a horizontal search range when searching for the second language element from the first language element, and extracts two language elements corresponding to the two language elements from the extracted search range. Keyword context may be inferred.
  • the processing unit 12 acquires the frequency information 16 and the order information 18 corresponding to the incompatibility information 14.
  • the incompatible information 14 may be existing incompatible information created before the incompatible information 13, or may be incompatible information already registered in the knowledge database.
  • Frequency information 16 may be generated from incompatible information 14 in a manner similar to frequency information 15
  • order information 18 may be generated from incompatible information 14 in a manner similar to order information 17 .
  • the incompatibility information 14 may be stored in the storage unit 11, and the frequency information 16 and order information 18 may be stored in the storage unit 11. Further, the frequency information 16 and the order information 18 may be generated before verification of the incompatible information 13 and stored in the knowledge database, or may be generated by the processing unit 12 when verifying the incompatible information 13. 14 may be generated.
  • the processing unit 12 compares the frequency information 15 and the frequency information 16 and calculates a first degree of similarity between the frequency information 15 and the frequency information 16 .
  • the first similarity measure may be a cosine similarity measure.
  • the processing unit 12 calculates the product of two appearance frequencies for each of the same keyword or each pair of the same keyword and attribute, sums them, and divides them by the norms of the frequency information 15 and 16, respectively.
  • the first degree of similarity may be Euclidean distance. A larger index value of the first degree of similarity may mean a higher degree of similarity, or vice versa.
  • the cosine similarity has a maximum value of 1, and the closer to 1, the higher the similarity.
  • the processing unit 12 compares the order information 17 and the order information 18 and calculates a second degree of similarity between the order information 17 and the order information 18 .
  • the second similarity measure may be an edit distance, such as the Levenshtein distance.
  • the processing unit 12 calculates the minimum number of keyword replacement operations for changing the keyword string indicated by the order information 17 to the keyword string indicated by the order information 18 .
  • the second degree of similarity may be the Euclidean distance.
  • the processing unit 12 defines the degree of similarity between two keywords in advance, and calculates the sum or average of the degrees of similarity between keywords at the same position in the keyword list.
  • the second similarity index value may mean that the larger the similarity, the higher the similarity, or vice versa.
  • the processing unit 12 determines the identity of the incompatibility information 13 and 14 based on the first degree of similarity and the second degree of similarity. Not being substantially identical may be called novelty or uniqueness. Since the incompatibility information 13 and 14 define conditions for combinations of two or more language elements, they may define different search methods for searching for the same incompatible location.
  • the incompatibility information 13 defines a search method for searching for a second language element starting from a first language element
  • the incompatibility information 14 defines a search method for searching for a second language element starting from a first language element. Defines the search method for searching for elements.
  • the incompatible information 13 and 14 are substantially the same, and the incompatible information 13 has no novelty with respect to the incompatible information 14 . In this way, the incompatibility information indicating the characteristics of the same incompatible part may contain different descriptions.
  • the processing unit 12 compares a first degree of similarity with a first threshold, and compares a second degree of similarity with a second threshold. If the first degree of similarity is greater than the first threshold and the second degree of similarity is greater than the second threshold, the processing unit 12 determines that the incompatibility information 13 and 14 are substantially the same. . On the other hand, if the first degree of similarity is equal to or less than the first threshold or the second degree of similarity is equal to or less than the second threshold, the processing unit 12 determines that the incompatibility information 13 and 14 are not substantially the same. I judge.
  • the processing unit 12 first compares the first similarity with the first threshold, and if the first similarity is greater than the first threshold, compares the second similarity with the second threshold. good too. Further, the processing unit 12 first generates frequency information 15 from the incompatibility information 13 to calculate the first similarity, and if the first similarity is greater than the first threshold, the order information 17 may be generated.
  • the incompatibility information 13 includes a procedure of detecting the keyword "TABLESPACE”, searching for the keyword “CREATE” belonging to the same clause as the keyword, and searching for the keyword “TABLE” included in the clause following the keyword. stipulate.
  • the incompatibility information 14 detects the keyword “CREATE”, searches for the keyword “TABLE” included in a clause belonging to the same clause as that keyword, and searches for the keyword "TABLESPACE” included in the clause following that clause. Define procedures for searching.
  • both the incompatibility information 13 and 14 contain one keyword each of "CREATE”, “TABLE”, and “TABLESPACE”. Therefore, the frequency information 15 and 16 are the same.
  • the three keywords in the incompatibility information 13 and 14 are searched in different orders, the three keywords estimated from the search range conditions are "CREATE”, “TABLE”, and “TABLESPACE”. Therefore, the order information 17 and 18 are the same. Therefore, the processing unit 12 determines that the incompatibility information 13 and the incompatibility information 14 are substantially the same.
  • the processing unit 12 may output the identity determination result.
  • the processing unit 12 may store the identity determination result in a non-volatile storage, display it on a display device, or transmit it to another information processing device.
  • the processing unit 12 may control registration of the incompatibility information 13 to the knowledge database based on the identity determination result. For example, when the processing unit 12 determines that the incompatible information 13 and 14 are not substantially the same, it allows the incompatible information 13 to be registered in the knowledge database as new incompatible information. On the other hand, when the processing unit 12 determines that the incompatibility information 13 and 14 are substantially the same, the processing unit 12 rejects registration of the incompatibility information 13 .
  • the information processing apparatus 10 obtains from the incompatibility information 13 the frequency information 15 based on the frequency of appearance of two or more keywords, and the order indicating the appearance order of the two or more keywords. information 17; Then, the information processing apparatus 10 determines the identity of the incompatibility information 13 and 14 based on the similarity of the frequency information 15 and 16 and the similarity of the order information 17 and 18 . As a result, the information processing apparatus 10 can detect that the incompatibility information 13 and 14 are substantially the same incompatibility information for detecting the same incompatibility location from the source code even if the descriptions of the incompatibility information 13 and 14 are different. It can be determined whether or not
  • the information processing apparatus 10 can prevent duplicate registration of substantially the same incompatible information in the knowledge database, and can efficiently manage the knowledge database. Further, the information processing apparatus 10 can distinguish between new incompatible information and substantially non-new incompatible information, and can appropriately evaluate the value of the new incompatible information.
  • the information processing device 10 also evaluates the similarity of the incompatible information 13 and 14 based on the appearance frequency of the keywords.
  • the appearance frequency of keywords can be simply calculated from the incompatibility information 13 . Therefore, the information processing device 10 can efficiently evaluate the degree of similarity between the incompatible information 13 and 14 . Further, the information processing apparatus 10 evaluates the degree of similarity between the incompatibility information 13 and 14 based on the appearance order of the keywords in addition to the frequency of appearance of the keywords. Therefore, the information processing apparatus 10 can consider the difference in meaning based on the difference in word order, and the similarity evaluation accuracy increases.
  • the SQL statement “CREATE TABLE ... TABLESPACE " and the SQL statement “CREATE TABLESPACE ... TABLE " are recognized as having different characteristics from the viewpoint of incompatibility.
  • the frequency of occurrence of keywords is the same, but the order of appearance of these keywords is different. Therefore, the information processing apparatus 10 can appropriately evaluate the similarity of incompatible information by considering the order of appearance.
  • the information processing apparatus 10 evaluates the degree of similarity between the incompatible information 13 and 14 based on the appearance frequency of the keywords, and only when the degree of similarity in the first stage is high, the information processing apparatus 10 evaluates the incompatible information 13 based on the order of appearance of the keywords. , 14 can also be evaluated. In this case, the information processing device 10 can efficiently evaluate the degree of similarity between the incompatible information 13 and 14 . Further, the information processing apparatus 10 narrows down other incompatible information that may be similar to the incompatible information 13 based on the frequency of appearance of the keywords, and then, based on the order of appearance of the keywords, the information that is similar to the incompatible information 13 Other incompatibility information can also be determined. In this case, the information processing device 10 can efficiently extract other incompatibility information similar to the incompatibility information 13 .
  • the information processing system of the second embodiment analyzes the source code of a program that uses a database product, and supports correction work when changing the database product that is used.
  • Changes in database products include changes between database products provided by different software vendors and changes between different versions provided by the same software vendor. Incompatibilities may exist between database products. Modifying source code to eliminate defects caused by incompatibility is sometimes called incompatibility absorption.
  • FIG. 2 is a diagram illustrating an example of an information processing system according to the second embodiment.
  • the information processing system of the second embodiment includes terminal devices 31 , 32 and 33 connected to a network 30 and an information processing device 100 .
  • the network 30 may include a LAN (Local Area Network) and may include the Internet.
  • Terminal devices 31, 32, and 33 are client computers operated by users.
  • the information processing device 100 is a server computer accessed from the terminal devices 31 , 32 and 33 .
  • the information processing device 100 corresponds to the information processing device 10 of the first embodiment.
  • the terminal device 31 is a client computer used by a creator who creates incompatible information.
  • Incompatible information is knowledge information shared by multiple parties engaged in the work of an incompatible absorption.
  • the incompatibility information defines an identification method for identifying an incompatible portion in the source code and a rewriting method for rewriting the identified incompatible portion so as to eliminate the incompatibility.
  • the terminal device 31 communicates with the information processing device 100 and uploads the created incompatibility information to the information processing device 100 . As will be described later, the terminal device 31 may use an editor provided by the information processing device 100 to assist creation of incompatible information.
  • the terminal device 32 is a client computer used by an approver who approves the incompatible information uploaded to the information processing device 100 .
  • the incompatibility information uploaded from the terminal device 31 to the information processing device 100 is set to the "prepared" state, and formal registration in the knowledge database is suspended.
  • the incompatible information in the prepared state is formally registered in the knowledge database through automatic verification by the information processing apparatus 100 and approval by an approver.
  • the approver reviews the uploaded incompatible information, performs verification work such as test execution, and confirms that the incompatible information operates correctly and the validity of the description.
  • the terminal device 33 is a client computer used by an incompatibility absorption worker who performs incompatibility absorption using the incompatibility information accumulated in the information processing device 100 .
  • the terminal device 33 retrieves and receives, from the information processing device 100, incompatibility information valid for a set of the database product before change and the database product after change.
  • the terminal device 33 applies the incompatibility information to the source code corresponding to the database product before change, and automatically converts the source code so as to be compatible with the database product after change.
  • the information processing device 100 is a server computer that manages incompatible information.
  • the information processing device 100 provides the terminal device 31 with a user interface of an editor that supports creation of incompatible information. However, the terminal device 31 can also create incompatible information without using an editor.
  • the information processing device 100 receives the incompatibility information from the terminal device 31 . Then, the information processing apparatus 100 sets the received incompatibility information to a prepared state and performs automatic verification. Automated verification includes automated testing using sample source code and a test database, and identity determination to determine whether existing incompatible information is substantially identical.
  • the information processing device 100 also receives an approval message from the terminal device 32 .
  • the information processing apparatus 100 cancels the prepared state of the incompatible information for which the automatic verification is successful and the approval message is received, and officially registers it in the knowledge database.
  • the information processing device 100 searches the knowledge database for incompatibility information that matches the current incompatibility absorption work, and transmits the corresponding incompatibility information to the terminal device 33 .
  • some of the functions described above may be transferred between the terminal devices 31 , 32 , 33 and the information processing device 100 .
  • application software corresponding to an editor that supports creation of incompatible information may be installed in the terminal device 31 .
  • the information processing device 100 does not have to provide the terminal device 31 with an editor function.
  • the terminal device 31 may perform automatic verification of incompatible information.
  • the terminal devices 31, 32, and 33 may hold a copy of the knowledge database of the incompatible information.
  • the information processing device 100 may execute incompatibility absorption in response to a request from the terminal device 33 .
  • FIG. 3 is a block diagram illustrating an example of hardware of an information processing apparatus.
  • the information processing apparatus 100 has a CPU 101, a RAM 102, an HDD 103, a GPU 104, an input interface 105, a medium reader 106 and a communication interface 107 connected to a bus.
  • a CPU 101 corresponds to the processing unit 12 of the first embodiment.
  • a RAM 102 or HDD 103 corresponds to the storage unit 11 of the first embodiment.
  • the terminal devices 31 , 32 and 33 may have hardware similar to that of the information processing device 100 .
  • the CPU 101 is a processor that executes program instructions. CPU 101 loads at least part of the programs and data stored in HDD 103 into RAM 102 and executes the programs.
  • the information processing device 100 may have multiple processors. A collection of processors may be called a multiprocessor or simply a "processor.”
  • the RAM 102 is a volatile semiconductor memory that temporarily stores programs executed by the CPU 101 and data used for calculations by the CPU 101 .
  • the information processing device 100 may have a type of volatile memory other than RAM.
  • the HDD 103 is a nonvolatile storage that stores software programs such as an OS (Operating System), middleware, application software, and data.
  • the information processing device 100 may have other types of non-volatile storage such as flash memory and SSD (Solid State Drive).
  • the GPU 104 generates images in cooperation with the CPU 101 and outputs the images to the display device 111 connected to the information processing device 100 .
  • the display device 111 is, for example, a CRT (Cathode Ray Tube) display, a liquid crystal display, an organic EL (Electro Luminescence) display, or a projector.
  • the information processing apparatus 100 may be connected to another type of output device such as a printer.
  • the input interface 105 receives input signals from the input device 112 connected to the information processing apparatus 100 .
  • the input device 112 is, for example, a mouse, touch panel, or keyboard.
  • a plurality of input devices may be connected to the information processing apparatus 100 .
  • the medium reader 106 is a reading device that reads programs and data recorded on the recording medium 113 .
  • the recording medium 113 is, for example, a magnetic disk, an optical disk, or a semiconductor memory. Magnetic disks include flexible disks (FDs) and HDDs. Optical discs include CDs (Compact Discs) and DVDs (Digital Versatile Discs).
  • a medium reader 106 copies the program and data read from the recording medium 113 to another recording medium such as the RAM 102 or HDD 103 .
  • the read program may be executed by CPU 101 .
  • the recording medium 113 may be a portable recording medium. Recording medium 113 may be used to distribute programs and data. Recording medium 113 and HDD 103 may also be referred to as computer-readable recording media.
  • the communication interface 107 is connected to the network 30 and communicates with the terminal devices 31 , 32 and 33 via the network 30 .
  • the communication interface 107 may be a wired communication interface connected to a wired communication device such as a switch or router, or a wireless communication interface connected to a wireless communication device such as a base station or access point.
  • FIG. 4 is a diagram showing an example flow of non-compatible absorption of database products.
  • the information processing system acquires the source code 131 that depends on the database product before change.
  • Source code 131 includes SQL statements or SQL procedure code.
  • a SQL statement is a database query written using SQL.
  • SQL procedural code is a program in a procedural language defined to be consistent with SQL and operates as a stored procedure.
  • the information processing system parses the source code 131 and generates a syntax tree 132 .
  • the syntax tree 132 is tree-type data that indicates the structure of language elements such as sentences, clauses, phrases, and words.
  • the syntax tree 132 generated through syntactic analysis can express the context in which each word appears in the source code 131, unlike the case where only lexical analysis is performed. For example, in SQL sentences and SQL procedure code, even for the same variable, the effective range of the variable may differ depending on the position where the variable is written. Therefore, the syntax tree 132 is useful for incompatible absorption.
  • the information processing system need not perform semantic analysis of the source code 131, and the syntax tree 132 need not include semantic information indicating the logical meaning of language elements.
  • the information processing system holds, as knowledge information, incompatibility information 133 associated with a set of the pre-change database product and the post-change database product.
  • a database product may be identified by a product name and version number pair.
  • the incompatibility information 133 includes a sequence of specific instructions and a sequence of rewrite instructions.
  • the identification instruction is an instruction for identifying an incompatible portion from the syntax tree 132 that may operate normally in the database product before the change but may cause a problem in the database product after the change.
  • the rewrite instruction is an instruction for rewriting the syntax tree 132 so that the incompatible portion specified by the specific instruction does not cause any problem in the database product after the change.
  • the information processing system executes the specific instruction included in the incompatibility information 133 for the syntax tree 132 .
  • the information processing system executes the rewrite instruction included in the incompatibility information 133 for the syntax tree 132 to absorb the incompatibility. This rewrites the syntax tree 132 so as to eliminate the incompatibility.
  • the information processing system generates source code 134 from the rewritten syntax tree 132 .
  • the source code 134 is the result of the incompatibility absorption of the source code 131, and is the source code for the database product after modification.
  • FIG. 5 is a block diagram showing an example of functions of the information processing apparatus.
  • the information processing apparatus 100 has a sample code storage unit 121 and an incompatibility information storage unit 122 . These storage units are implemented using the RAM 102 or the HDD 103, for example.
  • the information processing apparatus 100 also has an editor 123 , a registration unit 124 , a test unit 125 , an identity determination unit 126 and a search unit 127 . These processing units are implemented using, for example, the CPU 101 and programs.
  • the sample code storage unit 121 stores samples of source code before conversion.
  • Source code includes SQL statements or SQL procedure code.
  • the source code is created by the creator of the incompatible information and uploaded from the terminal device 31 to the information processing device 100 .
  • Source code may be provided from the terminal device 31 when creating the incompatible information using the editor 123 . Also, when registering the incompatibility information in the information processing apparatus 100, the source code may be provided from the terminal device 31 together with the incompatibility information.
  • the source code provided when using the editor 123 and the source code provided when registering incompatibility information may be the same or different.
  • the sample code storage unit 121 may store a correct execution result expected when the converted source code is executed by the changed database product.
  • a correct execution result indicates, for example, a table generated by an SQL statement or SQL procedure code included in the source code.
  • a correct execution result may be provided from the terminal device 31 together with the incompatibility information and the pre-conversion source code when the incompatibility information is registered.
  • the incompatibility information storage unit 122 is a knowledge database that stores incompatibility information.
  • Incompatibility information is knowledge information indicating technical know-how regarding incompatibility absorption between database products.
  • the incompatibility information includes a specific instruction indicating a procedure for identifying an incompatible portion from the syntax tree, and a rewrite instruction indicating a procedure for rewriting the identified incompatible portion.
  • incompatible information may include multiple pieces of incompatible sub-information as reusable units.
  • the incompatibility information storage unit 122 may store management information for retrieving usable incompatibility information from a set of the database product before change and the database product after change.
  • the incompatible information uploaded from the terminal device 31 is first set to the prepared state. After the usefulness of the incompatible information in the prepared state is confirmed through automatic verification by the test unit 125 and the identity determination unit 126 and approval by an approver, the prepared state is canceled and the incompatible information storage unit 122 is formally stored. be registered.
  • the editor 123 provides a graphical user interface for efficiently creating incompatible information and assists the terminal device 31 in creating the incompatible information.
  • the editor 123 acquires a source code sample before conversion from the terminal device 31 .
  • the editor 123 parses the source code to generate a syntax tree, and causes the display device of the terminal device 31 to display the generated syntax tree.
  • the editor 123 receives from the terminal device 31 an operation of sequentially selecting two or more nodes included in the syntax tree or an operation of rewriting a part of the nodes.
  • the editor 123 sequentially generates a specification command and a rewrite command for the incompatibility information based on the received operation, and transmits the automatically generated incompatibility information to the terminal device 31 .
  • the registration unit 124 receives the incompatibility information and source code samples before conversion from the terminal device 31 .
  • the registration unit 124 may further receive, from the terminal device 31, execution results of correct answers in the database product after the change.
  • the incompatible information may be created using the editor 123 or may be created without using the editor 123 .
  • the source code may be the same as that used in editor 123 .
  • the registration unit 124 sets the received incompatibility information to a prepared state and temporarily registers it in the incompatibility information storage unit 122 . Further, the registration unit 124 stores the received source code in the sample code storage unit 121 , and stores the correct execution result in the sample code storage unit 121 when a correct execution result is provided. Then, the registration unit 124 requests the test unit 125 to automatically test the incompatibility information, and requests the identity determination unit 126 to determine the identity of the incompatibility information. Automated testing and identity determination are scheduled as background processes. The registration unit 124 also transmits a request for approval of the incompatibility information to the terminal device 32 .
  • the registration unit 124 acquires the result of the automatic test from the test unit 125, acquires the result of identity determination from the identity determination unit 126, and receives the approval result of the approver from the terminal device 32.
  • the automated test results indicate whether the incompatible information works correctly.
  • the result of identity determination indicates whether or not the incompatible information has the novelty that it is not substantially the same as other incompatible information.
  • the approval result indicates whether or not the approver has approved the incompatible information. If the incompatible information operates normally, has novelty, and is approved by the approver, the registration unit 124 cancels the prepared state of the incompatible information.
  • the test unit 125 tests the incompatibility information in the prepared state.
  • the test unit 125 applies the incompatibility information to the pre-conversion source code sample to generate the post-conversion source code.
  • the test unit 125 uses a test database corresponding to the modified database product to execute SQL statements or SQL procedure code included in the converted source code.
  • the test database may be installed in the information processing device 100 or may be installed in another information processing device.
  • the test unit 125 extracts the execution result from the test database and compares it with the correct execution result. When the execution result of this time matches the execution result of the correct answer, the test unit 125 determines that the test is successful and the incompatibility information operates normally. On the other hand, if the current execution result and the correct execution result do not match, the test unit 125 determines that the test has failed and that the incompatibility information does not operate normally. However, if the correct execution result is not provided from the terminal device 31, the test unit 125 transmits the execution result in the test database to the terminal device 31, and the evaluation result indicating whether or not the current execution result is normal. is received from the terminal device 31 .
  • the identity determination unit 126 determines whether or not the incompatibility information in the prepared state is substantially the same as the existing incompatibility information registered in the incompatibility information storage unit 122 .
  • both are the same knowledge information for resolving the incompatibility, and the incompatibility information in the prepared state has novelty. do not do.
  • the incompatibility information in the prepared state and the existing incompatibility information have different specific instructions, if the incompatibility location searched on the syntax tree is the same, both are the same incompatibility. It is knowledge information for resolving the problem, and the incompatible information in the prepared state has no novelty. The details of identity determination will be described later.
  • the search unit 127 reads the incompatibility information from the incompatibility information storage unit 122 and transmits it to the terminal device 33 in response to a request from the terminal device 33 .
  • the search unit 127 receives from the terminal device 33 designation of a database product before change and a database product after change.
  • the search unit 127 searches the incompatibility information storage unit 122 for incompatibility information associated with the specified set of database products, and provides the retrieved incompatibility information to the terminal device 33 .
  • FIG. 6 is a diagram showing a first example of a syntax tree.
  • a sentence contains a terminal symbol at the end.
  • a sentence may contain clauses before terminal symbols.
  • a clause contains an imperative word at the beginning and a phrase, expression or word between the imperative word and the terminal symbol.
  • Phrases begin with an object-type, preposition, adverb, or parenthesis.
  • a phrase may be followed by a phrase, expression or word, and a phrase, expression or word may occur more than once. Phrases may be followed by clauses.
  • An expression contains a function name or word followed by an operator.
  • a terminal symbol indicates the end of a sentence.
  • a terminal symbol may be a semicolon (“;”).
  • a word is the smallest linguistic unit that has meaning in a sentence. Words include identifiers, reserved words, function names and operators. Reserved words include command words, object types and other reserved words. An instruction word indicates an instruction such as CREATE or UPDATE. The object type indicates the type of object such as TABLE. Other reserved words are reserved words other than command words and object types, such as BEGIN. Expressions include pairs of words and words joined by operators, and pairs of words and expressions joined by operators. Expressions also include pairs of function names and arguments. Arguments are enclosed in open brackets (“(”) and close brackets (“)”).
  • phrases include general phrases, predicate phrases, suffix phrases, definition phrases and unclassified phrases.
  • a general phrase is a modifier-object pair. The pair of object type and identifier is a general clause, for example TABLE T1.
  • a predicate phrase contains a preposition-object pair, such as FROM T1 and AS T2.
  • Predicate phrases also contain pairs of adverbs and objects, such as WHERE C1. Suffixes are enclosed between open and close parentheses and can be used to specify data types and key columns.
  • a definition phrase is a language element that specifies the type of a variable, and includes words other than reserved words and reserved words that indicate data types.
  • An unclassified phrase is a phrase that does not correspond to any of general phrases, predicate phrases, suffix phrases, and definition phrases.
  • Syntax tree 151 shows the syntax of source code 141 .
  • Source code 141 includes the SQL statement CREATE TABLE T1(C1 CHAR(10), C2 NUMERIC(3,1), PRIMARY KEY(C1,C2)) TABLESPACE SPC1;.
  • the syntax tree 151 is an undirected graph with a tree structure.
  • Syntax tree 151 includes a plurality of nodes, each representing a language element, and a plurality of edges connecting the nodes into the tree structure.
  • An edge between an upper node and a lower node indicates that the linguistic element corresponding to the lower node is included in the linguistic element corresponding to the upper node.
  • the appearance order of multiple language elements is preserved. The language element corresponding to the left node appears earlier than the language element corresponding to the right node.
  • the syntax tree 151 includes nodes 151a, 151b, 151c, and 151d.
  • Node 151a represents the object type of the second clause included in the clause, and corresponds to the character string TABLESPACE.
  • a node 151b represents the command word at the beginning of the clause and corresponds to the character string CREATE.
  • a node 151c represents the object type of the first clause included in the clause, and corresponds to the character string TABLE.
  • Node 151d represents the second phrase contained in the clause.
  • Node 151a is the first child node of node 151d.
  • Each node has attributes such as language element types and values. Only some attributes are shown in the display example of the syntax tree.
  • FIG. 7 is a diagram showing an example of attribute information.
  • Attribute information 171 is associated with one node of the syntax tree. Attribute information 171 includes position information, classification, classification attribute, type, value, value attribute and line number. However, some item values may not be defined depending on the node type.
  • Position information indicates the position of the node in the syntax tree. As will be described later, the position of a node can be represented by two-dimensional coordinates including vertical and horizontal positions.
  • Classification indicates the highest level classification of sentences, clauses, phrases, expressions, words, and the like.
  • the classification attribute indicates the distinction between general nodes and complementary nodes.
  • a general node indicates a language element extracted directly from the source code description. Completion nodes indicate language elements that are not explicitly stated in the source code but have been interpretively completed.
  • the classification is a group that further subdivides the above classification, such as general phrases and imperative words.
  • the value is a string of words.
  • the value attribute is the type of value. Value attributes include general strings and complement strings.
  • the line number is the number of the line where the language element corresponding to the node appears in the source code.
  • a syntax tree can be expressed as a two-dimensional tabular syntax table. This makes it easier to specify the position of the node, and to facilitate the description of the identification of the node and the procedure for searching for the node.
  • Each node of the syntax tree is placed in the syntax table according to the following rules.
  • FIG. 8 is a diagram showing an example of a syntax table.
  • Syntax table 172 is a syntax table equivalent to syntax tree 151 in FIG.
  • the position coordinates of the upper left cell of the syntax table 172 are (1, 1).
  • the row number indicating the vertical position increases as it moves downward, and the column number indicating the horizontal position increases as it moves to the right.
  • the position coordinates of each cell are defined as (row number, column number).
  • a node indicating a sentence is placed in the upper left cell of the syntax table 172 .
  • the leftmost child node among child nodes directly under a certain node is placed in a cell immediately below the cell corresponding to the node.
  • the cell immediately below is a cell with a row number that is one higher and a column number that is the same.
  • Other nodes that have the same parent node as a node and are to the right of the node are placed in cells to the right of the cell corresponding to the node.
  • the cell on the right is the cell with the same row number and larger column number.
  • the cell in which each node is placed is determined in depth-first order.
  • a node of one word included in the syntax tree is arranged in one column. Therefore, two nodes having a parent-child relationship may have consecutive row numbers, while two nodes having the same parent node may have non-consecutive column numbers.
  • the word nodes corresponding to the 29 words included in the source code 141 are arranged in the 1st to 29th columns of the syntax table 172 while maintaining the order.
  • syntax table 172 and syntax tree 151 are interchangeable.
  • the incompatibility information includes one or more specific instructions for searching for nodes satisfying conditions on the syntax tree and one or more rewriting instructions for rewriting some nodes included in the syntax tree.
  • FIG. 9 is a diagram showing an example of an instruction table.
  • the instruction table 173 shows definitions of instructions that can be used in incompatible information.
  • One record in the instruction table 173 indicates one instruction.
  • One record of the command table 173 includes command, vertical position, horizontal position, search attribute and keyword.
  • the vertical position is a condition for the vertical positional relationship between the current node of interest and the target node. + indicates upward direction, - indicates downward direction, n indicates distance from the current node, and * indicates no distance limit.
  • the horizontal position may be specified in the format [instruction number]. This indicates that the horizontal position of the node selected by the command with that command number is the starting point of the search. Also, the horizontal position may be specified in a format of [instruction number 1:instruction number 2]. This indicates searching between the horizontal position of the node selected by the instruction with instruction number 1 and the horizontal position of the node selected by the instruction with instruction number 2.
  • a search attribute is a condition for a classification, classification attribute, type and value attribute of a target node.
  • a keyword is information other than search attributes for identifying a node.
  • a keyword may be an identifier as a word value.
  • an instruction number of an executed instruction may be specified. This indicates to reselect the node identified by the instruction.
  • No action means to proceed to the next command.
  • RET indicates to execute the next instruction and return to the instruction if the result of the next instruction is false.
  • NEXT instruction number indicates to jump to the instruction with the specified instruction number.
  • another instruction itself using the attribute information of the current node of interest may be specified as an action.
  • the commands include FETCH, SEARCH, POP, GET PRM, SET PRM, ! , DELETE, CREATE, and MODIFY.
  • FETCH, SEARCH, POP, GET PRM, SET PRM, ! can be used as a specific instruction.
  • DELETE, CREATE, MODIFY can be used as rewrite commands.
  • FETCH is an instruction to search for a node that satisfies a condition and change the current node of interest (current node) to the detected node.
  • SEARCH is a command that searches for a node that satisfies a condition, but does not change the current node.
  • POP is an instruction that returns the current node to the node selected by the executed FETCH.
  • GET PRM is an instruction to store the attribute information of nodes that satisfy the conditions in the stack.
  • SET PRM is an instruction to output attribute information saved in the stack. SET PRM may be used within the FETCH or SEARCH keywords. ! is a negation instruction that inverts true/false. Before SEARCH! is added, the result of the instruction is determined to be true when no node that satisfies the condition is detected.
  • DELETE is an instruction to delete a specified range of nodes from the syntax tree based on the current node.
  • CREATE is an instruction to insert a subtree before or after the current node. The subtree to be inserted is saved as CREATE information separately from the instruction string.
  • CREATE has as an argument a keyword containing a CREATE information number that identifies CREATE information.
  • MODIFY is an instruction to rewrite the attribute information of the current node.
  • a regular expression program can be specified in the action.
  • Incompatibility information is usually searched for the most characteristic keyword related to the incompatible part first.
  • the first keyword is sometimes called the anchor, and searching for the anchor from the syntax tree is sometimes called the anchor search.
  • Incompatibility information searches for surrounding nodes whose attributes satisfy specific conditions from around the anchor in the syntax tree. As a result, a node set that forms an incompatible portion is identified.
  • the feature of the incompatible part is sometimes called a unique condition.
  • the incompatibility information identifies a node to be rewritten using any of the detected nodes as a base point.
  • a base point may be an anchor.
  • FIG. 10 is a diagram showing a first example of incompatibility information.
  • Incompatibility information 161 is an example of incompatibility information applied to syntax tree 151 of FIG.
  • TABLESPACE SPC1 included in the source code 141 is incompatible with the database product after the change, and the incompatibility is resolved by deleting TABLESPACE SPC1.
  • One record of the incompatibility information 161 corresponds to one specific instruction or one rewrite instruction.
  • Each record of the incompatibility information 161 includes command number, command attribute, command, vertical position, horizontal position, search attribute, keyword and action.
  • the instruction number is an ascending natural number that indicates the execution order of the instruction.
  • the command attribute indicates a distinction between a specific command and a rewrite command.
  • Vertical position, horizontal position, search attributes and keywords are the arguments of the command.
  • An action indicates what to do if the result of an instruction is true.
  • the incompatibility information 161 includes eight instructions from the first instruction to the eighth instruction.
  • the first to fifth instructions are specific instructions, and the sixth to eighth instructions are rewrite instructions.
  • the first command searches the syntax tree 151 for a node 151a whose type is object type and whose value is TABLESPACE, and selects it as the current node.
  • the second command retrieves a node closest to the current node whose vertical position is above the current node, whose horizontal position is left of the current node, and whose classification is clause, and selects it as the current node.
  • the third command retrieves the node 151b, which is a node immediately below the current node and whose type is command word and whose value is CREATE.
  • the fourth command retrieves a node whose vertical position is one level below the current node, whose horizontal position is between CREATE and TABLESPACE, and whose classification is phrase, and selects it as the current node.
  • the fifth command searches for the node 151c, which is a node immediately below the current node, whose type is object type and whose value is TABLE. If the result of the fifth instruction is false, return to the fourth instruction.
  • the sixth instruction returns the current node to node 151a of the TABLESPACE selected by the first instruction.
  • the seventh instruction retrieves the node 151d, which is the node immediately above the current node and whose classification is phrase, and selects it as the current node.
  • the eighth instruction deletes the current node and its subordinate nodes.
  • the information processing system may execute only specific instructions among the instructions included in the incompatibility information 161 and output information on the detected incompatibility.
  • FIG. 11 is a diagram showing a second example of the syntax tree.
  • Syntax tree 152 shows the syntax of source code 142 .
  • This SQL statement contains a subquery below WHERE EXISTS and has a complicated syntax.
  • Syntax tree 152 includes nodes 152a and 152b.
  • Node 152a represents the data type in the expression included in the main query and corresponds to the character string NUMBER.
  • Node 152b represents the data type in the expression included in the subquery and corresponds to the string NUMBER.
  • FIG. 12 is a diagram showing a second example of incompatibility information.
  • Incompatibility information 162 is an example of incompatibility information that applies to syntax tree 152 of FIG.
  • the data type NUMBER included in the source code 142 is incompatible with the database product after the change, and the incompatibility is resolved by replacing NUMBER with NUMERIC.
  • the incompatibility information 162 includes 19 instructions from the 1st instruction to the 19th instruction.
  • the first to fourth instructions are specific instructions for searching for the first data type, and the fifth to sixth instructions are rewrite instructions for rewriting the first data type.
  • the 7th to 17th instructions are specific instructions for searching for the second data type, and the 18th to 19th instructions are rewrite instructions for rewriting the second data type. .
  • the first command searches the syntax tree 152 for a node whose type is an instruction word and whose value is SELECT, and selects it as the current node.
  • the second command retrieves a node whose vertical position is above the current node and whose classification is clause, and selects it as the current node.
  • the third command retrieves a node whose vertical position is one node below the current node, whose horizontal position is to the right of SELECT of the first command, and whose classification is an expression, and selects it as the current node.
  • the fourth command retrieves the node 152a whose vertical position is one level below the current node, whose horizontal position is to the right of the current node, whose type is data type and whose value is NUMBER, and selects it as the current node. If the result of the fourth instruction is false, return to the third instruction.
  • the fifth instruction deletes the current node.
  • the sixth instruction creates a new node whose type is data type and whose value is NUMERIC and inserts it at the position of the deleted node.
  • FIG. 13 is a diagram (continued) showing the second example of the incompatibility information.
  • the seventh command returns the current node to the SELECT node selected by the first command.
  • the eighth instruction retrieves a node whose vertical position is one level below the current node and whose type is predicate phrase, and selects it as the current node.
  • the ninth command retrieves a node whose vertical position is one level below the current node, whose horizontal position is to the right of the current node, and whose classification is formula, and selects it as the current node. If the result of the ninth instruction is false, return to the eighth instruction.
  • the tenth command retrieves a node whose vertical position is one node below the current node, whose horizontal position is to the right of the current node, and whose type is a conjunction, and selects it as the current node. If the result of the tenth instruction is false, return to the ninth instruction.
  • the eleventh command searches for a node whose vertical position is one level below the current node, whose horizontal position is to the right of the current node, and whose classification is clause, and selects it as the current node. If the result of the 11th instruction is false, return to the 10th instruction.
  • the twelfth command retrieves a node whose vertical position is one level below the current node, whose type is command word, and whose value is SELECT. If the result of the 12th instruction is false, return to the 11th instruction.
  • the thirteenth instruction is above the SELECT of the twelfth instruction, retrieves a node whose classification is clause, and selects it as the current node. If the result of the 13th instruction is false, return to the 12th instruction.
  • the 14th instruction searches for a node whose vertical position is one level below the current node, whose horizontal position is to the right of the clause of the 11th instruction, and whose type is predicate phrase, and selects it as the current node.
  • the fifteenth command retrieves a node whose vertical position is one node below the current node, whose horizontal position is to the right of SELECT of the twelfth command, and whose classification is an expression, and selects it as the current node. If the result of the fifteenth instruction is false, return to the fourteenth instruction.
  • the 16th instruction retrieves a node whose vertical position is one level below the current node, whose horizontal position is to the right of the clause of the 13th instruction, and whose classification is formula, and selects it as the current node. If the result of the 16th instruction is false, return to the 15th instruction.
  • the 17th instruction searches for the node 152b whose vertical position is one level below the current node, whose horizontal position is to the right of the predicate of the 14th instruction, whose type is data type and whose value is NUMBER, and Select as If the result of the 17th instruction is false, return to the 16th instruction.
  • the eighteenth instruction deletes the current node.
  • the nineteenth instruction creates a new node whose type is data type and whose value is NUMERIC and inserts it at the position of the deleted node.
  • FIG. 14 is a diagram showing an example of the source code of the SQL procedure.
  • the syntax of the SQL procedure code will now be described.
  • Database products may define a SQL procedural language for describing batches of data processing so that user programs can request complex data processing in a concise manner.
  • the SQL procedural language often has a grammar similar to SQL. Therefore, the information processing apparatus 100 adds language elements specific to the SQL procedural language, and then defines common syntax rules that include the SQL syntax and the SQL procedural language syntax.
  • the SQL procedure code includes control statements, sections, blocks and modules as language elements in addition to the SQL language elements described above.
  • a control statement is a statement representing a control structure such as a conditional branch or a loop.
  • Control statements include control words or phrases such as IF, WHEN, IN, THEN, ELSE, END IF, LOOP, END LOOP.
  • Sections are regions in the source code bounded by specific keywords and contained in blocks. Words that indicate the beginning or end of a section include DECLARE, BEGIN, EXCEPTION, END, AS, IS, and so on.
  • a block is an area in the source code that contains one or more sections or blocks. Blocks include FUNCTION blocks, PROCEDURE blocks, and anonymous blocks without block names.
  • a module is a unit representing the entire source code. One module corresponds to one physical file. The language type of the source code is determined based on the file name extension or the declaration at the beginning of the source code. The language type is SQL or SQL procedure language.
  • control statements, sections, blocks and modules are determined by specific keywords. However, it is assumed that EOF (End Of File) is included at the end of the source code. For example, the area from IF to END IF and the area from DECLARE to BEGIN are extracted from the source code. In the syntax tree, nodes representing control statements, sections, blocks or modules are assigned keywords at the beginning of the region. Language elements up to the next keyword appear are expanded under the node.
  • EOF End Of File
  • the source code 143 includes SQL procedure code.
  • the source code 143 is 19 lines of source code including blank lines.
  • AS in the first line is a keyword indicating the start of a section.
  • the character string before AS is not complete as a sentence. Therefore, the information processing system complements the terminal symbol just before AS and interprets it as one sentence.
  • v VARCHAR(50) on the 3rd line is a definition phrase, it is not used as part of the clause containing the imperative word. Therefore, the information processing system interprets that the instruction word DECLARE is omitted when the clause containing the definition phrase does not explicitly appear in the source code.
  • FUNCTION on the 5th line is a keyword that indicates the start of the block.
  • RETURN NUMBER on line 5 does not contain a phrase following the imperative word. Therefore, the information processing system completes TBD (To Be Determined) after the data type, and interprets the phrase containing the data type and value as a clause following the imperative word.
  • BEGIN on the eighth line is a keyword indicating the beginning of a section.
  • RETURN d; on line 10 does not include a phrase following the command word. Therefore, the information processing system complements EST (Established), which indicates that the data type has been defined, and interprets it as a clause in which a phrase containing a data type and a value follows an imperative word.
  • END on the 11th line is a keyword indicating a section break. However, END is followed by the name of the FUNCTION block and the terminator. Therefore, the information processing system interprets that the clause containing the END instruction is omitted in the END section, and complements such clause. The information processing system also complements the EST and interprets the END instruction as being followed by a phrase containing the data type and the name of the FUNCTION. PROCEDURE on the 13th line is a keyword indicating the start of a block. The information processing system also interprets BEGIN on the 15th line, END protest on the 17th line, and END ptest; on the 19th line in the same manner as above.
  • FIG. 15 is a diagram showing a third example of the syntax tree.
  • Syntax tree 153 shows the syntax of source code 143 .
  • Syntax tree 153 includes nodes 153a, 153b, 153c, 153d, 153e and 153f.
  • Node 153 a represents the AS section starting from line 1 of source code 143 .
  • a node 153 b represents the instruction word DECLARE complemented on the third line of the source code 143 .
  • a node 153 c represents the variable v described on the third line of the source code 143 .
  • Node 153 d represents a FUNCTION block starting from line 5 of source code 143 .
  • FIG. 16 is a diagram (continued) showing the third example of the syntax tree.
  • Node 153 e represents the PROCEDURE block starting at line 13 of source code 143 .
  • a node 153 f represents the variable v described on line 16 of the source code 143 .
  • Node 153f refers to the variable v defined at node 153c.
  • FIG. 17 is a diagram showing a third example of incompatibility information.
  • Incompatibility information 163 is an example of incompatibility information that applies to syntax tree 153 of FIGS.
  • source code 143 the method of declaring the variable v outside the FUNCTION block and the PROCEDURE block is incompatible. Consider the case where compatibility is broken.
  • variable v indicated by node 153f does not point to the external variable defined by node 153c, but to the internal variable. Therefore, rewriting of the variable name of the node 153f is executed only when an internal variable with the same variable name is not defined in the PROCEDURE block.
  • the incompatibility information 163 includes 14 instructions from the 1st instruction to the 14th instruction.
  • the first to sixth instructions are specific instructions for searching for variable declarations outside the block, and the seventh to eighth instructions are rewrite instructions for rewriting variable declarations.
  • the ninth to thirteenth instructions are specific instructions for searching for variable references in the block, and the fourteenth instruction is a rewrite instruction for rewriting the variable references.
  • the first command searches the syntax tree 153 for a node 153a whose classification is Section and whose value is AS, and selects it as the current node.
  • the second command retrieves a node whose vertical position is one level below the current node and whose classification is sentence, and selects it as the current node.
  • the third command retrieves a node whose vertical position is one level below the current node and whose classification is clause, and selects it as the current node. If the result of the third instruction is false, return to the second instruction.
  • the fourth instruction retrieves the node 153b, which is a node immediately below the current node, whose type is instruction word and whose value is DECLARE. If the result of the fourth instruction is false, return to the third instruction.
  • the fifth command searches for a node immediately below the current node whose type is a definition phrase and selects it as the current node.
  • the sixth instruction retrieves the node 153c, which is a node immediately below the current node and whose type is word, and saves the value of the node 153c.
  • the seventh instruction returns the current node to the node 153a selected in the first instruction.
  • the eighth command inserts the partial tree specified by the CREATE information number to the left of the current node.
  • the ninth instruction retrieves nodes 153d and 153e whose vertical position is below the current node and whose classification is block, and selects them as the current node.
  • the tenth instruction retrieves a node whose vertical position is below the current node and whose classification is an expression, and selects it as the current node. If the result of the tenth instruction is false, return to the ninth instruction.
  • the eleventh instruction retrieves the node 153f whose vertical position is below the current node and whose classification is word, and selects it as the current node. If the result of the 11th instruction is false, return to the 10th instruction.
  • a twelfth instruction determines whether the value of the current node matches the variable name saved in the sixth instruction. If the result of the 12th instruction is false, return to the 11th
  • the thirteenth command confirms that there is no node whose vertical position is one level above the current node and whose type is the definition clause.
  • the fourteenth instruction rewrites the value of the current node according to the regular expression program specified by the action.
  • extern is inserted at the beginning of the variable name.
  • the syntax tree is searched for incompatible locations.
  • the syntax tree may have a nested structure such as a subquery, the search may become complicated and the amount of calculation may increase.
  • the incompatible information may become complicated, and the burden of creating and managing the incompatible information may increase. Therefore, the information processing system limits the search range from the anchor. If a child node of a node has a classification grammatically at or above the node's level (eg, a phrase or a clause for a phrase), the child node is excluded from the search scope. Also, if a parent node of a certain node has a grammatical classification below the level of the node (for example, a clause or a phrase for a clause), the parent node is excluded from the search range.
  • the information processing system stops upward search if the classification of the parent node is equal to or lower than the classification of the current node, even if the incompatible information instructs upward search. Further, the information processing system stops downward search if the classification of the child node is equal to or higher than the classification of the current node even if the incompatibility information instructs downward search.
  • the information processing system performs a search to the right. to stop.
  • the information processing system performs leftward search. Stop exploring.
  • FIG. 18 is a diagram showing an example of an editor screen.
  • the editor 123 provides the terminal device 31 with an editor screen 174 as a user interface for supporting creation of the incompatible information 161 .
  • the terminal device 31 transmits the source code 141 to the editor 123 .
  • Editor 123 parses source code 141 to generate syntax tree 151 and generates editor screen 174 containing syntax tree 151 .
  • the editor 123 transmits the editor screen 174 to the terminal device 31 .
  • the terminal device 31 displays an editor screen 174.
  • the terminal device 31 accepts operations on the editor screen 174 .
  • Operations on the editor screen 174 include node selection for sequentially selecting a node of interest from the syntax tree 151, node deletion for deleting a selected node, and node addition for inserting a node at a specified position.
  • the operation on the editor screen 174 includes condition specification for selecting a defined search condition from the condition list.
  • operations on the editor screen 174 include parameter storage for storing the attributes of the selected node in the parameter case, and parameter reading using the attributes stored in the parameter case as search conditions.
  • the terminal device 31 transmits the accepted operation to the editor 123 .
  • Editor 123 generates specific instructions and rewrite instructions in response to the received operation. For example, editor 123 determines a unicursal path through the selected nodes based on a node selection that sequentially selects the nodes of syntax tree 151 .
  • the editor 123 automatically generates FETCH instructions and SEARCH instructions from the attributes of each node on the path and the positional relationship of the nodes on the path.
  • the editor 123 transmits the generated specific command and rewrite command to the terminal device 31.
  • the terminal device 31 displays the received specific command and rewrite command on the editor screen 174 .
  • Some or all of the parsing of the source code 141 , generation of the editor screen 174 , interpretation of operations on the editor screen 174 , and generation of incompatibility information may be executed by the terminal device 31 .
  • the information processing device 100 may transmit a program corresponding to the editor 123 to the terminal device 31 .
  • FIG. 19 is a diagram showing a first operation procedure example of the editor screen.
  • the terminal device 31 selects the node 151a with the keyword TABLESPACE (S10). Thereby, a first instruction is generated.
  • the terminal device 31 selects the node 151b with the keyword CREATE (S11). As a result, a route from the node 151a to the node 151b is searched, and the third instruction is generated from the second instruction.
  • the terminal device 31 selects the node 151c with the keyword TABLE (S12). As a result, a route from the node 151b to the node 151c is searched, and the fourth to fifth instructions are generated. Next, the terminal device 31 selects the node 151a again and returns the node of interest to the node 151a (S13). Thereby, the sixth instruction is generated. Next, the terminal device 31 selects the node 151d indicating the TABLESPACE clause (S14). Thereby, the seventh instruction is generated. Finally, the terminal device 31 deletes the node 151d from the syntax tree 151 (S15). Thereby, the eighth instruction is generated.
  • FIG. 20 is a diagram showing a second operation procedure example of the editor screen.
  • the terminal device 31 selects the node 153a indicating the AS section (S20). Thereby, a first instruction is generated.
  • the terminal device 31 selects the node 153b with the keyword DECLARE (S21). As a result, a route from the node 153a to the node 153b is searched, and the second to fourth instructions are generated.
  • the terminal device 31 selects the node 153c indicating the variable name v and saves the variable name v in the parameter case (S22). As a result, a path from the node 153b to the node 153c is searched, the value of the node 153c is extracted, and the fifth to sixth instructions are generated. Next, the terminal device 31 selects the node 153a again and returns the node of interest to the node 153a (S23). Thereby, the seventh instruction is generated.
  • the terminal device 31 inserts the subgraph into the syntax tree 153 by inputting the CREATE information number indicating the pre-created subgraph (S24). Thereby, the eighth instruction is generated.
  • the terminal device 31 selects the node 153d indicating the FUNCTION block and the node 153e indicating the PROCEDURE block as blocks under the AS section, and designates the area under the nodes 153d and 153e as the search range (S25).
  • the terminal device 31 reads the variable name v from the parameter case, selects the search condition "not a child of the definition clause" from the condition list, and selects the node 153f indicating the variable name v (S26). As a result, a search method for searching the node 153f from the search range is specified, and the ninth to thirteenth instructions are generated. Finally, the terminal device 31 rewrites the value of the node 153f from v to extern.v (S27). Thereby, the 14th instruction is generated.
  • FIG. 21 is a diagram showing an example of a test for incompatible information.
  • the test section 125 reads the source code 141 from the sample code storage section 121 .
  • the source code 141 is provided from the terminal device 31 together with the prepared state incompatibility information 161 .
  • the source code 141 includes an SQL statement requesting the creation of a new table T1 including columns C1 and C2.
  • source code 141 includes a TABLESPACE clause that is incompatible with modified database products.
  • the test unit 125 parses the source code 141 to generate the syntax tree 151, and executes the sequence of instructions included in the incompatibility information 161 for the syntax tree 151, thereby translating the source code 141 into the source code 144. Convert.
  • the source code 144 like the source code 141, includes an SQL statement requesting the creation of a new table T1 including columns C1 and C2. However, source code 144 does not include a TABLESPACE clause.
  • the test unit 125 transmits the SQL statements included in the source code 144 to the test database 128, executes the SQL statements, and extracts execution results from the test database 128.
  • the test database 128 is a modified database product assumed by the incompatibility information, and is pre-installed in the information processing device 100 or another information processing device.
  • the test unit 125 reads the correct execution result from the sample code storage unit 121, compares the current execution result and the correct execution result extracted from the test database 128, and determines whether the two match.
  • the execution result of the correct answer is provided from the terminal device 31 together with the source code 141 .
  • the correct execution result corresponding to the source code 141 is that an empty table T1 including columns C1 and C2 is generated.
  • the test unit 125 determines that the incompatibility information 161 is operating correctly. On the other hand, if the current execution result and the correct execution result do not match, the test unit 125 determines that the incompatibility information 161 does not operate properly and that the incompatibility information 161 has a problem. Note that if the correct execution result is not provided from the terminal device 31, the test unit 125 transmits the current execution result to the terminal device 31, and sends the result of judging whether or not the current execution result is correct to the terminal device 31. receive from
  • FIG. 22 is a diagram showing a fourth example of incompatibility information.
  • the incompatibility information 164 can detect the same incompatibilities as the incompatibility information 161 . However, the incompatible information 161 and 164 contain different specific instructions due to different search procedures.
  • the incompatibility information 164 includes six instructions from the first instruction to the sixth instruction as specific instructions.
  • the first command searches the syntax tree 151 for a node 151b whose type is command word and whose value is CREATE, and selects it as the current node.
  • the second command retrieves a node whose vertical position is above the current node and whose classification is clause, and selects it as the current node.
  • the third command retrieves a node whose vertical position is one node below the current node, whose horizontal position is to the right of CREATE of the first command, and whose classification is phrase, and selects it as the current node.
  • the fourth command retrieves the node 151c, which is a node immediately below the current node, whose type is object type and whose value is TABLE.
  • the fifth instruction searches for a node 151d whose horizontal position is to the right of the TABLE phrase of the third instruction and whose classification is phrase, and selects it as the current node.
  • the sixth command retrieves the node 151a, which is the node immediately below the current node, whose type is object type and whose value is TABLESPACE. In this way, since the anchor that is the starting point of the search depends on the subjectivity of the creator of the incompatible information, multiple pieces of incompatible information that can detect the same incompatible portion can be created.
  • the identity determination unit 126 determines substantial identity between the existing incompatible information and the incompatible information in the prepared state.
  • the information processing apparatus 100 may refuse to register incompatible information determined to be substantially the same as existing incompatible information.
  • the information processing apparatus 100 can efficiently manage incompatible information by reducing the redundancy of the knowledge database.
  • the information processing apparatus 100 regards the existing incompatible information determined to be substantially the same as the incompatible information in the prepared state as having been rediscovered and used by another person. It may be counted as a usage record. Thereby, the information processing apparatus 100 can appropriately evaluate the value of each piece of incompatible information.
  • the identity determination unit 126 In determining substantial identity, the identity determination unit 126 generates a BOW vector from each piece of incompatibility information as follows.
  • the BOW vector of the existing incompatible information may be stored in the incompatible information storage unit 122 together with the incompatible information.
  • FIG. 23 is a diagram showing an example of a BOW vector table.
  • the identity determination unit 126 extracts instructions including keywords from the incompatibility information, and extracts pairs of search attributes and keywords from each extracted instruction. Identity determination unit 126 counts the number of appearances of identical pairs and generates a BOW vector listing the number of appearances. One element of the BOW vector indicates the number of occurrences of a pair. However, the identity determination unit 126 may calculate the appearance probability of the same pair by adjusting the number of appearances by dividing the number of instructions of the incompatibility information, and generate a BOW vector listing the appearance probabilities.
  • the identity determination unit 126 generates the BOW vector table 181.
  • the BOW vector table 181 contains the BOW vectors of the incompatible information 161,164.
  • the identity determination unit 126 extracts (object type, TABLESPACE) from the first command, extracts (command word, CREATE) from the third command, and extracts (object type, TABLE ). Further, the identity determination unit 126 extracts (command word, CREATE) from the first command, (object type, TABLE) from the fourth command, and (object type , TABLESPACE).
  • the identity determination unit 126 assigns the first element to (command, CREATE), the second element to (object type, TABLE), and the third element to (object type, TABLESPACE), the incompatibility information 161, 164 together generate a BOW vector of (1,1,1).
  • the identity determination unit 126 calculates the cosine similarity between the BOW vector of the incompatible information in the prepared state and the BOW vector of the existing incompatible information.
  • the cosine similarity is calculated, for example, by calculating products for each same dimension, summing them, and dividing by the norm of two BOW vectors. The maximum cosine similarity value is 1, and the closer to 1, the higher the similarity.
  • the BOW vectors of the incompatible information 161 and 164 are the same and their cosine similarity is one. If the cosine similarity is equal to or less than the threshold, the identity determination unit 126 determines that the two pieces of incompatibility information are not similar and that the same incompatibility part is not detected.
  • the above BOW vector does not consider the order of appearance of keywords. Therefore, even if the cosine similarity of the BOW vectors is equal to or less than the threshold, the two pieces of incompatibility information may not detect the same incompatibility location.
  • the identity determination unit 126 first uses the above BOW vector to narrow down existing incompatible information that may be substantially identical to the incompatible information in the prepared state. After that, the sameness determination unit 126 compares the order of appearance of keywords on the source code estimated from the incompatibility information between the incompatibility information in the prepared state and the existing incompatibility information that has been narrowed down, Identity is finally determined.
  • the identity determination unit 126 generates a keyword list from each piece of incompatible information as follows.
  • a keyword list of existing incompatible information may be stored in the incompatible information storage unit 122 together with the incompatible information.
  • FIG. 24 is a diagram showing a first generation example of a keyword list.
  • the identity determination unit 126 extracts keywords included in the FETCH instruction and keywords included in the SEARCH instruction from the incompatibility information.
  • the identity determination unit 126 tracks the horizontal positions of the instructions included in the incompatibility information to estimate the appearance order of the two or more extracted keywords when the two or more keywords are included in the source code. Since two or more keywords are not necessarily searched for incompatible information in the order from left to right in the syntax tree, the identity determination unit 126 estimates the order of appearance based on the search range specified in the incompatible information. do.
  • the identity determination unit 126 generates a keyword list in which keywords are arranged in order of appearance.
  • the identity determination unit 126 generates a keyword list 182 from the incompatibility information 161. First, identity determination unit 126 extracts keyword TABLESPACE from the first instruction and generates node 183 indicating TABLESPACE. Next, identity determination unit 126 determines that the next node position is to the left of node 183 based on the horizontal position of the second instruction. Next, identity determination unit 126 extracts keyword CREATE from the third instruction and generates node 184 indicating CREATE.
  • identity determination unit 126 determines that the next node position is between the nodes 183 and 184 based on the horizontal position of the fourth instruction. Finally, identity determination unit 126 extracts keyword TABLE from the fifth instruction and generates node 185 indicating TABLE. As a result, a keyword list 182 is generated in which keywords are arranged in the order of CREATE, TABLE, and TABLESPACE.
  • FIG. 25 is a diagram showing a second generation example of the keyword list.
  • Identity determination unit 126 generates keyword list 186 from incompatibility information 164 .
  • identity determination unit 126 extracts keyword CREATE from the first instruction and generates node 187 indicating CREATE.
  • identity determination unit 126 determines that the next node position is to the right of node 187 based on the horizontal position of the third instruction.
  • identity determination unit 126 extracts keyword TABLE from the fourth instruction and generates node 188 indicating TABLE.
  • identity determination unit 126 determines that the next node position is to the right of the node 188 based on the horizontal position of the fifth instruction. Finally, identity determination unit 126 extracts keyword TABLESPACE from the sixth instruction and generates node 189 indicating TABLESPACE. As a result, a keyword list 186 is generated in which keywords are arranged in the order of CREATE, TABLE, and TABLESPACE.
  • the identity determination unit 126 calculates the degree of similarity between the two keyword lists. For example, the identity determination unit 126 calculates the edit distance of the keyword list. The identity determination unit 126 calculates the minimum number of keyword insertion, deletion, and replacement operations for converting one keyword list into the other keyword list. Also, for example, the identity determination unit 126 calculates the Euclidean distance of the keyword list. The identity determination unit 126 defines similarities between different keywords in advance, and calculates the root-sum-square or root-mean-square of the similarities between keywords at the same position in the keyword list.
  • a method for calculating the degree of similarity between documents in consideration of the order of appearance of keywords is also described in, for example, the following document. Fumito Konaka, Takao Miura, "Proposal of Semantic Similarity Method Considering Word Order", 7th Forum on Data Engineering and Information Management (DEIM2015), A2-6, March 2, 2015.
  • the identity determination unit 126 determines that the two pieces of incompatible information are not similar and that the same incompatible part is not detected.
  • the identity determination unit 126 determines that the two pieces of incompatibility information are similar and may detect the same incompatibility part. In this respect, the keyword lists 182 and 186 are the same. Therefore, the identity determination unit 126 determines that the incompatibility information 161 and 164 are substantially the same.
  • Incompatibility information may retrieve and rewrite multiple nodes at separate locations on the syntax tree associated with the same incompatibility.
  • the incompatibility information may include multiple sets of sequences of specific instructions and sequences of rewriting instructions. Such multiple instruction sets may be separate and reusable from each other, and some instruction sets may be reused for other incompatible information.
  • the information processing apparatus 100 extracts incompatible sub-information from the incompatible information as a reusable instruction set.
  • the identity determination unit 126 determines the identity of each piece of incompatible sub-information in addition to the identity of the entire incompatible information received from the terminal device 31 .
  • incompatible information containing a plurality of incompatible sub-information in a syntax tree with a nested structure, such as the incompatible information 162 shown in FIGS.
  • Some include an instruction set that searches the tree.
  • the syntactic tree search limits the vertical search range based on the classification level of each node, and limits the horizontal search range based on the keyword of each node.
  • the incompatible information searching nested structure can be divided into multiple incompatible sub-information.
  • the backward instruction set included in the incompatibility information may be searched using the POP instruction with the node detected in the forward instruction set as a base point.
  • the identity determination unit 126 may not only simply divide the incompatible information, but also change some instructions.
  • incompatible information including a plurality of incompatible sub-information
  • incompatible information 163 shown in FIG. There is something that takes over the parameters to .
  • incompatibility information a plurality of reusable instruction ranges can be extracted according to the mode of coupling between instruction sets using the GET PRM instruction. Therefore, a plurality of incompatible sub-information can be extracted from the incompatible information.
  • FIG. 26 is a diagram showing an example of extraction of incompatible sub-information.
  • Incompatible sub-information 165 is the second incompatible sub-information extracted from incompatible information 162 .
  • the first incompatibility sub-information extracted from the incompatibility information 162 is the same as the first to sixth instructions of the incompatibility information 162 .
  • the identity determination unit 126 detects the boundary where the instruction attribute switches from the rewrite instruction to the specific instruction from the incompatibility information 162 .
  • the identity determination unit 126 divides the instruction set before and after the boundary.
  • the seventh instruction in the incompatibility information 162 is a POP instruction that returns the current node to the first SELECT detected by the first instruction.
  • the eighth to twelfth instructions of the incompatibility information 162 are instructions for searching for the second SELECT from the first SELECT. Therefore, the 7th to 19th instructions of the incompatibility information 162 depend on the 1st incompatibility sub-information, and it is difficult to evaluate the 7th to 19th instructions themselves as independent incompatibility sub-information.
  • the identity determination unit 126 replaces the instruction string dependent on the previous instruction after the boundary with an anchor search instruction that does not depend on the previous instruction. Specifically, if there is a POP instruction immediately after the boundary, the identity determination unit 126 replaces the section from the POP instruction to the FETCH instruction or SEARCH instruction specifying the keyword with the FETCH instruction specifying the keyword.
  • the identity determination unit 126 deletes the 7th to 12th instructions of the incompatibility information 162, and instead adds a FETCH instruction that searches for a node whose type is an instruction word and whose value is SELECT. do.
  • the 13th to 19th instructions of the incompatibility information 162 are used as they are.
  • identity determination unit 126 generates incompatible sub-information 165 containing eight instructions.
  • FIG. 27 is a diagram illustrating an example of division of incompatibility information.
  • Incompatible sub-information is extracted from the incompatible information 163 as follows.
  • the identity determination unit 126 divides the 14 instructions included in the incompatibility information 163 into 4 instruction groups and the JOINT instruction according to the instruction attribute and the GET PRM instruction.
  • the identity determination unit 126 separates the GET PRM instruction as a JOINT instruction. Further, the identity determination unit 126 extracts the first to fifth instructions, which are consecutive specific instructions, as an instruction group #1, and extracts the seventh to eighth instructions, which are consecutive rewrite instructions, as an instruction group #2. Extract. The sameness determination unit 126 also extracts the ninth to thirteenth instructions, which are consecutive specific instructions, as an instruction group #3, and extracts the fourteenth instruction, which is a rewrite instruction, as an instruction group #4.
  • the identity determination unit 126 determines combinations of reusable instruction groups based on the position of the JOINT instruction and the instruction attributes of each instruction group.
  • identity determination unit 126 adopts instruction group #1 as one piece of incompatible sub-information. This incompatible sub-information searches for definition clauses under the AS section.
  • identity determination unit 126 adopts a combination of instruction groups #1 and #2 as one piece of incompatible sub-information. This incompatible sub-information is to retrieve and rewrite the definition clauses under the AS section.
  • the identity determination unit 126 adopts a combination of the instruction group #1, the JOINT instruction, and the instruction group #3 as one incompatible sub-information. This incompatible sub-information searches for definition clauses under the AS section, and further searches for references to variables defined in the definition clauses. Also, the identity determination unit 126 adopts a combination of the instruction group #1, the JOINT instruction, and the instruction groups #2 to #4 as one incompatible sub-information. This incompatible sub-information is the incompatible information 163 itself. In this way, the identity determination unit 126 extracts a substantially meaningful combination of instructions as incompatible sub-information from the incompatible information including the GET PRM instruction.
  • FIG. 28 is a flowchart illustrating an example procedure for generating incompatibility information.
  • the editor 123 parses the source code and generates a syntax tree.
  • the editor 123 accepts user operations on the editor screen.
  • the editor 123 determines whether the user operation is reselection of the previously selected node. If the user operation is to reselect a previously selected node, the process proceeds to step S103; otherwise, the process proceeds to step S104.
  • step S104 The editor 123 determines whether the user operation is a DELETE operation for deleting a node. If the user operation is a DELETE operation, the process proceeds to step S105; otherwise, the process proceeds to step S106.
  • the editor 123 determines whether the user operation is a CREATE operation specifying a CREATE information number. If the user operation is a CREATE operation, the process proceeds to step S107; otherwise, the process proceeds to step S108.
  • step S108 The editor 123 determines whether the user operation is to select a node first from the syntax tree. If the user operation is the first node selection, the process proceeds to step S109; otherwise, the process proceeds to step S110.
  • the editor 123 acquires the keyword of the selected node, generates a FETCH instruction indicating an anchor search for retrieving the acquired keyword, and adds it to the incompatibility information.
  • the vertical position of this FETCH instruction is *, the horizontal position is *, the search attribute is the attribute of the selected node, the keyword is the keyword of the selected node, and the action is none. Then, the process returns to step S101.
  • step S110 The editor 123 determines whether the user's operation is an end operation to end the creation of the incompatible information. If the user operation is an end operation, the process proceeds to step S131; otherwise, the process proceeds to step S111.
  • FIG. 29 is a flowchart (continued 1) illustrating an example of a procedure for generating incompatibility information.
  • the editor 123 determines whether there is a node selected by a previous user operation. If the previous selection node exists, the process proceeds to step S112; otherwise, the process proceeds to step S114.
  • the editor 123 compares the horizontal position of the previous selected node on the syntax tree with the horizontal position of the current selected node on the syntax tree.
  • the editor 123 sets the horizontal search range (horizontal position of search) to 0 when the previous horizontal position is the same as the current horizontal position. If the current horizontal position is greater than the previous horizontal position, the editor 123 sets the search horizontal position to [previous position: current position]. If the previous horizontal position is greater than the current horizontal position, the editor 123 sets the search horizontal position to [current position: previous position]. Then, the process proceeds to step S115.
  • the editor 123 sets the horizontal position of search to *.
  • the editor 123 preferentially selects one of the generated existing instructions included in the incompatibility information from the beginning. The editor 123 determines whether the selected existing instruction is a FETCH instruction and the horizontal position of the search for the FETCH instruction includes the horizontal position of the current selected node. If the selected existing instruction is a FETCH instruction that satisfies the above conditions, the process proceeds to step S116; otherwise, the process proceeds to step S118.
  • the editor 123 deletes the selected existing command from the incompatibility information.
  • the editor 123 also deletes from the incompatibility information a FETCH instruction that is an existing instruction that follows the selected existing instruction and that has the same search horizontal position as the selected existing instruction.
  • the editor 123 divides the search range of the deleted existing command into two parts based on the horizontal position of the current selected node.
  • the editor 123 creates a new FETCH instruction with a divided search range in place of the deleted existing instruction and adds it to the incompatible information.
  • step S118 The editor 123 determines whether or not all existing instructions included in the incompatible information have been selected in step S115. If all the existing commands have been selected, the process proceeds to step S119, and if there are unselected existing commands, the process returns to step S115.
  • FIG. 30 is a flowchart (continuation 2) illustrating an example of the procedure for generating incompatibility information.
  • the editor 123 determines whether the user operation includes reading a keyword from the parameter case. If the user operation includes reading a keyword, the process proceeds to step S120; otherwise, the process proceeds to step S121.
  • the editor 123 generates a SEARCH instruction and adds it to the incompatible information.
  • the vertical position of this SEARCH command is -1, the horizontal position is *, the search attribute is the attribute of the selected node this time, the keyword is SET PRM, and the action is none.
  • step S121 The editor 123 determines whether the user operation is selection of a word node classified as word. If the user operation is to select a word node, the process proceeds to step S122; otherwise, the process proceeds to step S127.
  • the editor 123 determines whether the user operation includes dropping a keyword into the parameter case. If the user operation includes dropping a keyword, the process proceeds to step S123; otherwise, the process proceeds to step S124.
  • the editor 123 generates a GET PRM instruction to save the keyword and adds it to the incompatible information.
  • the vertical position of this GET PRM command is the specified position, the horizontal position is 0, the search attribute is word, there is no keyword, and there is no transaction.
  • the editor 123 determines whether an incidental condition has been specified for the parent node of the current node by user operation. Ancillary conditions are selected, for example, from the condition list on the editor screen. If the incidental condition is specified, the process proceeds to step S125, and if the incidental condition is not specified, the process proceeds to step S126.
  • the editor 123 generates a SEARCH command for searching for nodes that satisfy the incidental conditions and adds it to the incompatible information.
  • the vertical position of this SEARCH command is +1, the horizontal position is *, the search attribute is the attribute specified by the incidental condition, the keyword is the keyword specified by the incidental condition, and the action is the action specified by the incidental condition.
  • the incidental condition is a negative expression that the corresponding node does not exist, the negative command ! is attached before the SEARCH command.
  • the editor 123 generates a SEARCH instruction and adds it to the incompatible information.
  • the vertical position of this SEARCH command is -1, the horizontal position is *, the search attribute is the attribute of the selected node, the keyword is the value of the selected node, and the action is none.
  • the editor 123 specifies the higher height (closer to the root node) of the previous selection node and the current selection node in the syntax tree as the reference height.
  • the editor 123 generates a FETCH instruction that traces the parent from the lower selected node of the previous selected node and the current selected node to the reference height. If the lower one is the previous selection node, the vertical position of the FETCH instruction is +1, the horizontal position is *, the search attribute is none, the keyword is none, and the action is none. If the lower one is the selected node this time, the vertical position of the FETCH command is -1, the horizontal position is *, the search attribute is the attribute of the parent node, there is no keyword, and the action is RET.
  • the editor 123 generates a FETCH instruction that traces the parent until the two nodes with the same height reach a common node in step S128.
  • the vertical position of the FETCH instruction on the previous selection node side is +1, the horizontal position is +, no search attribute, no keyword, and no action.
  • the vertical position of the FETCH instruction on the selected node side this time is -1, the horizontal position is *, the search attribute is that of the parent node, there is no keyword, and the action is RET.
  • FIG. 31 is a flowchart (continuation 3) showing an example of the procedure for generating incompatibility information.
  • the editor 123 preferentially selects one of the generated existing instructions included in the incompatibility information from the beginning.
  • Editor 123 determines whether the selected existing instruction is a FETCH instruction. If the selected existing instruction is the FETCH instruction, the process proceeds to step S132, and if the selected existing instruction is not the FETCH instruction, the process proceeds to step S138.
  • the editor 123 sets the instruction number of the FETCH instruction selected this time as the "end number” and sets the previous end number as the "start number”. (S133) The editor 123 determines whether the selected FETCH instruction is the first FETCH instruction in the incompatible information. If it is the first FETCH instruction, the process proceeds to step S138, and if it is the second or later FETCH instruction, the process proceeds to step S134.
  • step S134 The editor 123 determines whether the vertical position of the selected FETCH instruction is +1. If the vertical position of the selected FETCH instruction is +1, the process proceeds to step S135; otherwise, the process proceeds to step S136.
  • step S135) The editor 123 changes the horizontal position of the selected FETCH instruction to -[start number]. Then, the process proceeds to step S138.
  • step S136 The editor 123 determines whether the vertical position of the selected FETCH instruction is -1. If the vertical position of the selected FETCH instruction is -1, the process proceeds to step S137; otherwise, the process proceeds to step S138.
  • the editor 123 changes the horizontal position of the selected FETCH instruction to +[start number:end number].
  • the editor 123 determines whether or not all existing instructions included in the incompatibility information have been selected in step S131. When all the existing instructions have been selected, the generation of incompatibility information ends, and when there is an unselected existing instruction, the process returns to step S131.
  • FIG. 32 is a flow chart showing an example procedure of an incompatibility information test. ( S ⁇ b>140 ) The test unit 125 determines whether the acquired incompatibility information was created using the editor 123 . If the information is incompatible information created by the editor 123, the process proceeds to step S145; otherwise, the process proceeds to step S141.
  • the test unit 125 generates a syntax tree by parsing the source code acquired together with the incompatibility information.
  • Source code is provided by the creator of the incompatible information.
  • the test unit 125 sequentially executes instructions included in the incompatibility information for the syntax tree generated in step S141. At this time, the test unit 125 assigns a processed flag to the node to be processed by the instruction to specify the processed node.
  • the test unit 125 determines whether reselection of a processed node has occurred before all instructions included in the incompatibility information have been executed, that is, whether the nodes subject to instruction processing overlap. If the node is reselected, the process proceeds to step S144, and if the node is not reselected, the process proceeds to step S145.
  • the test unit 125 outputs a duplicate error indicating the instruction in which node reselection has occurred. For example, the test section 125 transmits a duplication error to the terminal device 31 .
  • the test unit 125 applies the incompatibility information to the source code acquired together with the incompatibility information to generate the converted source code.
  • test unit 125 executes the converted source code generated in step S145 in the test database, and extracts the execution result from the test database. For example, the test unit 125 transmits the SQL sentences included in the converted source code to the test database. Also, for example, the test unit 125 executes the SQL procedure code included in the converted source code in the test database.
  • test unit 125 determines whether the correct execution result is stored together with the incompatibility information and the source code. If the correct execution result is stored, the process proceeds to step S148, and if not stored, the process proceeds to step S150.
  • test unit 125 determines whether the execution result of the test in step S146 matches the correct execution result. When the test execution result and the correct execution result match, the test unit 125 determines that the incompatible information is operating normally, and terminates the incompatible information test. If they do not match, the process proceeds to step S149.
  • test unit 125 outputs a test error indicating that the incompatibility information did not operate normally. For example, the test section 125 transmits test errors to the terminal device 31 . Then the incompatibility information test ends.
  • the test unit 125 outputs the test execution result of step S146 and requests confirmation of whether the test execution result is correct. For example, the test unit 125 transmits the test execution result to the terminal device 31 .
  • FIG. 33 is a flowchart illustrating an example of a procedure for determining identity of incompatible information.
  • the identity determination unit 126 preferentially selects one instruction included in the incompatibility information from the beginning.
  • the identity determination unit 126 determines whether the selected instruction is a change point of the instruction attribute. When the selected instruction is a change point, the selected instruction is the first instruction in the incompatibility information, the previous instruction is a specific instruction and the current instruction is a rewriting instruction, and 1 A case where the previous instruction is a rewrite instruction and the current instruction is a specific instruction is included. If it is a change point, the process proceeds to step S161, and if it is not a change point, the process proceeds to step S162.
  • the identity determination unit 126 defines a new command group. Selected instructions are dispatched to this instruction group until another instruction group is defined. (S162) The identity determination unit 126 determines whether the selected instruction is the GET PRM instruction. If the selected instruction is the GET PRM instruction, the process proceeds to step S163, and if the selected instruction is not the GET PRM instruction, the process proceeds to step S164.
  • the identity determination unit 126 separates the instruction from the instruction group as a JOINT instruction.
  • the identity determination unit 126 determines whether or not all instructions included in the incompatibility information have been selected in step S160. If all instructions have been selected, the process proceeds to step S165, and if there are any unselected instructions, the process returns to step S160.
  • the identity determination unit 126 selects one instruction group from among the instruction groups generated in steps S160 to S164.
  • the identity determination unit 126 determines whether the head of the selected instruction group is a specific instruction and a POP instruction. If the head is a specific instruction and a POP instruction, the process proceeds to step S166; otherwise, the process proceeds to step S168.
  • the identity determination unit 126 deletes from the POP instruction at the head of the selected instruction group to the instruction immediately preceding the keyword-attached SEARCH instruction or the keyword-attached FETCH instruction.
  • the identity determination unit 126 converts the SEARCH instruction into the FETCH instruction when the head of the instruction remaining without being deleted is a SEARCH instruction.
  • step S168 The identity determination unit 126 determines whether all instruction groups generated in step S165 have been selected. If all instruction groups have been selected, the process proceeds to step S169, and if there is an unselected instruction group, the process returns to step S165.
  • the identity determination unit 126 generates a list including a continuous specific instruction group and a rewrite instruction group, with the JOINT instruction included in the incompatibility information as a dividing point. For example, it is assumed that specific instruction group #1, rewrite instruction group #1, JOINT instruction, specific instruction group #2, and rewrite instruction group #2 are generated from the incompatibility information. In this case, a list of specific instruction group #1+rewrite instruction group #1 and a list of specific instruction group #2+rewrite instruction group #2 are generated.
  • the identity determination unit 126 extracts the head specific instruction group from each list generated in step S169 and generates another list. For example, a list of only the specific instruction group #1 is generated from the list of the specific instruction group #1 + the rewrite instruction group #1, and a list of only the specific instruction group #2 is generated from the list of the specific instruction group #2 + the rewrite instruction group #2. is generated.
  • the identity determination unit 126 adds a JOINT instruction to the list generated in steps S169 and S170 to generate another list. Creating another list involves combining two lists using the JOINT instruction. However, another list is generated to the extent that the order of appearance of instructions is consistent with the incompatibility information. For example, a list of specific instruction group #1+JOINT instruction and a list of specific instruction group #1+rewrite instruction group #1+JOINT instruction are generated. Also, a list of specific instruction group #1+JOINT instruction+specific instruction group #2 and a list of specific instruction group #1+rewrite instruction group #1+JOINT instruction+specific instruction group #2+rewrite instruction group #2 are generated. Each list generated in steps S169-S171 is regarded as incompatible sub-information.
  • FIG. 34 is a flowchart (continuation 1) illustrating an example of a procedure for determining identity of incompatible information.
  • (S172) Identity determination section 126 selects one piece of incompatible sub-information. The identity determination unit 126 extracts pairs of search attributes and keywords from the selected incompatible sub-information.
  • the identity determination unit 126 counts the number of appearances for each search attribute+keyword, and generates a BOW vector listing the number of appearances or the appearance probability.
  • Identity determination section 126 calculates the similarity (similarity #1) of the BOW vector with registered incompatible information or incompatible sub-information (registered information).
  • the BOW vector of registered information may be stored in the incompatibility information storage unit 122 or may be generated here. Similarity #1 is, for example, cosine similarity.
  • the identity determination unit 126 determines whether the similarity #1 calculated in step S174 is greater than the threshold #1. If the similarity #1 is greater than the threshold #1, the process proceeds to step S183, and if the similarity #1 is less than or equal to the threshold #1, the process proceeds to step S181. If there is a plurality of pieces of registered information, and if the similarity #1 of at least one piece of registered information is greater than the threshold #1, the process proceeds to step S183.
  • the identity determination unit 126 calculates the degree of similarity (similarity #2) between the registered information and the keyword list generated in steps S183 to S194, which will be described later.
  • the keyword list of registered information may be stored in the incompatible information storage unit 122 or may be generated here. If there is a plurality of pieces of registered information, the pieces of registered information for which similarity #2 is calculated are limited to those whose similarity #1 is greater than threshold #1.
  • step S177 The identity determination unit 126 determines whether the similarity #2 calculated in step S176 is greater than the threshold #2. If the similarity #2 is greater than the threshold #2, the process proceeds to step S178, and if the similarity #2 is less than or equal to the threshold #2, the process proceeds to step S181. If there is a plurality of pieces of registered information, and if the degree of similarity #2 of at least one piece of registered information is greater than the threshold value #2, the process proceeds to step S178.
  • the identity determination unit 126 determines whether registered information having the same BOW vector and the same keyword list exists. If the corresponding registered information exists, the process proceeds to step S179, and if not, the process proceeds to step S180.
  • the identity determination unit 126 determines that the selected incompatible sub-information is not new information and cannot be registered. Then, the process proceeds to step S182.
  • Identity determination unit 126 outputs a similarity warning indicating that similar registered information exists. Similar registered information is registered information with similarity #2 greater than threshold #2. For example, the identity determination unit 126 sends similar warnings to the terminal devices 31 and 32 . Then, the process proceeds to step S182.
  • the identity determination unit 126 determines that the selected incompatible sub-information is new information and can be registered subject to the success of the automatic test and approval by the approver.
  • the identity determination unit 126 determines whether or not all incompatible sub-information has been selected in step S172. If all the incompatible sub-information have been selected, the incompatible information identity determination is terminated, and if there is unselected incompatible sub-information, the process returns to step S172. Note that if all the incompatible sub-information included in the incompatible information is determined to be new information, registration of the incompatible information may be permitted, and registration of each incompatible sub-information may be permitted. Further, when only a part of the incompatible sub-information included in the incompatible information is determined to be new information, registration of the incompatible sub-information determined to be new information may be permitted.
  • FIG. 35 is a flowchart (continued 2) showing an example of the procedure for determining the identity of incompatible information.
  • Identity determination unit 126 preferentially selects one instruction included in the incompatible sub-information from the beginning. The identity determination unit 126 determines whether the selected instruction is a FETCH instruction or a SEARCH instruction. If the selected instruction is a FETCH instruction or a SEARCH instruction, the process proceeds to step S184; otherwise, the process proceeds to step S192.
  • the identity determination unit 126 determines whether the selected instruction is the first FETCH instruction included in the incompatible sub-information. If it is the first FETCH instruction, the process proceeds to step S185, and if not the first FETCH instruction, the process proceeds to step S186.
  • the identity determination unit 126 sets the next position to insert the next node in the keyword list as the initial position. Then, the process proceeds to step S192.
  • the identity determination unit 126 determines whether the selected command is a command with vertical position + and with a keyword, or a command with vertical position - and horizontal position-. If the command satisfies the above conditions, the process proceeds to step S187, otherwise the process proceeds to step S188.
  • the identity determination unit 126 sets the next position in the keyword list to the left of the current node.
  • the current node is the existing node of current interest, typically the last node added to the keyword list. Then, the process proceeds to step S192.
  • the identity determination unit 126 determines whether the selected command is a vertical position - and a horizontal position + command. If the instruction satisfies the above conditions, the process proceeds to step S189, otherwise the process proceeds to step S190.
  • the identity determination unit 126 sets the next position in the keyword list to the right of the current node. Then, the process proceeds to step S192.
  • the identity determination unit 126 determines whether the selected command is a vertical position and horizontal position range designation command. If the instruction satisfies the above conditions, the process proceeds to step S191, otherwise the process proceeds to step S192.
  • the identity determination unit 126 sets the next position in the keyword list to the right of the existing node within the horizontal position range of the selected instruction.
  • Identity determination unit 126 determines whether the selected command includes a keyword. If the selected command contains the keyword, the process proceeds to step S193, and if the selected command does not include the keyword, the process proceeds to step S194.
  • Identity determination unit 126 generates a node containing the instruction number and keyword of the selected instruction, and inserts it in the next position set in steps S183-S191. (S194) The identity determination unit 126 determines whether or not all instructions included in the incompatible sub-information have been selected in step S183. If all instructions have been selected, the process proceeds to step S176, and if there are any unselected instructions, the process returns to step S183.
  • the information processing system of the second embodiment accumulates, as knowledge information, incompatibility information that defines procedures for absorbing incompatibility for source codes that use database products.
  • incompatibility information that defines procedures for absorbing incompatibility for source codes that use database products.
  • the information processing system can automate part or all of source code incompatibility absorption, and can streamline incompatibility absorption.
  • the information processing system provides the creator who creates the incompatible information with an editor that supports the creation of the incompatible information.
  • the editor displays a sample syntax tree of source code and automatically generates incompatibility information based on user manipulation of the syntax tree. Therefore, the burden of creating reusable incompatible information is reduced.
  • the information processing system executes an automatic test to confirm that the incompatible information operates normally. Therefore, the quality of accumulated incompatible information is improved. Further, the information processing system determines whether or not substantially the same incompatibility information from which the same incompatibility can be detected already exists before registering the incompatibility information in the knowledge database. Therefore, redundant registration of substantially the same incompatible information in the knowledge database is suppressed, and the search and management of the incompatible information are made efficient. In addition, the usage history of each piece of incompatible information is appropriately counted, and the evaluation of each piece of incompatible information is optimized.
  • the information processing system narrows down similar existing incompatible information using a BOW vector that indicates the appearance frequency of pairs of search attributes and keywords, and uses a keyword list that indicates the order of appearance of keywords to identify substantially identical existing information. It is finally determined whether the incompatible information exists. Therefore, even if two pieces of incompatible information have different descriptions due to different keyword search orders, substantial identity can be determined by detecting the same incompatible portion.
  • the information processing system narrows down the existing incompatible information using the BOW vector that does not consider the order of appearance of the keywords, and then evaluates the substantial identity based on the order of appearance of the keywords. Therefore, identity determination is efficiently executed.

Abstract

非互換情報の同一性を判定する。 記憶部(11)は、第1のソフトウェアを使用するソースコードの中から第2のソフトウェアと非互換である記述を探索するための情報であって、2以上の言語要素がもつキーワードと2以上の言語要素の位置関係とに対する条件を示す非互換情報(13)を記憶する。処理部(12)は、非互換情報(13)から2以上のキーワードを抽出し、同一のキーワードの出現頻度に基づく頻度情報(15)を生成し、位置関係の条件から推定される2以上のキーワードの出現順序を示す順序情報(17)を生成し、頻度情報(15)と非互換情報(14)に対応する頻度情報(16)との間の類似度と、順序情報(17)と非互換情報(14)に対応する順序情報(18)との間の類似度とに基づいて、非互換情報(13,14)の同一性を判定する。

Description

情報処理プログラム、情報処理方法および情報処理装置
 本発明は情報処理プログラム、情報処理方法および情報処理装置に関する。
 情報処理システムは、ソフトウェアベンダから提供されるソフトウェアを使用することがある。ソフトウェアの例として、DBMS(Database Management System)などのミドルウェアが挙げられる。情報処理システムで実行されるプログラムのソースコードは、提供されるソフトウェアの仕様に依存して作成されることがある。例えば、プログラムは、DBMSにSQL文を送信してデータベース操作機能を呼び出すなど、提供されるソフトウェアに対して要求を送信してソフトウェアの機能を呼び出すことがある。
 情報処理システムは、使用するソフトウェアを変更することがある。例えば、ソフトウェアベンダがバージョンアップを行った場合、情報処理システムが、使用するソフトウェアを新バージョンに更新することがある。また、例えば、情報処理システムが、他のソフトウェアベンダから提供される同種のソフトウェアに切り替えることがある。
 ただし、使用するソフトウェアを変更することによって、ソフトウェア間の非互換性に基づく不具合が既存プログラムに発生することがある。例えば、サポートしているSQL文の言語仕様など、要求を記述するための言語仕様が異なるために、既存プログラムから新ソフトウェアへの要求の送信にエラーが発生することがある。よって、使用するソフトウェアを変更することは、ソースコードの修正を伴う可能性がある。
 なお、異なる計算機にインストールされた同一種類の動的リンクライブラリの非互換性を、計算機間で動的リンクライブラリおよび障害メッセージを転送することで検出する計算機システムが提案されている。また、ユーザから開示情報を取得し、開示情報から閲覧価値を算出し、算出された閲覧価値に応じて、開示情報を提供したユーザに対して対価を付与する情報開示活性化システムが提案されている。また、API(Application Programming Interface)名の類似性と値域の類似性に基づいて、旧システムのAPIと新システムのAPIとの対応関係を判定するシステム移行支援装置が提案されている。
特開2001-100998号公報 特開2011-95856号公報 特開2012-113536号公報
 ソースコードの修正を支援する1つの方法として、コンピュータが、非互換性に基づく不具合が発生する可能性のある記述の特徴を規定した非互換情報を保存しておき、非互換情報に基づいてソースコードの中から非互換箇所を探索する方法が考えられる。
 ただし、非互換情報において規定される非互換箇所の特徴は、単一のキーワードのような単純な特徴であるとは限らず、2以上の言語要素の組み合わせに対する条件を示す複雑な特徴であることがある。そのため、2つの非互換情報が形式的には異なる記載を含んでいても、探索される非互換箇所が実質的には同一であるということが生じ得る。
 一方、複数の非互換情報を管理する上で、コンピュータは、ある非互換情報と他の非互換情報との間で実質的な同一性を判定したいことがある。そこで、1つの側面では、本発明は、非互換情報の同一性を判定することを目的とする。
 1つの態様では、以下の処理をコンピュータに実行させる情報処理プログラムが提供される。第1のソフトウェアを使用するソースコードの中から第2のソフトウェアと非互換である記述を探索するための情報であって、2以上の言語要素がもつキーワードと2以上の言語要素の位置関係とに対する条件を示す第1の非互換情報を取得する。第1の非互換情報から2以上のキーワードを抽出し、同一のキーワードの出現頻度に基づく第1の頻度情報を生成し、位置関係の条件から推定される2以上のキーワードの出現順序を示す第1の順序情報を生成する。第1の頻度情報と第2の非互換情報に対応する第2の頻度情報との間の第1の類似度と、第1の順序情報と第2の非互換情報に対応する第2の順序情報との間の第2の類似度とに基づいて、第1の非互換情報および第2の非互換情報の同一性を判定する。
 また、1つの態様では、コンピュータが実行する情報処理方法が提供される。また、1つの態様では、記憶部と処理部とを有する情報処理装置が提供される。
 1つの側面では、非互換情報の同一性を判定できる。
 本発明の上記および他の目的、特徴および利点は本発明の例として好ましい実施の形態を表す添付の図面と関連した以下の説明により明らかになるであろう。
第1の実施の形態の情報処理装置を説明するための図である。 第2の実施の形態の情報処理システムの例を示す図である。 情報処理装置のハードウェア例を示すブロック図である。 データベース製品の非互換吸収の流れの例を示す図である。 情報処理装置の機能例を示すブロック図である。 構文ツリーの第1の例を示す図である。 属性情報の例を示す図である。 構文テーブルの例を示す図である。 命令テーブルの例を示す図である。 非互換情報の第1の例を示す図である。 構文ツリーの第2の例を示す図である。 非互換情報の第2の例を示す図である。 非互換情報の第2の例を示す図(続き)である。 SQLプロシジャのソースコードの例を示す図である。 構文ツリーの第3の例を示す図である。 構文ツリーの第3の例を示す図(続き)である。 非互換情報の第3の例を示す図である。 エディタ画面の例を示す図である。 エディタ画面の第1の操作手順例を示す図である。 エディタ画面の第2の操作手順例を示す図である。 非互換情報のテストの例を示す図である。 非互換情報の第4の例を示す図である。 BOWベクトルテーブルの例を示す図である。 キーワードリストの第1の生成例を示す図である。 キーワードリストの第2の生成例を示す図である。 非互換サブ情報の抽出例を示す図である。 非互換情報の分割例を示す図である。 非互換情報生成の手順例を示すフローチャートである。 非互換情報生成の手順例を示すフローチャート(続き1)である。 非互換情報生成の手順例を示すフローチャート(続き2)である。 非互換情報生成の手順例を示すフローチャート(続き3)である。 非互換情報テストの手順例を示すフローチャートである。 非互換情報同一性判定の手順例を示すフローチャートである。 非互換情報同一性判定の手順例を示すフローチャート(続き1)である。 非互換情報同一性判定の手順例を示すフローチャート(続き2)である。
 以下、本実施の形態を図面を参照して説明する。
 [第1の実施の形態]
 第1の実施の形態を説明する。
 図1は、第1の実施の形態の情報処理装置を説明するための図である。
 第1の実施の形態の情報処理装置10は、あるソフトウェアに依存するソースコードの中から他のソフトウェアと非互換の記述を探索するための非互換情報を分析し、その非互換情報と他の非互換情報との実質的な同一性を判定する。同一性判定を通じて、情報処理装置10は、複数の非互換情報の蓄積および管理を支援すると共に、使用するソフトウェアを変更する際のソースコードの修正を支援する。情報処理装置10は、クライアント装置でもよいしサーバ装置でもよい。情報処理装置10が、コンピュータ、同一性判定装置、非互換情報管理装置、開発支援装置などと呼ばれてもよい。
 情報処理装置10は、記憶部11および処理部12を有する。記憶部11は、RAM(Random Access Memory)などの揮発性半導体メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性ストレージでもよい。処理部12は、例えば、CPU(Central Processing Unit)、GPU(Graphics Processing Unit)、DSP(Digital Signal Processor)などのプロセッサである。ただし、処理部12が、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路を含んでもよい。プロセッサは、例えば、RAMなどのメモリ(記憶部11でもよい)に記憶されたプログラムを実行する。プロセッサの集合が、マルチプロセッサまたは単に「プロセッサ」と呼ばれてもよい。
 記憶部11は、非互換情報13を記憶する。非互換情報13は、例えば、新規に作成されて知識データベースに保存されようとしている情報である。非互換情報13は、非互換情報13の作成者が使用する端末装置などの他の情報処理装置から受信されてもよい。
 非互換情報13は、第1のソフトウェアを使用するプログラムのソースコードの中から第2のソフトウェアと非互換である記述(非互換箇所)を探索するための知識を、一定の形式で表現した知識情報である。第1のソフトウェアは移行元のソフトウェアに相当し、第2のソフトウェアは移行先のソフトウェアに相当する。これら2つのソフトウェアは、ソフトウェアベンダから提供されるソフトウェア製品であってもよく、DBMSやWebサーバなどのミドルウェアであってもよい。また、2つのソフトウェアは、異なるソフトウェアベンダから提供される同種のソフトウェアでもよいし、同一のソフトウェアベンダから提供される異なるバージョンのソフトウェアでもよい。
 ソースコードは、ソフトウェアへの要求を示す要求メッセージを規定してもよい。要求メッセージはSQL文でもよく、ソースコードはSQLまたはSQLプロシジャ言語で記述されてもよい。2つのソフトウェアへの要求を記述するための言語は、類似しているものの同一でないことがある。例えば、2つのソフトウェアはそれぞれ、SQLなどの汎用的なクエリ言語をサポートする一方、クエリ言語を独自に拡張していることがある。
 非互換情報13は、ソースコードに含まれる非互換箇所の特徴を示す。非互換情報13は、ソースコードに含まれる2以上の言語要素の組み合わせについての条件を示す。言語要素は、文、節、句、語などの構文上の単位要素である。言語要素が構文要素と呼ばれてもよい。非互換情報13が示す条件を満たす2以上の言語要素が存在することは、ソースコードに非互換箇所が含まれることに相当する。
 非互換情報13が規定する条件には、2以上の言語要素に含まれる2以上のキーワードと、それら2以上の言語要素の間の位置関係とに対する条件が含まれる。位置関係は、ソースコードを構文解析することで生成される構文ツリーにおける位置関係であってもよい。非互換情報13は、条件を満たす2以上の言語要素を探索する手順を示す命令列を含んでもよい。例えば、非互換情報13は、あるキーワードをもつ第1の言語要素を検出し、第1の言語要素から特定の探索範囲内で、別のキーワードをもつ第2の言語要素を検出するという探索手順を示す命令列を含んでもよい。
 処理部12は、非互換情報13から頻度情報15および順序情報17を生成する。処理部12は、非互換情報13から2以上のキーワードを抽出し、それら2以上のキーワードそれぞれの出現頻度に基づく頻度情報15を生成する。出現頻度は、各キーワードの出現回数であってもよいし、非互換情報13のサイズに対する各キーワードの出現回数の割合である出現確率であってもよい。
 また、処理部12は、非互換情報13から同一の言語要素についてのキーワードと属性のペアを2以上抽出し、それら2以上のペアそれぞれの出現回数を示すように頻度情報15を生成してもよい。属性は、例えば、命令語やオブジェクト種別などの文法上の役割を含む。キーワードと併せて属性を抽出することで、キーワードが使用される文脈が考慮され、同一のキーワードがもつ複数の役割が区別される。この場合、出現頻度は、各ペアの出現回数であってもよいし、非互換情報13のサイズに対する各ペアの出現回数の割合である出現確率であってもよい。頻度情報15は、2以上の出現頻度を列挙したベクトルであってもよく、BOW(Bug of Words)ベクトルと呼ばれてもよい。
 また、処理部12は、非互換情報13が示す位置関係の条件から、ソースコードに上記の2以上のキーワードが出現する場合のソースコード上での出現順序を推定し、推定された出現順序を示す順序情報17を生成する。順序情報17は、2以上のキーワードを出現順に並べたキーワードリストであってもよい。処理部12は、第1の言語要素から第2の言語要素を探索する際の横方向の探索範囲を非互換情報13から抽出し、抽出された探索範囲から2つの言語要素に対応する2つのキーワードの前後関係を推定してもよい。
 処理部12は、非互換情報14に対応する頻度情報16および順序情報18を取得する。非互換情報14は、非互換情報13の前に作成された既存の非互換情報であってもよく、知識データベースに登録済みの非互換情報であってもよい。頻度情報16は頻度情報15と同様の方法で非互換情報14から生成されてもよく、順序情報18は順序情報17と同様の方法で非互換情報14から生成されてもよい。
 非互換情報14は記憶部11に記憶されてもよく、頻度情報16および順序情報18は記憶部11に記憶されてもよい。また、頻度情報16および順序情報18は、非互換情報13の検証の前に生成されて知識データベースに保存されていてもよいし、非互換情報13の検証の際に処理部12によって非互換情報14から生成されてもよい。
 処理部12は、頻度情報15と頻度情報16とを比較し、頻度情報15と頻度情報16との間の第1の類似度を算出する。第1の類似度は、コサイン類似度であってもよい。例えば、処理部12は、同一のキーワード毎または同一のキーワードと属性のペア毎に2つの出現頻度の積を算出して合算し、頻度情報15,16それぞれのノルムで割る。また、第1の類似度は、ユークリッド距離であってもよい。第1の類似度の指標値は、大きいほど類似度が高いことを意味してもよいしその逆でもよい。例えば、コサイン類似度は1が最大値であり、1に近いほど類似度が高いことを意味する。
 また、処理部12は、順序情報17と順序情報18とを比較し、順序情報17と順序情報18との間の第2の類似度を算出する。第2の類似度は、レーベンシュタイン距離などの編集距離であってもよい。例えば、処理部12は、順序情報17が示すキーワード列を順序情報18が示すキーワード列に変更するためのキーワード置換操作の最短回数を算出する。また、第2の類似度は、ユークリッド距離であってもよい。例えば、処理部12は、2つのキーワードの間の類似度を定義しておき、キーワードリストの中の同一の位置にあるキーワード同士の類似度の合計または平均を算出する。第2の類似度の指標値は、大きいほど類似度が高いことを意味してもよいしその逆でもよい。
 処理部12は、第1の類似度および第2の類似度に基づいて、非互換情報13,14の同一性を判定する。実質的に同一ではないことは新規性や一意性と呼ばれてもよい。非互換情報13,14は、2以上の言語要素の組み合わせに対する条件を規定するものであるため、同一の非互換箇所を探索するための異なる探索方法を規定している可能性がある。
 例えば、非互換情報13は、第1の言語要素を起点にして第2の言語要素を探索する探索方法を規定し、非互換情報14は、第2の言語要素を起点にして第1の言語要素を探索する探索方法を規定する。その場合、非互換情報13,14は実質的に同一であり、非互換情報13は非互換情報14に対して新規性を有していないことになる。このように、同一の非互換箇所の特徴を示す非互換情報が、異なる記載を含むことがある。
 例えば、処理部12は、第1の類似度と第1の閾値とを比較し、第2の類似度と第2の閾値とを比較する。処理部12は、第1の類似度が第1の閾値より大きく、かつ、第2の類似度が第2の閾値より大きい場合、非互換情報13,14が実質的に同一であると判定する。一方、処理部12は、第1の類似度が第1の閾値以下であるか、または、第2の類似度が第2の閾値以下の場合、非互換情報13,14が実質的に同一でないと判定する。
 処理部12は、まず第1の類似度と第1の閾値とを比較し、第1の類似度が第1の閾値より大きい場合、第2の類似度と第2の閾値とを比較してもよい。また、処理部12は、まず非互換情報13から頻度情報15を生成して第1の類似度を算出し、第1の類似度が第1の閾値より大きい場合、非互換情報13から順序情報17を生成してもよい。
 例えば、非互換情報13は、キーワード"TABLESPACE"を検出し、そのキーワードと同一の節に属するキーワード"CREATE"を探索し、そのキーワードの後続の句に含まれるキーワード"TABLE"を探索する手順を規定する。一方、非互換情報14は、キーワード"CREATE"を検出し、そのキーワードと同一の節に属する句に含まれるキーワード"TABLE"を探索し、その句の後続の句に含まれるキーワード"TABLESPACE"を探索する手順を規定する。
 その場合、非互換情報13,14は共に、キーワード"CREATE","TABLE","TABLESPACE"を1つずつ含む。このため、頻度情報15,16は同一である。また、非互換情報13,14における3つのキーワードの探索順序は異なるものの、探索範囲の条件から推定される3つのキーワードの順序は共に、"CREATE","TABLE","TABLESPACE"である。このため、順序情報17,18は同一である。そこで、処理部12は、非互換情報13と非互換情報14とが実質的に同一であると判定する。
 処理部12は、同一性の判定結果を出力してもよい。例えば、処理部12は、同一性の判定結果を不揮発性ストレージに保存してもよいし、表示装置に表示してもよいし、他の情報処理装置に送信してもよい。また、処理部12は、同一性の判定結果に基づいて、知識データベースへの非互換情報13の登録を制御してもよい。例えば、処理部12は、非互換情報13,14が実質的に同一でないと判定した場合、非互換情報13を新規の非互換情報として知識データベースに登録することを認める。一方、処理部12は、非互換情報13,14が実質的に同一であると判定した場合、非互換情報13の登録を拒否する。
 以上説明したように、第1の実施の形態の情報処理装置10は、非互換情報13から、2以上のキーワードの出現頻度に基づく頻度情報15と、それら2以上のキーワードの出現順序を示す順序情報17とを生成する。そして、情報処理装置10は、頻度情報15,16の類似度と順序情報17,18の類似度とに基づいて、非互換情報13,14の同一性を判定する。これにより、情報処理装置10は、非互換情報13,14の記載が異なっていても、非互換情報13,14が、ソースコードから同一の非互換箇所を検出する実質的に同一の非互換情報であるか否か判定することができる。
 よって、情報処理装置10は、実質的に同一の非互換情報が知識データベースに重複して登録されることを抑制でき、知識データベースの管理を効率化できる。また、情報処理装置10は、新規な非互換情報と実質的に新規でない非互換情報とを区別することができ、新規な非互換情報の価値を適切に評価することが可能となる。
 また、情報処理装置10は、キーワードの出現頻度に基づいて非互換情報13,14の類似度を評価する。キーワードの出現頻度は、非互換情報13から簡潔に算出することが可能である。よって、情報処理装置10は、非互換情報13,14の類似度を効率的に評価することができる。また、情報処理装置10は、キーワードの出現頻度に加えて、キーワードの出現順序に基づいて非互換情報13,14の類似度を評価する。よって、情報処理装置10は、語順の違いに基づく意味の違いを考慮でき、類似度の評価精度が上がる。
 例えば、"CREATE TABLE ... TABLESPACE ..."というSQL文と、"CREATE TABLESPACE ... TABLE ..."というSQL文とは、非互換性の観点から異なる特徴をもつと認定されることがある。この点、上記2つのSQL文を探索する2つの非互換情報では、キーワードの出現頻度が同一であるものの、これらキーワードの出現順序が異なる。そこで、情報処理装置10は、出現順序を考慮することで非互換情報の類似度を適切に評価できる。
 また、情報処理装置10は、キーワードの出現頻度に基づいて非互換情報13,14の類似度を評価し、第1段階の類似度が高い場合のみ、キーワードの出現順序に基づいて非互換情報13,14の類似度を評価することもできる。この場合、情報処理装置10は、非互換情報13,14の類似度を効率的に評価できる。また、情報処理装置10は、キーワードの出現頻度に基づいて非互換情報13と類似する可能性がある他の非互換情報を絞り込み、その後、キーワードの出現順序に基づいて非互換情報13と類似する他の非互換情報を判定することもできる。この場合、情報処理装置10は、非互換情報13と類似する他の非互換情報を効率的に抽出することができる。
 [第2の実施の形態]
 次に、第2の実施の形態を説明する。第2の実施の形態の情報処理システムは、データベース製品を使用するプログラムのソースコードを解析し、使用するデータベース製品を変更する際の修正作業を支援する。データベース製品の変更は、異なるソフトウェアベンダから提供されるデータベース製品の間の変更と、同一のソフトウェアベンダから提供される異なるバージョンの間の変更とを含む。データベース製品の間には非互換性が存在することがある。非互換性による不具合を解消するようにソースコードを修正することは、非互換吸収と呼ばれることがある。
 図2は、第2の実施の形態の情報処理システムの例を示す図である。
 第2の実施の形態の情報処理システムは、ネットワーク30に接続された端末装置31,32,33および情報処理装置100を含む。ネットワーク30は、LAN(Local Area Network)を含んでもよく、インターネットを含んでもよい。端末装置31,32,33は、ユーザが操作するクライアントコンピュータである。情報処理装置100は、端末装置31,32,33からアクセスされるサーバコンピュータである。情報処理装置100は、第1の実施の形態の情報処理装置10に対応する。
 端末装置31は、非互換情報を作成する作成者が使用するクライアントコンピュータである。非互換情報は、非互換吸収の業務に従事する複数の関係者によって共有される知識情報である。非互換情報は、ソースコードの中から非互換箇所を特定する特定方法と、特定された非互換箇所を非互換性が解消されるように書き換える書き換え方法とを規定する。端末装置31は、情報処理装置100と通信し、作成された非互換情報を情報処理装置100にアップロードする。後述するように、端末装置31は、情報処理装置100から提供されるエディタを用いて非互換情報の作成を支援することがある。
 端末装置32は、情報処理装置100にアップロードされた非互換情報を承認する承認者が使用するクライアントコンピュータである。端末装置31から情報処理装置100にアップロードされた非互換情報は、「プリペアード」状態に設定され、知識データベースへの正式な登録が保留される。プリペアード状態の非互換情報は、情報処理装置100による自動検証や承認者による承認を通じて、知識データベースに正式に登録される。承認者は、アップロードされた非互換情報のレビューやテスト実行などの検証作業を行い、非互換情報が正しく動作することや記載の妥当性を確認する。
 端末装置33は、情報処理装置100に蓄積された非互換情報を使用して非互換吸収を行う非互換吸収作業者が使用するクライアントコンピュータである。端末装置33は、変更前のデータベース製品と変更後のデータベース製品の組に対して有効な非互換情報を、情報処理装置100から検索して受信する。端末装置33は、変更前のデータベース製品に対応するソースコードに非互換情報を適用して、変更後のデータベース製品に適合するようにソースコードを自動的に変換する。
 情報処理装置100は、非互換情報を管理するサーバコンピュータである。情報処理装置100は、非互換情報の作成を支援するエディタのユーザインタフェースを、端末装置31に提供する。ただし、端末装置31は、エディタを使用せずに非互換情報を作成することも可能である。情報処理装置100は、非互換情報を端末装置31から受信する。すると、情報処理装置100は、受信された非互換情報をプリペアード状態に設定して自動検証を行う。自動検証には、サンプルソースコードおよびテストデータベースを用いた自動テストと、既存の非互換情報と実質的に同一であるか判定する同一性判定が含まれる。
 また、情報処理装置100は、端末装置32から承認メッセージを受信する。情報処理装置100は、自動検証が成功しかつ承認メッセージが受信された非互換情報のプリペアード状態を解除し、知識データベースに正式に登録する。また、情報処理装置100は、端末装置33からの要求に応じて、今回の非互換吸収作業に適合する非互換情報を知識データベースから検索し、該当する非互換情報を端末装置33に送信する。
 なお、変形例として、上記の機能の一部が端末装置31,32,33および情報処理装置100の間で移動されてもよい。例えば、非互換情報の作成を支援するエディタに相当するアプリケーションソフトウェアが、端末装置31にインストールされてもよい。その場合、情報処理装置100が端末装置31にエディタ機能を提供しなくてもよい。また、端末装置31が、非互換情報の自動検証を実行してもよい。また、端末装置31,32,33が、非互換情報の知識データベースの複製を保持してもよい。また、情報処理装置100が、端末装置33からの要求に応じて非互換吸収を実行してもよい。
 図3は、情報処理装置のハードウェア例を示すブロック図である。
 情報処理装置100は、バスに接続されたCPU101、RAM102、HDD103、GPU104、入力インタフェース105、媒体リーダ106および通信インタフェース107を有する。CPU101は、第1の実施の形態の処理部12に対応する。RAM102またはHDD103は、第1の実施の形態の記憶部11に対応する。端末装置31,32,33が、情報処理装置100と同様のハードウェアを有してもよい。
 CPU101は、プログラムの命令を実行するプロセッサである。CPU101は、HDD103に記憶されたプログラムおよびデータの少なくとも一部をRAM102にロードし、プログラムを実行する。情報処理装置100は、複数のプロセッサを有してもよい。プロセッサの集合が、マルチプロセッサまたは単に「プロセッサ」と呼ばれてもよい。
 RAM102は、CPU101で実行されるプログラムおよびCPU101で演算に使用されるデータを一時的に記憶する揮発性半導体メモリである。情報処理装置100は、RAM以外の種類の揮発性メモリを有してもよい。
 HDD103は、OS(Operating System)、ミドルウェア、アプリケーションソフトウェアなどのソフトウェアのプログラム、および、データを記憶する不揮発性ストレージである。情報処理装置100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の不揮発性ストレージを有してもよい。
 GPU104は、CPU101と連携して画像を生成し、情報処理装置100に接続された表示装置111に画像を出力する。表示装置111は、例えば、CRT(Cathode Ray Tube)ディスプレイ、液晶ディスプレイ、有機EL(Electro Luminescence)ディスプレイまたはプロジェクタである。なお、情報処理装置100に、プリンタなどの他の種類の出力デバイスが接続されてもよい。
 入力インタフェース105は、情報処理装置100に接続された入力デバイス112から入力信号を受け付ける。入力デバイス112は、例えば、マウス、タッチパネルまたはキーボードである。情報処理装置100に複数の入力デバイスが接続されてもよい。
 媒体リーダ106は、記録媒体113に記録されたプログラムおよびデータを読み取る読み取り装置である。記録媒体113は、例えば、磁気ディスク、光ディスクまたは半導体メモリである。磁気ディスクには、フレキシブルディスク(FD:Flexible Disk)およびHDDが含まれる。光ディスクには、CD(Compact Disc)およびDVD(Digital Versatile Disc)が含まれる。媒体リーダ106は、記録媒体113から読み取られたプログラムおよびデータを、RAM102やHDD103などの他の記録媒体にコピーする。読み取られたプログラムは、CPU101によって実行されることがある。
 記録媒体113は、可搬型記録媒体であってもよい。記録媒体113は、プログラムおよびデータの配布に用いられることがある。また、記録媒体113およびHDD103が、コンピュータ読み取り可能な記録媒体と呼ばれてもよい。
 通信インタフェース107は、ネットワーク30に接続され、ネットワーク30を介して端末装置31,32,33と通信する。通信インタフェース107は、スイッチやルータなどの有線通信装置に接続される有線通信インタフェースでもよいし、基地局やアクセスポイントなどの無線通信装置に接続される無線通信インタフェースでもよい。
 次に、情報処理システムによる非互換吸収の流れを説明する。
 図4は、データベース製品の非互換吸収の流れの例を示す図である。
 情報処理システムは、変更前のデータベース製品に依存するソースコード131を取得する。ソースコード131は、SQL文またはSQLプロシジャコードを含む。SQL文は、SQLを用いて記述されたデータベースクエリである。SQLの基本仕様は標準化されているものの、データベース製品によっては基本仕様を拡張した独自仕様をもつことがある。SQLプロシジャコードは、SQLと整合するように規定された手続き型言語のプログラムであり、ストアドプロシジャとして動作する。
 情報処理システムは、ソースコード131の構文解析を行い、構文ツリー132を生成する。構文ツリー132は、文、節、句、語などの言語要素の構造を示すツリー型データである。構文解析を通じて生成される構文ツリー132は、字句解析のみを行う場合と異なり、ソースコード131において各語が出現する文脈を表現できる。例えば、SQL文やSQLプロシジャコードでは、同じ変数であっても、変数が記述される位置によって変数の有効範囲が異なることがある。そのため、非互換吸収では構文ツリー132が有用である。ただし、情報処理システムはソースコード131の意味解析を行わなくてよく、構文ツリー132は言語要素の論理的意味を示す意味情報を含まなくてよい。
 情報処理システムは、変更前のデータベース製品と変更後のデータベース製品との組に対応付けられた非互換情報133を、知識情報として保持している。データベース製品は、製品名とバージョン番号の組で識別され得る。非互換情報133は、特定命令の列と書換命令の列とを含む。特定命令は、変更前のデータベース製品では正常に動作するものの変更後のデータベース製品では不具合が発生するおそれがある非互換箇所を、構文ツリー132の中から特定するための命令である。書換命令は、特定命令によって特定された非互換箇所について、変更後のデータベース製品において不具合が発生しないように構文ツリー132を書き換えるための命令である。
 情報処理システムは、構文ツリー132に対して、非互換情報133に含まれる特定命令を実行する。特定命令によって構文ツリー132の中から非互換箇所が検出された場合、情報処理システムは、構文ツリー132に対して、非互換情報133に含まれる書換命令を実行して非互換吸収を行う。これにより、非互換性が解消されるように構文ツリー132が書き換えられる。情報処理システムは、書き換え後の構文ツリー132からソースコード134を生成する。ソースコード134は、ソースコード131に対して非互換吸収を行った結果であり、変更後のデータベース製品用のソースコードである。
 図5は、情報処理装置の機能例を示すブロック図である。
 情報処理装置100は、サンプルコード記憶部121および非互換情報記憶部122を有する。これらの記憶部は、例えば、RAM102またはHDD103を用いて実装される。また、情報処理装置100は、エディタ123、登録部124、テスト部125、同一性判定部126および検索部127を有する。これらの処理部は、例えば、CPU101およびプログラムを用いて実装される。
 サンプルコード記憶部121は、変換前のソースコードのサンプルを記憶する。ソースコードは、SQL文またはSQLプロシジャコードを含む。ソースコードは、非互換情報の作成者によって作成され、端末装置31から情報処理装置100にアップロードされる。エディタ123を利用して非互換情報を作成する際に、端末装置31からソースコードが提供されることがある。また、非互換情報を情報処理装置100に登録する際に、非互換情報と併せてソースコードが端末装置31から提供されることがある。
 エディタ123を利用する際に提供されるソースコードと、非互換情報を登録する際に提供されるソースコードとは、同一でもよいし異なってもよい。また、サンプルコード記憶部121は、変換後のソースコードを変更後のデータベース製品で実行した場合に期待される正解の実行結果を記憶することがある。正解の実行結果は、例えば、ソースコードに含まれるSQL文またはSQLプロシジャコードによって生成されるテーブルを示す。正解の実行結果は、非互換情報を登録する際に、非互換情報および変換前のソースコードと併せて端末装置31から提供されることがある。
 非互換情報記憶部122は、非互換情報を蓄積する知識データベースである。非互換情報は、データベース製品間の非互換吸収に関する技術的ノウハウを示す知識情報である。非互換情報は、構文ツリーから非互換箇所を特定する手順を示す特定命令と、特定された非互換箇所を書き換える手順を示す書換命令とを含む。後述するように、非互換情報は、再利用可能な単位として複数の非互換サブ情報を含むことがある。
 各非互換情報は、変更前のデータベース製品と変更後のデータベース製品の組に対応付けられる。非互換情報記憶部122は、変更前のデータベース製品と変更後のデータベース製品の組から、利用可能な非互換情報を検索するための管理情報を記憶してもよい。端末装置31からアップロードされた非互換情報は、まずプリペアード状態に設定される。プリペアード状態の非互換情報は、テスト部125および同一性判定部126による自動検証と承認者による承認とを通じて有用性が確認された後に、プリペアード状態が解除されて非互換情報記憶部122に正式に登録される。
 エディタ123は、非互換情報を効率的に作成するためのグラフィカルユーザインタフェースを提供し、端末装置31による非互換情報の作成を支援する。エディタ123は、端末装置31から変換前のソースコードのサンプルを取得する。エディタ123は、ソースコードを構文解析して構文ツリーを生成し、生成された構文ツリーを端末装置31の表示装置に表示させる。エディタ123は、構文ツリーに含まれる2以上のノードを順に選択する操作や一部のノードを書き換える操作を端末装置31から受信する。エディタ123は、受信した操作に基づいて、非互換情報の特定命令および書換命令を順に生成し、自動的に生成された非互換情報を端末装置31に送信する。
 登録部124は、非互換情報および変換前のソースコードのサンプルを端末装置31から受信する。登録部124は、変更後のデータベース製品における正解の実行結果を端末装置31から更に受信してもよい。非互換情報は、エディタ123を利用して作成されたものでもよいし、エディタ123を利用せずに作成されたものでもよい。ソースコードは、エディタ123で使用されたものと同じでもよい。
 登録部124は、受信された非互換情報をプリペアード状態に設定し、非互換情報記憶部122に仮登録する。また、登録部124は、受信されたソースコードをサンプルコード記憶部121に保存し、正解の実行結果が提供された場合は正解の実行結果をサンプルコード記憶部121に保存する。そして、登録部124は、テスト部125に非互換情報の自動テストを要求し、同一性判定部126に非互換情報の同一性判定を要求する。自動テストおよび同一性判定は、バックグラウンド処理としてスケジュールされる。また、登録部124は、端末装置32に非互換情報の承認の要求を送信する。
 登録部124は、自動テストの結果をテスト部125から取得し、同一性判定の結果を同一性判定部126から取得し、承認者の承認結果を端末装置32から受信する。自動テストの結果は、非互換情報が正常に動作するか否かを示す。同一性判定の結果は、非互換情報が他の非互換情報と実質的に同一ではないという新規性を有しているか否かを示す。承認結果は、承認者が非互換情報を承認したか否かを示す。登録部124は、非互換情報が正常に動作し、新規性を有しており、かつ、承認者によって承認された場合、非互換情報のプリペアード状態を解除する。
 テスト部125は、プリペアード状態の非互換情報をテストする。テスト部125は、変換前のソースコードのサンプルに非互換情報を適用して変換後のソースコードを生成する。テスト部125は、変更後のデータベース製品に相当するテストデータベースを用いて、変換後のソースコードに含まれるSQL文またSQLプロシジャコードを実行する。テストデータベースは、情報処理装置100にインストールされていてもよいし、他の情報処理装置にインストールされていてもよい。
 テスト部125は、テストデータベースから実行結果を抽出して正解の実行結果と比較する。テスト部125は、今回の実行結果と正解の実行結果が一致する場合、テスト成功であり非互換情報が正常に動作すると判定する。一方、テスト部125は、今回の実行結果と正解の実行結果が一致しない場合、テスト失敗であり非互換情報が正常に動作しないと判定する。ただし、正解の実行結果が端末装置31から提供されていない場合、テスト部125は、テストデータベースにおける実行結果を端末装置31に送信し、今回の実行結果が正常であるか否かを示す評価結果を端末装置31から受信する。
 同一性判定部126は、プリペアード状態の非互換情報が、非互換情報記憶部122に登録されている既存の非互換情報と実質的に同一であるか否か判定する。プリペアード状態の非互換情報と既存の非互換情報とが同一の特定命令をもつ場合、両者は同一の非互換性を解消するための知識情報であり、プリペアード状態の非互換情報は新規性を有しない。また、プリペアード状態の非互換情報と既存の非互換情報とが異なる特定命令をもつ場合であっても、構文ツリー上で探索される非互換箇所が同一である場合、両者は同一の非互換性を解消するための知識情報であり、プリペアード状態の非互換情報は新規性を有しない。同一性判定の詳細については後述する。
 検索部127は、端末装置33からの要求に応じて、非互換情報記憶部122から非互換情報を読み出して端末装置33に送信する。例えば、検索部127は、変更前のデータベース製品と変更後のデータベース製品の指定を端末装置33から受け付ける。検索部127は、指定されたデータベース製品の組に対応付けられた非互換情報を非互換情報記憶部122から検索し、検索された非互換情報を端末装置33に提供する。
 次に、構文ツリーおよび非互換情報について説明する。
 図6は、構文ツリーの第1の例を示す図である。
 ここで、SQL文の構文について説明する。文は末尾に終端記号を含む。文は終端記号の前に節を含むことがある。節は先頭に命令語を含み、命令語と終端記号の間に句、式または語を含む。句は先頭にオブジェクト種別、前置詞、副詞または括弧を含む。句は続いて句、式または語を含み、句、式または語が2回以上連続することがある。句は続いて節を含むことがある。式は関数名または語を含み、続いて演算子を含む。
 終端記号は、文の終端を表す。終端記号は、セミコロン(「;」)であることがある。語は、文の中で意味をもつ最小の言語単位である。語には、識別子、予約語、関数名および演算子が含まれる。予約語には、命令語、オブジェクト種別およびその他の予約語が含まれる。命令語は、CREATEやUPDATEなどの命令を示す。オブジェクト種別は、TABLEなどのオブジェクトの種類を示す。その他の予約語は、BEGINなど、命令語およびオブジェクト種別以外の予約語である。式には、演算子によって結合された語と語の組や、演算子によって結合された語と式の組が含まれる。また、式には、関数名と引数の組が含まれる。引数は、開括弧(「(」)と閉括弧(「)」)に挟まれる。
 句には、一般句、述語句、接尾句、定義句および未分類句が含まれる。一般句は、修飾語と目的語の組である。例えば、TABLE T1のように、オブジェクト種別と識別子の組は一般句である。述語句には、FROM T1やAS T2のように、前置詞と目的語の組が含まれる。また、述語句には、WHERE C1のように、副詞と目的語の組が含まれる。接尾句は、開括弧と閉括弧とで挟まれており、データ型の指定やキーカラムの指定に使用され得る。定義句は、変数の型を指定する言語要素であり、予約語以外の語とデータ型を示す予約語とを含む。未分類句は、一般句、述語句、接尾句および定義句の何れにも該当しない句である。
 なお、構文ツリーの例では、終端記号が「終」、一般句が「句」、述語句が「述」、接尾句が「接」、定義句が「定」、未分類句が「未」と記載されることがある。
 構文ツリー151は、ソースコード141の構文を示す。ソースコード141は、CREATE TABLE T1(C1 CHAR(10), C2 NUMERIC(3,1), PRIMARY KEY(C1,C2)) TABLESPACE SPC1;というSQL文を含む。構文ツリー151は、ツリー構造の無向グラフである。構文ツリー151は、それぞれ言語要素を示す複数のノードと、それら複数のノードをツリー構造に結合する複数のエッジとを含む。上位ノードと下位ノードとの間のエッジは、下位ノードに対応する言語要素が、上位ノードに対応する言語要素に包含されることを表す。同一レベル内では、複数の言語要素の出現順序が保持される。左ノードに対応する言語要素は、右ノードに対応する言語要素よりも先に出現する。
 構文ツリー151は、ノード151a,151b,151c,151dを含む。ノード151aは、節に含まれる2番目の句のオブジェクト種別を表し、TABLESPACEという文字列に対応する。ノード151bは、節の先頭の命令語を表し、CREATEという文字列に対応する。ノード151cは、節に含まれる1番目の句のオブジェクト種別を表し、TABLEという文字列に対応する。ノード151dは、節に含まれる2番目の句を表す。ノード151aは、ノード151dの1番目の子ノードである。なお、各ノードは言語要素の種別や値などの属性をもつ。構文ツリーの表示例では、一部の属性のみが表示されている。
 図7は、属性情報の例を示す図である。
 属性情報171は、構文ツリーの1つのノードに対応付けられる。属性情報171は、位置情報、分類、分類属性、種別、値、値属性および行番号を含む。ただし、ノードの種別によって、一部の項目の項目値が定義されないことがある。
 位置情報は、構文ツリー内でのノードの位置を示す。後述するように、ノードの位置は、縦位置と横位置を含む二次元座標で表現され得る。分類は、文、節、句、式、語などの最上位の分類を示す。分類属性は、一般ノードと補完ノードの区別を示す。一般ノードは、ソースコードの記述から直接的に抽出された言語要素を示す。補完ノードは、ソースコードに明示的に記述されていないものの解釈上補完された言語要素を示す。種別は、一般句や命令語など、上記の分類を更に細分化したグループである。値は、語の文字列である。値属性は、値の種別である。値属性には、一般文字列と補完文字列が含まれる。行番号は、ノードに対応する言語要素がソースコードの中で出現する行の番号である。
 構文ツリーは、二次元表形式の構文テーブルとして表現され得る。これにより、ノードの位置の特定が容易となり、ノードの識別やノード探索の手順の記述が容易となる。構文ツリーの各ノードは、以下のような規則で構文テーブルに配置される。
 図8は、構文テーブルの例を示す図である。
 構文テーブル172は、図6の構文ツリー151と同等の構文テーブルである。構文テーブル172の左上のセルの位置座標が(1,1)である。下に進むほど縦位置を示す行番号が大きくなり、右に進むほど横位置を示す列番号が大きくなる。各セルの位置座標は(行番号,列番号)として定義される。
 文を示すノードは、構文テーブル172の左上のセルに配置される。あるノードの直下にある子ノードのうち最も左側の子ノードは、当該ノードに対応するセルの1つ下のセルに配置される。1つ下のセルは、行番号が1つ大きく列番号が同じセルである。あるノードと同じ親ノードをもつ他のノードであって当該ノードより右側にある他のノードは、当該ノードに対応するセルの右側のセルに配置される。右側のセルは、行番号が同じであり列番号が大きいセルである。各ノードが配置されるセルは、深さ優先順に決定される。
 1つの列には、構文ツリーに含まれる1つの語のノードが配置される。よって、親子関係にある2つのノードの行番号は連続する一方、同一の親ノードをもつ2つのノードの列番号は不連続であることがある。これにより、ソースコード141に含まれる29個の語に対応する語ノードが、構文テーブル172の第1列から第29列に順序を保持して配置される。構文テーブル172と構文ツリー151とは、相互に変換可能である。
 非互換情報は、構文ツリーの上で条件を満たすノードを探索する1以上の特定命令と、構文ツリーに含まれる一部のノードを書き換える1以上の書換命令とを含む。
 図9は、命令テーブルの例を示す図である。
 命令テーブル173は、非互換情報で使用され得る命令の定義を示す。命令テーブル173の1つのレコードが1つの命令を示す。命令テーブル173の1つのレコードは、命令、縦位置、横位置、探索属性およびキーワードを含む。
 縦位置、横位置、探索属性およびキーワードは、命令の引数である。縦位置は、着目する現ノードと対象ノードとの間の上下方向の位置関係に対する条件である。+は上方向を示し、-は下方向を示し、nは現ノードからの距離を示し、*は距離制限なしを示す。横位置は、着目する現ノードと対象ノードとの間の左右方向の位置関係に対する条件である。=は現ノードと同じ横位置を示し、+は右方向を示し、-は左方向を示し、nは現ノードからの距離を示し、*は距離制限なしを示す。
 横位置は[命令番号]というフォーマットで指定されることがある。これは、その命令番号をもつ命令で選択されたノードの横位置を始点として探索を行うことを示す。また、横位置は[命令番号1:命令番号2]というフォーマットで指定されることがある。これは、命令番号1をもつ命令で選択されたノードの横位置と、命令番号2をもつ命令で選択されたノードの横位置との間を探索することを示す。探索属性は、対象ノードがもつ分類、分類属性、種別および値属性に対する条件である。
 キーワードは、ノードを特定するための探索属性以外の情報である。キーワードは、語の値としての識別子であることがある。また、キーワードとして、実行済みの命令の命令番号が指定されることがある。これは、その命令によって特定されたノードを再選択することを示す。また、命令の結果が真である場合、すなわち、条件を満たすノードが存在する場合に実行されるアクションが、命令に付随して規定され得る。
 アクションなしは、次の命令に進むことを示す。RETは、次の命令を実行し、次の命令の結果が偽である場合に当該命令に戻ることを示す。NEXT[命令番号]は、指定された命令番号の命令にジャンプすることを示す。また、着目する現ノードの属性情報を利用した他の命令そのものが、アクションとして規定されることがある。
 命令には、FETCH,SEARCH,POP,GET PRM,SET PRM,!,DELETE,CREATE,MODIFYが含まれる。FETCH,SEARCH,POP,GET PRM,SET PRM,!は、特定命令として使用され得る。DELETE,CREATE,MODIFYは、書換命令として使用され得る。
 FETCHは、条件を満たすノードを探索し、着目する現ノード(カレントノード)を、検出されたノードに変更する命令である。SEARCHは、条件を満たすノードを探索するものの、現ノードを変更しない命令である。POPは、現ノードを、実行済みのFETCHによって選択されたノードに戻す命令である。GET PRMは、条件を満たすノードの属性情報をスタックに保存する命令である。SET PRMは、スタックに保存された属性情報を出力する命令である。SET PRMは、FETCHまたはSEARCHのキーワードの中で使用されることがある。!は、真偽を反転する否定命令である。SEARCHの前に!を付加することで、条件を満たすノードが検出されない場合に命令の結果が真と判定される。
 DELETEは、現ノードを基準にして指定範囲のノードを構文ツリーから削除する命令である。CREATEは、現ノードの前または後に部分ツリーを挿入する命令である。挿入される部分ツリーは、命令列とは別にCREATE情報として保存されている。CREATEは、CREATE情報を識別するCREATE情報番号を含むキーワードを引数としてもつ。MODIFYは、現ノードの属性情報を書き換える命令である。アクションでは正規表現プログラムが指定され得る。
 通常、非互換情報は、非互換箇所に関する最も特徴的なキーワードを最初に検索する。最初のキーワードはアンカーと呼ばれることがあり、構文ツリーからのアンカーの検索はアンカーサーチと呼ばれることがある。非互換情報は、構文ツリーにおけるアンカーの周辺から、属性が特定の条件を満たす周辺ノードを検索する。これにより、非互換箇所を形成するノード集合が特定される。非互換箇所の特徴は一意条件と呼ばれることがある。構文ツリーの中から非互換箇所が特定されると、非互換情報は、検出済みの何れかのノードを基点として、書き換えるノードを特定する。基点はアンカーであることがある。
 図10は、非互換情報の第1の例を示す図である。
 非互換情報161は、図6の構文ツリー151に適用される非互換情報の例である。ここでは、ソースコード141に含まれるTABLESPACE SPC1が変更後のデータベース製品と非互換であり、TABLESPACE SPC1を削除することで非互換性が解消される場合を考える。非互換情報161の1つのレコードは、1つの特定命令または1つの書換命令に対応する。非互換情報161の各レコードは、命令番号、命令属性、命令、縦位置、横位置、探索属性、キーワードおよびアクションを含む。
 命令番号は、命令の実行順序を示す昇順の自然数である。命令属性は、特定命令と書換命令の区別を示す。縦位置、横位置、探索属性およびキーワードは、命令の引数である。アクションは、命令の結果が真である場合に実行される処理を示す。非互換情報161は、第1命令から第8命令までの8個の命令を含む。第1命令から第5命令までは特定命令であり、第6命令から第8命令までは書換命令である。
 第1命令は、構文ツリー151の中から、種別がオブジェクト種別であり値がTABLESPACEであるノード151aを検索し、現ノードとして選択する。第2命令は、縦位置が現ノードより上であり横位置が現ノードより左であり、分類が節であるノードであって現ノードに最も近いノードを検索し、現ノードとして選択する。第3命令は、現ノードの直下のノードであって、種別が命令語であり値がCREATEであるノード151bを検索する。第4命令は、縦位置が現ノードの1つ下であり、横位置がCREATEとTABLESPACEの間であり、分類が句であるノードを検索し、現ノードとして選択する。
 第5命令は、現ノードの直下のノードであって、種別がオブジェクト種別であり値がTABLEであるノード151cを検索する。第5命令の結果が偽である場合は第4命令に戻る。第6命令は、第1命令で選択されたTABLESPACEのノード151aに現ノードを戻す。第7命令は、現ノードの直上のノードであって分類が句であるノード151dを検索し、現ノードとして選択する。第8命令は、現ノードおよびその配下のノードを削除する。
 第1命令から始めて末尾の特定命令である第5命令まで到達した場合、構文ツリー151が非互換箇所を含むと判定される。そして、特定命令の結果を用いて、特定命令に続けて書換命令が実行される。ただし、情報処理システムは、非互換情報161に含まれる命令のうち特定命令のみを実行し、検出された非互換箇所の情報を出力してもよい。
 図11は、構文ツリーの第2の例を示す図である。
 構文ツリー152は、ソースコード142の構文を示す。ソースコード142は、SELECT CAST(C1 AS NUMBER) FROM T1 AS TBL1 WHERE EXISTS(SELECT 1 FROM T2 AS TBL2 WHERE TBL1.C2=CAST(TBL2.C2 AS NUMBER));というSQL文を含む。このSQL文は、WHERE EXISTS以下に副問い合わせを含んでおり、複雑な構文をもつ。構文ツリー152は、ノード152a,152bを含む。ノード152aは、主問い合わせに含まれる式の中のデータ型を表し、NUMBERという文字列に対応する。ノード152bは、副問い合わせに含まれる式の中のデータ型を表し、NUMBERという文字列に対応する。
 図12は、非互換情報の第2の例を示す図である。
 非互換情報162は、図11の構文ツリー152に適用される非互換情報の例である。ここでは、ソースコード142に含まれるデータ型NUMBERが変更後のデータベース製品と非互換であり、NUMBERをNUMERICに置換することで非互換性が解消される場合を考える。
 非互換情報162は、第1命令から第19命令までの19個の命令を含む。第1命令から第4命令までは、1つ目のデータ型を探索するための特定命令であり、第5命令から第6命令までは、1つ目のデータ型を書き換えるための書換命令である。第7命令から第17命令までは、2つ目のデータ型を探索するための特定命令であり、第18命令から第19命令までは、2つ目のデータ型を書き換えるための書換命令である。
 第1命令は、構文ツリー152の中から、種別が命令語であり値がSELECTであるノードを検索し、現ノードとして選択する。第2命令は、縦位置が現ノードより上であり、分類が節であるノードを検索し、現ノードとして選択する。第3命令は、縦位置が現ノードの1つ下であり、横位置が第1命令のSELECTより右であり、分類が式であるノードを検索し、現ノードとして選択する。第4命令は、縦位置が現ノードの1つ下であり、横位置が現ノードより右であり、種別がデータ型であり値がNUMBERであるノード152aを検索し、現ノードとして選択する。第4命令の結果が偽である場合は第3命令に戻る。
 第5命令は、現ノードを削除する。第6命令は、種別がデータ型であり値がNUMERICである新たなノードを生成し、削除されたノードの位置に挿入する。
 図13は、非互換情報の第2の例を示す図(続き)である。
 第7命令は、第1命令で選択されたSELECTのノードに現ノードを戻す。第8命令は、縦位置が現ノードの1つ下であり、種別が述語句であるノードを検索し、現ノードとして選択する。第9命令は、縦位置が現ノードの1つ下であり、横位置が現ノードより右であり、分類が式であるノードを検索し、現ノードとして選択する。第9命令の結果が偽である場合は第8命令に戻る。第10命令は、縦位置が現ノードの1つ下であり、横位置が現ノードより右であり、種別が接続句であるノードを検索し、現ノードとして選択する。第10命令の結果が偽である場合は第9命令に戻る。
 第11命令は、縦位置が現ノードの1つ下であり、横位置が現ノードより右であり、分類が節であるノードを検索し、現ノードとして選択する。第11命令の結果が偽である場合は第10命令に戻る。第12命令は、縦位置が現ノードの1つ下であり、種別が命令語であり値がSELECTであるノードを検索する。第12命令の結果が偽である場合は第11命令に戻る。第13命令は、第12命令のSELECTの上にあり、分類が節であるノードを検索し、現ノードとして選択する。第13命令の結果が偽である場合は第12命令に戻る。
 第14命令は、縦位置が現ノードの1つ下であり、横位置が第11命令の節より右であり、種別が述語句であるノードを検索し、現ノードとして選択する。第15命令は、縦位置が現ノードの1つ下であり、横位置が第12命令のSELECTより右であり、分類が式であるノードを検索し、現ノードとして選択する。第15命令の結果が偽である場合は第14命令に戻る。第16命令は、縦位置が現ノードの1つ下であり、横位置が第13命令の節より右であり、分類が式であるノードを検索し、現ノードとして選択する。第16命令の結果が偽である場合は第15命令に戻る。
 第17命令は、縦位置が現ノードの1つ下であり、横位置が第14命令の述語句より右であり、種別がデータ型であり値がNUMBERであるノード152bを検索し、現ノードとして選択する。第17命令の結果が偽である場合は第16命令に戻る。第18命令は、現ノードを削除する。第19命令は、種別がデータ型であり値がNUMERICである新たなノードを生成し、削除されたノードの位置に挿入する。
 図14は、SQLプロシジャのソースコードの例を示す図である。
 ここで、SQLプロシジャコードの構文について説明する。データベース製品は、ユーザプログラムが複雑なデータ処理を簡潔に要求できるように、一纏まりのデータ処理を記述するためのSQLプロシジャ言語を定義していることがある。ただし、SQLプロシジャ言語は、SQLと類似する文法をもつことが多い。そこで、情報処理装置100は、SQLプロシジャ言語に特有の言語要素を追加した上で、SQLの構文とSQLプロシジャ言語の構文とを包含する共通の構文規則を定義する。
 SQLプロシジャコードは、前述のSQLの言語要素に加えて、制御文、セクション、ブロックおよびモジュールを言語要素として含む。制御文は、条件分岐やループなどの制御構造を表す文である。制御文は、IF,WHEN,IN,THEN,ELSE,END IF,LOOP,END LOOPなどの制御用の語または句を含む。セクションは、特定のキーワードによって挟まれるソースコード内の領域であり、ブロックに包含される。セクションの開始または終了を示す語には、DECLARE,BEGIN,EXCEPTION,END,AS,ISなどが含まれる。
 ブロックは、セクションまたはブロックを1つ以上含むソースコード内の領域である。ブロックには、FUNCTIONブロック、PROCEDUREブロック、ブロック名が付与されていない無名ブロックなどが含まれる。モジュールは、ソースコード全体を表す単位である。1つのモジュールは、物理的な1つのファイルに対応する。ソースコードの言語種別は、ファイル名の拡張子またはソースコードの先頭の宣言に基づいて判別される。言語種別は、SQLまたはSQLプロシジャ言語である。
 制御文、セクション、ブロックおよびモジュールの境界は、特定のキーワードによって判定される。ただし、ソースコードの末尾にはEOF(End Of File)が含まれているとみなす。例えば、ソースコードの中から、IFからEND IFまでの領域やDECLAREからBEGINまでの領域が抽出される。構文ツリーにおいて、制御文、セクション、ブロックまたはモジュールを表すノードには、領域の先頭のキーワードが割り当てられる。当該ノードの配下には、次のキーワードが現れる前までの言語要素が展開される。
 ソースコード143は、SQLプロシジャコードを含む。ソースコード143は、空行も含めて19行のソースコードである。1行目のASは、セクションの開始を示すキーワードである。ただし、ASの前の文字列が文として完結していない。そこで、情報処理システムは、ASの直前に終端記号を補完して1つの文として解釈する。3行目のv VARCHAR(50)は定義句であるものの、命令語を含む節の一部として使用されていない。そこで、情報処理システムは、定義句を包含する節がソースコードに明示的に出現しない場合、DECLAREという命令語が省略されていると解釈する。
 5行目のFUNCTIONは、ブロックの開始を示すキーワードである。5行目のRETURN NUMBERは、命令語に続く句を含んでいない。そこで、情報処理システムは、データ型の後にTBD(To Be Determined)を補完し、データ型と値とを含む句が命令語の後に続いている節であると解釈する。8行目のBEGINは、セクションの開始を示すキーワードである。10行目のRETURN d;は、命令語に続く句を含んでいない。そこで、情報処理システムは、データ型が規定済みであることを示すEST(Established)を補完し、データ型と値とを含む句が命令語の後に続いている節であると解釈する。
 11行目のENDは、セクションの区切りを示すキーワードである。ただし、ENDの後に、FUNCTIONブロックの名称と終端記号が続いている。そこで、情報処理システムは、ENDセクションの中にEND命令を含む節が省略されていると解釈し、そのような節を補完する。また、情報処理システムは、ESTを補完し、データ型とFUNCTIONの名称とを含む句がEND命令の後に続いていると解釈する。13行目のPROCEDUREは、ブロックの開始を示すキーワードである。情報処理システムは、15行目のBEGIN、17行目のEND protestおよび19行目のEND ptest;についても、上記と同様に解釈する。
 図15は、構文ツリーの第3の例を示す図である。
 構文ツリー153は、ソースコード143の構文を示す。構文ツリー153は、ノード153a,153b,153c,153d,153e,153fを含む。ノード153aは、ソースコード143の1行目から始まるASセクションを表す。ノード153bは、ソースコード143の3行目に補完された命令語DECLAREを表す。ノード153cは、ソースコード143の3行目に記載された変数vを表す。ノード153dは、ソースコード143の5行目から始まるFUNCTIONブロックを表す。
 図16は、構文ツリーの第3の例を示す図(続き)である。
 ノード153eは、ソースコード143の13行目から始まるPROCEDUREブロックを表す。ノード153fは、ソースコード143の16行目に記載された変数vを表す。ノード153fは、ノード153cで定義された変数vの参照を意味する。
 図17は、非互換情報の第3の例を示す図である。
 非互換情報163は、図15,16の構文ツリー153に適用される非互換情報の例である。ここでは、ソースコード143において、FUNCTIONブロックおよびPROCEDUREブロックの外で変数vを宣言する記載方法が非互換であり、外部変数であることを示す修飾子externを変数名の前に挿入することで非互換性が解消される場合を考える。
 変更前のデータベース製品は、ASセクションが2以上のブロックを含み、それら2以上のブロックの外で変数が宣言されている場合、その変数を2以上のブロックで共通に使用できるグローバル変数(外部変数)として解釈する。一方、変更後のデータベース製品は、外部変数として明示的に宣言されていない変数をローカル変数(内部変数)として解釈する。よって、構文ツリー153のノード153c,153fに非互換性が存在する。この非互換性は、ノード153cの前に修飾子externを示すノードを挿入し、ノード153fの変数名をextern.vに書き換えることで解消される。
 ただし、PROCEDUREブロックの中で同じ変数名の内部変数が定義されている場合、ノード153fが示す変数vはノード153cで定義された外部変数を指しているのではなく、内部変数を指している。そこで、ノード153fの変数名の書き換えは、PROCEDUREブロックの中で同じ変数名の内部変数が定義されていない場合のみ実行される。
 非互換情報163は、第1命令から第14命令までの14個の命令を含む。第1命令から第6命令までは、ブロック外の変数宣言を探索するための特定命令であり、第7命令から第8命令までは、変数宣言を書き換えるための書換命令である。第9命令から第13命令までは、ブロック内の変数参照を探索するための特定命令であり、第14命令は、変数参照を書き換えるための書換命令である。
 第1命令は、構文ツリー153の中から、分類がセクションであり値がASであるノード153aを検索し、現ノードとして選択する。第2命令は、縦位置が現ノードより1つ下であり、分類が文であるノードを検索し、現ノードとして選択する。第3命令は、縦位置が現ノードより1つ下であり、分類が節であるノードを検索し、現ノードとして選択する。第3命令の結果が偽である場合は第2命令に戻る。
 第4命令は、現ノードの直下のノードであって、種別が命令語であり値がDECLAREであるノード153bを検索する。第4命令の結果が偽である場合は第3命令に戻る。第5命令は、現ノードの直下のノードであって、種別が定義句であるノードを検索し、現ノードとして選択する。第6命令は、現ノードの直下のノードであって、種別が語であるノード153cを検索し、ノード153cの値を保存する。
 第7命令は、第1命令で選択されたノード153aに現ノードを戻す。第8命令は、現ノードの左横に、CREATE情報番号で指定された部分ツリーを挿入する。
 第9命令は、縦位置が現ノードより下であり、分類がブロックであるノード153d,153eを検索し、現ノードとして選択する。第10命令は、縦位置が現ノードより下であり、分類が式であるノードを検索し、現ノードとして選択する。第10命令の結果が偽である場合は第9命令に戻る。第11命令は、縦位置が現ノードより下であり、分類が語であるノード153fを検索し、現ノードとして選択する。第11命令の結果が偽である場合は第10命令に戻る。第12命令は、現ノードの値が、第6命令で保存された変数名と一致するか判定する。第12命令の結果が偽である場合は第11命令に戻る。
 第13命令は、縦位置が現ノードの1つ上であり、種別が定義節であるノードが存在しないことを確認する。第14命令は、現ノードの値を、アクションで指定された正規表現プログラムに従って書き換える。ここでは、変数名の先頭にexternが挿入される。
 このようにして、構文ツリーから非互換箇所が探索される。ただし、構文ツリーは副問い合わせなどの入れ子構造をもつことがあるため、探索が複雑化して計算量が大きくなるおそれがある。また、非互換情報が複雑化するおそれがあり、非互換情報の作成や管理の負担が大きくなるおそれがある。そこで、情報処理システムは、アンカーからの探索範囲を制限する。あるノードの子ノードが、文法的に当該ノードのレベル以上の分類(例えば、句に対する句や節)をもつ場合、その子ノードが探索範囲から除外される。また、あるノードの親ノードが、文法的に当該ノードのレベル以下の分類(例えば、節に対する節や句)をもつ場合、その親ノードが探索範囲から除外される。
 よって、情報処理システムは、非互換情報が上方向への探索を指示する場合であっても、親ノードの分類が現ノードの分類以下である場合は上方向の探索を停止する。また、情報処理システムは、非互換情報が下方向への探索を指示する場合であっても、子ノードの分類が現ノードの分類以上である場合は下方向の探索を停止する。
 また、情報処理システムは、非互換情報が右方向への探索を指示する場合であっても、現ノードが属する命令範囲を超えるような既知のキーワードが検出された場合は、右方向への探索を停止する。同様に、情報処理システムは、非互換情報が左方向への探索を指示する場合であっても、現ノードが属する命令範囲を超えるような既知のキーワードが検出された場合は、左方向への探索を停止する。
 次に、エディタ123による非互換情報の作成の支援について説明する。
 図18は、エディタ画面の例を示す図である。
 エディタ123は、非互換情報161の作成を支援するユーザインタフェースとして、エディタ画面174を端末装置31に提供する。端末装置31は、ソースコード141をエディタ123に送信する。エディタ123は、ソースコード141を構文解析して構文ツリー151を生成し、構文ツリー151を含むエディタ画面174を生成する。エディタ123は、エディタ画面174を端末装置31に送信する。
 端末装置31は、エディタ画面174を表示する。端末装置31は、エディタ画面174に対する操作を受け付ける。エディタ画面174に対する操作には、構文ツリー151の中から着目するノードを順に選択するノード選択が含まれ、選択されたノードを削除するノード削除や指定した位置にノードを挿入するノード追加が含まれる。また、エディタ画面174に対する操作には、条件リストの中から定義済みの検索条件を選択する条件指定が含まれる。また、エディタ画面174に対する操作には、選択されたノードの属性をパラメータケースに保存するパラメータ保存や、パラメータケースに保存された属性を検索条件として使用するパラメータ読み出しが含まれる。
 端末装置31は、受け付けた操作をエディタ123に送信する。エディタ123は、受信された操作に応じて特定命令および書換命令を生成する。例えば、エディタ123は、構文ツリー151のノードを順に選択するノード選択に基づいて、選択されたノードを一筆書きで辿る経路を判定する。エディタ123は、経路上の各ノードの属性および経路上のノードの位置関係から、FETCH命令やSEARCH命令を自動的に生成する。
 エディタ123は、生成された特定命令および書換命令を端末装置31に送信する。端末装置31は、受信された特定命令および書換命令をエディタ画面174に表示する。なお、ソースコード141の構文解析、エディタ画面174の生成、エディタ画面174に対する操作の解釈および非互換情報の生成のうちの一部または全部が、端末装置31によって実行されてもよい。情報処理装置100は、エディタ123に相当するプログラムを端末装置31に送信するようにしてもよい。
 図19は、エディタ画面の第1の操作手順例を示す図である。
 ここでは、構文ツリー151から非互換情報161を生成するための操作例を説明する。端末装置31は、キーワードTABLESPACEをもつノード151aを選択する(S10)。これにより、第1命令が生成される。次に、端末装置31は、キーワードCREATEをもつノード151bを選択する(S11)。これにより、ノード151aからノード151bに到達する経路が探索され、第2命令から第3命令が生成される。
 次に、端末装置31は、キーワードTABLEをもつノード151cを選択する(S12)。これにより、ノード151bからノード151cに到達する経路が探索され、第4命令から第5命令が生成される。次に、端末装置31は、ノード151aを再び選択して、着目するノードをノード151aに戻す(S13)。これにより、第6命令が生成される。次に、端末装置31は、TABLESPACE句を示すノード151dを選択する(S14)。これにより、第7命令が生成される。最後に、端末装置31は、構文ツリー151からノード151dを削除する(S15)。これにより、第8命令が生成される。
 図20は、エディタ画面の第2の操作手順例を示す図である。
 ここでは、構文ツリー153から非互換情報163を生成するための操作例を説明する。端末装置31は、ASセクションを示すノード153aを選択する(S20)。これにより、第1命令が生成される。次に、端末装置31は、キーワードDECLAREをもつノード153bを選択する(S21)。これにより、ノード153aからノード153bに到達する経路が探索され、第2命令から第4命令が生成される。
 次に、端末装置31は、変数名vを示すノード153cを選択し、変数名vをパラメータケースに保存する(S22)。これにより、ノード153bからノード153cに到達する経路が探索され、ノード153cの値が抽出され、第5命令から第6命令が生成される。次に、端末装置31は、ノード153aを再び選択して、着目するノードをノード153aに戻す(S23)。これにより、第7命令が生成される。
 次に、端末装置31は、事前に作成された部分グラフを示すCREATE情報番号を入力することで、構文ツリー153に部分グラフを挿入する(S24)。これにより、第8命令が生成される。次に、端末装置31は、ASセクションの配下にあるブロックとして、FUNCTIONブロックを示すノード153dおよびPROCEDUREブロックを示すノード153eを選択し、ノード153d,153eの下を探索範囲として指定する(S25)。
 次に、端末装置31は、パラメータケースから変数名vを読み出し、条件リストから「定義節の子でない」という検索条件を選択し、変数名vを示すノード153fを選択する(S26)。これにより、探索範囲からノード153fを検索する検索方法が特定され、第9命令から第13命令が生成される。最後に、端末装置31は、ノード153fの値をvからextern.vに書き換える(S27)。これにより、第14命令が生成される。
 次に、テスト部125による非互換情報の自動テストについて説明する。
 図21は、非互換情報のテストの例を示す図である。
 テスト部125は、サンプルコード記憶部121からソースコード141を読み出す。ソースコード141は、プリペアード状態の非互換情報161と併せて端末装置31から提供される。ソースコード141は、カラムC1,C2を含むテーブルT1を新規に作成することを要求するSQL文を含む。前述のように、ソースコード141は、変更後のデータベース製品と非互換であるTABLESPACE句を含む。
 テスト部125は、ソースコード141を構文解析して構文ツリー151を生成し、非互換情報161に含まれる一連の命令を構文ツリー151に対して実行することで、ソースコード141をソースコード144に変換する。ソースコード144は、ソースコード141と同様に、カラムC1,C2を含むテーブルT1を新規に作成することを要求するSQL文を含む。ただし、ソースコード144は、TABLESPACE句を含まない。
 テスト部125は、ソースコード144に含まれるSQL文をテストデータベース128に送信してSQL文を実行し、テストデータベース128から実行結果を抽出する。テストデータベース128は、非互換情報が想定する変更後のデータベース製品であり、情報処理装置100または他の情報処理装置に事前にインストールされている。
 テスト部125は、サンプルコード記憶部121から正解の実行結果を読み出し、テストデータベース128から抽出された今回の実行結果と正解の実行結果を比較して両者が一致しているか判定する。正解の実行結果は、ソースコード141と併せて端末装置31から提供される。ソースコード141に対応する正解の実行結果は、カラムC1,C2を含む空のテーブルT1が生成されたことである。
 今回の実行結果と正解の実行結果とが一致した場合、テスト部125は、非互換情報161が正しく動作していると判定する。一方、今回の実行結果と正解の実行結果とが一致しなかった場合、テスト部125は、非互換情報161が正しく動作しておらず非互換情報161に不具合があると判定する。なお、正解の実行結果が端末装置31から提供されていない場合、テスト部125は、今回の実行結果を端末装置31に送信し、今回の実行結果が正しいか否か判断した結果を端末装置31から受信する。
 次に、同一性判定部126による非互換情報の同一性判定について説明する。
 図22は、非互換情報の第4の例を示す図である。
 非互換情報164は、非互換情報161と同一の非互換箇所を検出することができる。ただし、非互換情報161,164は、探索手順が異なるために異なる特定命令を含む。非互換情報164は、特定命令として第1命令から第6命令までの6個の命令を含む。
 第1命令は、構文ツリー151の中から、種別が命令語であり値がCREATEであるノード151bを検索し、現ノードとして選択する。第2命令は、縦位置が現ノードより上であり、分類が節であるノードを検索し、現ノードとして選択する。第3命令は、縦位置が現ノードの1つ下であり、横位置が第1命令のCREATEより右であり、分類が句であるノードを検索し、現ノードとして選択する。第4命令は、現ノードの直下にあるノードであって、種別がオブジェクト種別であり値がTABLEであるノード151cを検索する。
 第5命令は、横位置が第3命令のTABLE句より右であり、分類が句であるノード151dを検索し、現ノードとして選択する。第6命令は、現ノードの直下のノードであって、種別がオブジェクト種別であり値がTABLESPACEであるノード151aを検索する。このように、探索の始点であるアンカーは非互換情報の作成者の主観に依存するため、同一の非互換箇所を検出することができる複数の非互換情報が作成され得る。
 そこで、同一性判定部126は、既存の非互換情報とプリペアード状態の非互換情報との間の実質的な同一性を判定する。情報処理装置100は、既存の非互換情報と実質的に同一であると判定された非互換情報の登録を拒否することがある。これにより、情報処理装置100は、知識データベースの冗長性を削減して非互換情報を効率的に管理できる。また、情報処理装置100は、プリペアード状態の非互換情報と実質的に同一であると判定された既存の非互換情報が、他者によって再発見されて使用されたとみなし、既存の非互換情報の使用実績としてカウントすることがある。これにより、情報処理装置100は、各非互換情報の価値を適切に評価することができる。
 実質的同一性を判定するにあたり、同一性判定部126は、以下のようにして各非互換情報からBOWベクトルを生成する。既存の非互換情報のBOWベクトルは、非互換情報と併せて非互換情報記憶部122に保存されてもよい。
 図23は、BOWベクトルテーブルの例を示す図である。
 同一性判定部126は、非互換情報からキーワードが含まれる命令を抽出し、抽出された各命令から探索属性とキーワードのペアを抽出する。同一性判定部126は、同一のペアの出現回数をカウントし、出現回数を列挙したBOWベクトルを生成する。BOWベクトルの1つの要素は、あるペアの出現回数を示す。ただし、同一性判定部126は、出現回数を非互換情報の命令数で割るなどの調整によって、同一のペアの出現確率を算出し、出現確率を列挙したBOWベクトルを生成してもよい。
 これにより、同一性判定部126は、BOWベクトルテーブル181を生成する。BOWベクトルテーブル181は、非互換情報161,164のBOWベクトルを含む。同一性判定部126は、非互換情報161について、第1命令から(オブジェクト種別,TABLESPACE)を抽出し、第3命令から(命令語,CREATE)を抽出し、第5命令から(オブジェクト種別,TABLE)を抽出する。また、同一性判定部126は、非互換情報164について、第1命令から(命令語,CREATE)を抽出し、第4命令から(オブジェクト種別,TABLE)を抽出し、第6命令から(オブジェクト種別,TABLESPACE)を抽出する。
 よって、同一性判定部126は、第1要素を(命令語,CREATE)、第2要素を(オブジェクト種別,TABLE)、第3要素を(オブジェクト種別,TABLESPACE)に割り当てると、非互換情報161,164から共に(1,1,1)というBOWベクトルを生成する。
 同一性判定部126は、プリペアード状態の非互換情報のBOWベクトルと既存の非互換情報のBOWベクトルとの間でコサイン類似度を算出する。コサイン類似度は、例えば、同一次元毎に積を算出して合算し、2つのBOWベクトルのノルムで割ることで算出される。コサイン類似度の最大値は1であり、1に近いほど類似度が高いことを意味する。非互換情報161,164のBOWベクトルは同一であり、そのコサイン類似度は1である。同一性判定部126は、コサイン類似度が閾値以下である場合、2つの非互換情報が類似しておらず、同一の非互換箇所を検出するものではないと判定する。
 ただし、上記のBOWベクトルはキーワードの出現順序を考慮していない。そのため、BOWベクトルのコサイン類似度が閾値以下であっても、2つの非互換情報が同一の非互換箇所を検出するものではないことがある。例えば、CREATE TABLESPACE SPC1 TABLE COMPRESSION::=();というSQL文からCREATE TABLESPACEという非互換箇所を検出する非互換情報からは、非互換情報161と同一のBOWベクトルが生成される可能性がある。
 そこで、同一性判定部126は、まず上記のBOWベクトルを用いて、既存の非互換情報の中からプリペアード状態の非互換情報と実質的に同一である可能性があるものを絞り込む。その後、同一性判定部126は、プリペアード状態の非互換情報と絞り込まれた既存の非互換情報との間で、非互換情報から推定されるソースコード上でのキーワードの出現順序を比較して、最終的に同一性を判定する。
 このとき、同一性判定部126は、以下のようにして各非互換情報からキーワードリストを生成する。既存の非互換情報のキーワードリストは、非互換情報と併せて非互換情報記憶部122に保存されてもよい。
 図24は、キーワードリストの第1の生成例を示す図である。
 同一性判定部126は、非互換情報からFETCH命令に含まれるキーワードおよびSEARCH命令に含まれるキーワードを抽出する。同一性判定部126は、非互換情報に含まれる命令の横位置を追跡することで、抽出された2以上のキーワードがソースコードに含まれる場合における当該2以上のキーワードの出現順序を推定する。非互換情報は、2以上のキーワードを構文ツリーの左から右に向かう順序で探索するとは限らないため、同一性判定部126は、非互換情報に規定された探索範囲に基づいて出現順序を推定する。同一性判定部126は、キーワードを出現順に並べたキーワードリストを生成する。
 同一性判定部126は、非互換情報161からキーワードリスト182を生成する。まず、同一性判定部126は、第1命令からキーワードTABLESPACEを抽出し、TABLESPACEを示すノード183を生成する。次に、同一性判定部126は、第2命令の横位置に基づいて、次のノード位置をノード183の左と判定する。次に、同一性判定部126は、第3命令からキーワードCREATEを抽出し、CREATEを示すノード184を生成する。
 次に、同一性判定部126は、第4命令の横位置に基づいて、次のノード位置をノード183とノード184の間と判定する。最後に、同一性判定部126は、第5命令からキーワードTABLEを抽出し、TABLEを示すノード185を生成する。これにより、CREATE,TABLE,TABLESPACEの順にキーワードが並んだキーワードリスト182が生成される。
 図25は、キーワードリストの第2の生成例を示す図である。
 同一性判定部126は、非互換情報164からキーワードリスト186を生成する。まず、同一性判定部126は、第1命令からキーワードCREATEを抽出し、CREATEを示すノード187を生成する。次に、同一性判定部126は、第3命令の横位置に基づいて、次のノード位置をノード187の右と判定する。次に、同一性判定部126は、第4命令からキーワードTABLEを抽出し、TABLEを示すノード188を生成する。
 次に、同一性判定部126は、第5命令の横位置に基づいて、次のノード位置をノード188の右と判定する。最後に、同一性判定部126は、第6命令からキーワードTABLESPACEを抽出し、TABLESPACEを示すノード189を生成する。これにより、CREATE,TABLE,TABLESPACEの順にキーワードが並んだキーワードリスト186が生成される。
 同一性判定部126は、2つのキーワードリストの間で類似度を算出する。例えば、同一性判定部126は、キーワードリストの編集距離を算出する。同一性判定部126は、一方のキーワードリストを他方のキーワードリストに変換するためのキーワードの挿入、削除および置換の操作回数の最小値を算出する。また、例えば、同一性判定部126は、キーワードリストのユークリッド距離を算出する。同一性判定部126は、異なるキーワード間の類似度を事前に定義しておき、キーワードリストの同じ位置にあるキーワード同士の類似度の二乗和平方根または二乗平均平方根を算出する。
 なお、キーワードの出現順序を考慮して文書間の類似度を算出する方法については、例えば、次の文献にも記載されている。小中史人、三浦孝夫、「語の並びを考慮した意味類似度手法の提案」、第7回データ工学と情報マネジメントに関するフォーラム(DEIM2015)、A2-6、2015年3月2日。
 同一性判定部126は、キーワードリストの類似度が閾値以下である場合、2つの非互換情報が類似しておらず、同一の非互換箇所を検出するものではないと判定する。一方、同一性判定部126は、キーワードリストの類似度が閾値を超える場合、2つの非互換情報が類似しており、同一の非互換箇所を検出するものである可能性があると判定する。この点、キーワードリスト182,186は同一である。よって、同一性判定部126は、非互換情報161,164が実質的に同一であると判定する。
 次に、非互換情報の非互換サブ情報への分割について説明する。非互換情報は、同一の非互換性に関連して、構文ツリー上の離れた位置にある複数のノードを検索して書き換えることがある。その場合、非互換情報は、特定命令の列および書換命令の列を複数セット含むことがある。そのような複数の命令セットは、互いに分離して再利用可能であることがあり、ある命令セットは他の非互換情報に流用できることがある。
 そこで、情報処理装置100は、再利用可能な命令セットとして、非互換情報から非互換サブ情報を抽出する。同一性判定部126は、端末装置31から受信された非互換情報全体の同一性に加えて、非互換サブ情報単位での同一性も判定する。
 複数の非互換サブ情報を含む非互換情報の例として、図12,13に示した非互換情報162のように、入れ子構造をもつ構文ツリーにおいて、ある部分ツリーを探索する命令セットと別の部分ツリーを探索する命令セットとを含むものがある。前述のように、構文ツリーの探索は、各ノードの分類レベルに基づいて縦方向の探索範囲を制限し、各ノードのキーワードに基づいて横方向の探索範囲を制限する。そこで、入れ子構造を探索する非互換情報は、複数の非互換サブ情報に分割され得る。
 ただし、非互換情報に含まれる後方の命令セットは、POP命令によって、前方の命令セットで検出されたノードを基点として探索を行うことがある。後方の命令セットを再利用可能な非互換サブ情報として評価するにあたっては、前方の命令セットに依存する特定命令を排除することが好ましい。そこで、同一性判定部126は、非互換情報を単純に分割するだけでなく、一部の命令を変更することがある。
 また、複数の非互換サブ情報を含む非互換情報の例として、図17に示した非互換情報163のように、GET PRM命令とSET PRM命令を用いて、前方の命令セットから後方の命令セットにパラメータを引き継ぐものがある。このような非互換情報からは、GET PRM命令を用いた命令セット間の結合の態様に応じて、再利用可能な命令範囲を複数通り抽出することができる。よって、非互換情報から複数の非互換サブ情報が抽出され得る。
 図26は、非互換サブ情報の抽出例を示す図である。
 非互換サブ情報165は、非互換情報162から抽出される2番目の非互換サブ情報である。非互換情報162から抽出される1番目の非互換サブ情報は、非互換情報162の第1命令から第6命令までと同一である。同一性判定部126は、非互換情報162の中から、命令属性が書換命令から特定命令に切り替わる境界を検出する。同一性判定部126は、境界前後で命令セットを分割する。
 ただし、非互換情報162の第7命令は、第1命令で検出された1番目のSELECTに現ノードを戻すPOP命令である。非互換情報162の第8命令から第12命令は、1番目のSELECTを基点にして2番目のSELECTを探索する命令である。そのため、非互換情報162の第7命令から第19命令は1番目の非互換サブ情報に依存しており、第7命令から第19命令そのものを独立した非互換サブ情報として評価することは難しい。
 そこで、同一性判定部126は、境界後において以前の命令に依存する命令列を、以前の命令に依存しないアンカーサーチの命令に置換する。具体的には、同一性判定部126は、境界直後にPOP命令が存在する場合、POP命令からキーワードを指定したFETCH命令またはSEARCH命令までの区間を、当該キーワードを指定したFETCH命令に置換する。
 ここでは、同一性判定部126は、非互換情報162の第7命令から第12命令までを削除し、その代わりに、種別が命令語であり値がSELECTであるノードを検索するFETCH命令を追加する。非互換情報162の第13命令から第19命令はそのまま使用される。これにより、同一性判定部126は、8個の命令を含む非互換サブ情報165を生成する。
 図27は、非互換情報の分割例を示す図である。
 非互換情報163からは、以下のようにして非互換サブ情報が抽出される。同一性判定部126は、非互換情報163に含まれる14個の命令を、命令属性およびGET PRM命令に応じて、4個の命令群とJOINT命令に分割する。
 同一性判定部126は、GET PRM命令をJOINT命令として分離する。また、同一性判定部126は、連続する特定命令である第1命令から第5命令を命令群#1として抽出し、連続する書換命令である第7命令から第8命令を命令群#2として抽出する。また、同一性判定部126は、連続する特定命令である第9命令から第13命令を命令群#3として抽出し、書換命令である第14命令を命令群#4として抽出する。
 同一性判定部126は、JOINT命令の位置と各命令群の命令属性とに基づいて、再利用可能な命令群の組み合わせを決定する。ここでは、同一性判定部126は、命令群#1を1つの非互換サブ情報として採用する。この非互換サブ情報は、ASセクション配下の定義句を検索するものである。また、同一性判定部126は、命令群#1,#2の組み合わせを1つの非互換サブ情報として採用する。この非互換サブ情報は、ASセクション配下の定義句を検索して書き換えるものである。
 また、同一性判定部126は、命令群#1とJOINT命令と命令群#3の組み合わせを1つの非互換サブ情報として採用する。この非互換サブ情報は、ASセクション配下の定義句を検索し、その定義句で定義された変数の参照を更に検索するものである。また、同一性判定部126は、命令群#1とJOINT命令と命令群#2~#4の組み合わせを1つの非互換サブ情報として採用する。この非互換サブ情報は、非互換情報163そのものである。このように、同一性判定部126は、GET PRM命令が含まれる非互換情報からは、実質的に意味のある命令群の組み合わせを非互換サブ情報として抽出する。
 次に、情報処理装置100の処理手順について説明する。
 図28は、非互換情報生成の手順例を示すフローチャートである。
 (S100)エディタ123は、ソースコードを構文解析して構文ツリーを生成する。
 (S101)エディタ123は、エディタ画面上のユーザ操作を受け付ける。
 (S102)エディタ123は、ユーザ操作が、以前に選択されたノードの再選択であるか判断する。ユーザ操作が以前の選択ノードの再選択である場合はステップS103に処理が進み、それ以外の場合はステップS104に処理が進む。
 (S103)エディタ123は、POP命令を生成して非互換情報に追加する。このPOP命令の縦位置はなし、横位置はなし、探索属性はなし、キーワードは以前のノード選択の命令番号、アクションはなしである。そして、ステップS101に処理が戻る。
 (S104)エディタ123は、ユーザ操作が、ノードを削除するDELETE操作であるか判断する。ユーザ操作がDELETE操作である場合はステップS105に処理が進み、それ以外の場合はステップS106に処理が進む。
 (S105)エディタ123は、DELETE命令を生成して非互換情報に追加する。このDELETE命令の縦位置は-*、横位置は*、探索属性はなし、キーワードはなし、アクションはなしである。そして、ステップS101に処理が戻る。
 (S106)エディタ123は、ユーザ操作が、CREATE情報番号を指定したCREATE操作であるか判断する。ユーザ操作がCREATE操作である場合はステップS107に処理が進み、それ以外の場合はステップS108に処理が進む。
 (S107)エディタ123は、CREATE命令を生成して非互換情報に追加する。このCREATE命令の縦位置は指定位置、横位置は指定位置、探索属性はなし、キーワードはなし、アクションはCREATE情報番号である。そして、ステップS101に処理が戻る。
 (S108)エディタ123は、ユーザ操作が、構文ツリーから最初にノードを選択するものであるか判断する。ユーザ操作が最初のノード選択である場合はステップS109に処理が進み、それ以外の場合はステップS110に処理が進む。
 (S109)エディタ123は、選択ノードのキーワードを取得し、取得したキーワードを検索するアンカーサーチを示すFETCH命令を生成して非互換情報に追加する。このFETCH命令の縦位置は*、横位置は*、探索属性は選択ノードの属性、キーワードは選択ノードのキーワード、アクションはなしである。そして、ステップS101に処理が戻る。
 (S110)エディタ123は、ユーザ操作が、非互換情報の作成を終了する終了操作であるか判断する。ユーザ操作が終了操作である場合はステップS131に処理が進み、それ以外の場合はステップS111に処理が進む。
 図29は、非互換情報生成の手順例を示すフローチャート(続き1)である。
 (S111)エディタ123は、以前のユーザ操作によって選択されたノードが存在するか判断する。前回の選択ノードが存在する場合はステップS112に処理が進み、それ以外の場合はステップS114に処理が進む。
 (S112)エディタ123は、前回の選択ノードの構文ツリー上の横位置と、今回の選択ノードの構文ツリー上の横位置とを比較する。
 (S113)エディタ123は、前回の横位置と今回の横位置とが同じ場合、横方向の探索範囲(探索の横位置)を0に設定する。エディタ123は、今回の横位置が前回の横位置より大きい場合、探索の横位置を[前回位置:今回位置]に設定する。エディタ123は、前回の横位置が今回の横位置より大きい場合、探索の横位置を[今回位置:前回位置]に設定する。そして、ステップS115に処理が進む。
 (S114)エディタ123は、探索の横位置を*に設定する。
 (S115)エディタ123は、非互換情報に含まれる生成済みの既存命令を、先頭から優先的に1つ選択する。エディタ123は、選択した既存命令がFETCH命令であり、かつ、FETCH命令の探索の横位置が今回の選択ノードの横位置を含むか判断する。選択した既存命令が上記条件を満たすFETCH命令である場合はステップS116に処理が進み、選択した既存命令がそれ以外の場合はステップS118に処理が進む。
 (S116)エディタ123は、選択した既存命令を非互換情報から削除する。また、エディタ123は、選択した既存命令から連続する既存命令であって、選択した既存命令と同じ探索の横位置をもつFETCH命令も非互換情報から削除する。
 (S117)エディタ123は、今回の選択ノードの横位置を基準にして、削除された既存命令の探索範囲を二分割する。エディタ123は、削除された既存命令に代えて、分割された探索範囲をもつ新たなFETCH命令を生成して非互換情報に追加する。
 (S118)エディタ123は、ステップS115において、非互換情報に含まれる全ての既存命令を選択したか判断する。全ての既存命令を選択した場合はステップS119に処理が進み、未選択の既存命令がある場合はステップS115に処理が戻る。
 図30は、非互換情報生成の手順例を示すフローチャート(続き2)である。
 (S119)エディタ123は、ユーザ操作が、パラメータケースからのキーワードの読み出しを含むか判断する。ユーザ操作がキーワードの読み出しを含む場合はステップS120に処理が進み、それ以外の場合はステップS121に処理が進む。
 (S120)エディタ123は、SEARCH命令を生成して非互換情報に追加する。このSEARCH命令の縦位置は-1、横位置は*、探索属性は今回の選択ノードの属性、キーワードはSET PRM、アクションはなしである。
 (S121)エディタ123は、ユーザ操作が、分類が語である語ノードの選択であるか判断する。ユーザ操作が語ノードの選択である場合はステップS122に処理が進み、それ以外の場合はステップS127に処理が進む。
 (S122)エディタ123は、ユーザ操作が、パラメータケースへのキーワードのドロップを含むか判断する。ユーザ操作がキーワードのドロップを含む場合はステップS123に処理が進み、それ以外の場合はステップS124に処理が進む。
 (S123)エディタ123は、キーワードを保存するGET PRM命令を生成して非互換情報に追加する。このGET PRM命令の縦位置は指定位置、横位置は0、探索属性は語、キーワードはなし、トランザクションはなしである。
 (S124)エディタ123は、ユーザ操作によって、現ノードの親ノードについて付帯条件が指定されたか判断する。付帯条件は、例えば、エディタ画面の条件リストから選択される。付帯条件が指定された場合はステップS125に処理が進み、付帯条件が指定されていない場合はステップS126に処理が進む。
 (S125)エディタ123は、付帯条件を満たすノードを検索するSEARCH命令を生成して非互換情報に追加する。このSEARCH命令の縦位置は+1、横位置は*、探索属性は付帯条件で指定された属性、キーワードは付帯条件で指定されたキーワード、アクションは付帯条件で指定されたアクションである。ただし、付帯条件が、該当するノードが存在しないという否定表現である場合、SEARCH命令の前に否定命令!が付される。
 (S126)エディタ123は、SEARCH命令を生成して非互換情報に追加する。このSEARCH命令の縦位置は-1、横位置は*、探索属性は選択ノードの属性、キーワードは選択ノードの値、アクションはなしである。
 (S127)エディタ123は、構文ツリーにおいて前回の選択ノードと今回の選択ノードのうち高い方(ルートノードに近い方)の高さを基準高として特定する。
 (S128)エディタ123は、前回の選択ノードと今回の選択ノードのうち低い方の選択ノードから基準高まで親を辿るFETCH命令を生成する。低い方が前回の選択ノードである場合、FETCH命令の縦位置は+1、横位置は*、探索属性はなし、キーワードはなし、アクションはなしである。低い方が今回の選択ノードである場合、FETCH命令の縦位置は-1、横位置は*、探索属性は親ノードの属性、キーワードはなし、アクションはRETである。
 (S129)エディタ123は、ステップS128で高さが揃った2つのノードが共通ノードに到達するまで、更に親を辿るFETCH命令を生成する。前回の選択ノード側のFETCH命令の縦位置は+1、横位置は+、探索属性はなし、キーワードはなし、アクションはなしである。今回の選択ノード側のFETCH命令の縦位置は-1、横位置は*、探索属性は親ノードの属性、キーワードはなし、アクションはRETである。
 (S130)エディタ123は、ステップS128,S129で生成されたFETCH命令のうち今回の選択ノードに関するFETCH命令を逆順に変更する。エディタ123は、順序変更後のFETCH命令を非互換情報に追加する。そして、ステップS101に処理が戻る。
 図31は、非互換情報生成の手順例を示すフローチャート(続き3)である。
 (S131)エディタ123は、非互換情報に含まれる生成済みの既存命令を、先頭から優先的に1つ選択する。エディタ123は、選択した既存命令がFETCH命令であるか判断する。選択した既存命令がFETCH命令である場合はステップS132に処理が進み、選択した既存命令がFETCH命令でない場合はステップS138に処理が進む。
 (S132)エディタ123は、今回選択したFETCH命令の命令番号を「終了番号」に設定し、前回の終了番号を「開始番号」に設定する。
 (S133)エディタ123は、選択したFETCH命令が非互換情報の中の最初のFETCH命令であるか判断する。最初のFETCH命令である場合はステップS138に処理が進み、2番目以降のFETCH命令である場合はステップS134に処理が進む。
 (S134)エディタ123は、選択したFETCH命令の縦位置が+1であるか判断する。選択したFETCH命令の縦位置が+1である場合はステップS135に処理が進み、それ以外の場合はステップS136に処理が進む。
 (S135)エディタ123は、選択したFETCH命令の横位置を-[開始番号]に変更する。そして、ステップS138に処理が進む。
 (S136)エディタ123は、選択したFETCH命令の縦位置が-1であるか判断する。選択したFETCH命令の縦位置が-1である場合はステップS137に処理が進み、それ以外の場合はステップS138に処理が進む。
 (S137)エディタ123は、選択したFETCH命令の横位置を+[開始番号:終了番号]に変更する。
 (S138)エディタ123は、ステップS131において、非互換情報に含まれる全ての既存命令を選択したか判断する。全ての既存命令を選択した場合は非互換情報生成が終了し、未選択の既存命令がある場合はステップS131に処理が戻る。
 図32は、非互換情報テストの手順例を示すフローチャートである。
 (S140)テスト部125は、取得した非互換情報が、エディタ123を用いて作成されたものであるか判断する。エディタ123で作成された非互換情報である場合はステップS145に処理が進み、それ以外の場合はステップS141に処理が進む。
 (S141)テスト部125は、非互換情報と併せて取得したソースコードを構文解析して構文ツリーを生成する。ソースコードは、非互換情報の作成者から提供される。
 (S142)テスト部125は、ステップS141で生成した構文ツリーに対して、非互換情報に含まれる命令を順に実行する。このとき、テスト部125は、命令の処理対象となったノードに処理済みフラグを付与して、処理済みノードを特定しておく。
 (S143)テスト部125は、非互換情報に含まれる全ての命令を実行し終えるまでに、処理済みノードの再選択が発生したか、すなわち、命令の処理対象のノードが重複したか判断する。ノードの再選択が発生した場合はステップS144に処理が進み、ノードの再選択が発生しなかった場合はステップS145に処理が進む。
 (S144)テスト部125は、ノードの再選択が発生した命令を示す重複エラーを出力する。例えば、テスト部125は、重複エラーを端末装置31に送信する。
 (S145)テスト部125は、非互換情報と併せて取得したソースコードに非互換情報を適用して、変換後ソースコードを生成する。
 (S146)テスト部125は、ステップS145で生成された変換後ソースコードをテストデータベースで実行し、テストデータベースから実行結果を抽出する。例えば、テスト部125は、変換後ソースコードに含まれるSQL文をテストデータベースに送信する。また、例えば、テスト部125は、変換後ソースコードに含まれるSQLプロシジャコードをテストデータベースで実行する。
 (S147)テスト部125は、非互換情報およびソースコードと併せて、正解の実行結果が記憶されているか判断する。正解の実行結果が記憶されている場合はステップS148に処理が進み、記憶されていない場合はステップS150に処理が進む。
 (S148)テスト部125は、ステップS146のテストの実行結果と正解の実行結果とが一致するか判断する。テストの実行結果と正解の実行結果とが一致する場合、テスト部125は、非互換情報が正常に動作していると判定して非互換情報テストを終了する。一致しない場合、ステップS149に処理が進む。
 (S149)テスト部125は、非互換情報が正常に動作しなかったことを示すテストエラーを出力する。例えば、テスト部125は、テストエラーを端末装置31に送信する。そして、非互換情報テストが終了する。
 (S150)テスト部125は、ステップS146のテストの実行結果を出力して、テストの実行結果が正しいか否かの確認を依頼する。例えば、テスト部125は、テストの実行結果を端末装置31に送信する。
 図33は、非互換情報同一性判定の手順例を示すフローチャートである。
 (S160)同一性判定部126は、非互換情報に含まれる命令を先頭から優先的に1つ選択する。同一性判定部126は、選択した命令が命令属性の変化点であるか判断する。選択した命令が変化点である場合には、選択した命令が非互換情報の先頭の命令である場合と、1つ前の命令が特定命令であり今回の命令が書換命令である場合と、1つ前の命令が書換命令であり今回の命令が特定命令である場合とが含まれる。変化点である場合はステップS161に処理が進み、変化点でない場合はステップS162に処理が進む。
 (S161)同一性判定部126は、新たな命令群を定義する。別の命令群が定義されるまで、選択される命令はこの命令群に振り分けられる。
 (S162)同一性判定部126は、選択した命令がGET PRM命令であるか判断する。選択した命令がGET PRM命令である場合はステップS163に処理が進み、選択した命令がGET PRM命令でない場合はステップS164に処理が進む。
 (S163)同一性判定部126は、命令をJOINT命令として命令群から分離する。
 (S164)同一性判定部126は、ステップS160において、非互換情報に含まれる全ての命令を選択したか判断する。全ての命令を選択した場合はステップS165に処理が進み、未選択の命令がある場合はステップS160に処理が戻る。
 (S165)同一性判定部126は、ステップS160~S164によって生成された命令群のうち何れか1つの命令群を選択する。同一性判定部126は、選択した命令群の先頭が特定命令かつPOP命令であるか判断する。先頭が特定命令かつPOP命令である場合はステップS166に処理が進み、それ以外の場合はステップS168に処理が進む。
 (S166)同一性判定部126は、選択した命令群の先頭のPOP命令から、キーワード付きのSEARCH命令またはキーワード付きのFETCH命令の直前の命令までを削除する。
 (S167)同一性判定部126は、削除されずに残った命令の先頭がSEARCH命令である場合、SEARCH命令をFETCH命令に変換する。
 (S168)同一性判定部126は、ステップS165において、生成された全ての命令群を選択したか判断する。全ての命令群を選択した場合はステップS169に処理が進み、未選択の命令群がある場合はステップS165に処理が戻る。
 (S169)同一性判定部126は、非互換情報に含まれるJOINT命令を分割点として、連続する特定命令群と書換命令群とを含むリストを生成する。例えば、非互換情報から、特定命令群#1、書換命令群#1、JOINT命令、特定命令群#2および書換命令群#2が生成されたとする。この場合、特定命令群#1+書換命令群#1のリストと、特定命令群#2+書換命令群#2のリストとが生成される。
 (S170)同一性判定部126は、ステップS169で生成された各リストから先頭の特定命令群を抽出して、別のリストとして生成する。例えば、特定命令群#1+書換命令群#1のリストから、特定命令群#1のみのリストが生成され、特定命令群#2+書換命令群#2のリストから、特定命令群#2のみのリストが生成される。
 (S171)同一性判定部126は、ステップS169,S170で生成されたリストにJOINT命令を付加して、別のリストを生成する。別のリストの生成には、JOINT命令を用いて2つのリストを結合することが含まれる。ただし、別のリストの生成は、命令の出現順序が非互換情報と整合する範囲で行われる。例えば、特定命令群#1+JOINT命令のリストと、特定命令群#1+書換命令群#1+JOINT命令のリストとが生成される。また、特定命令群#1+JOINT命令+特定命令群#2のリストと、特定命令群#1+書換命令群#1+JOINT命令+特定命令群#2+書換命令群#2のリストとが生成される。ステップS169~S171で生成された各リストが、非互換サブ情報とみなされる。
 図34は、非互換情報同一性判定の手順例を示すフローチャート(続き1)である。
 (S172)同一性判定部126は、非互換サブ情報を1つ選択する。同一性判定部126は、選択した非互換サブ情報から、探索属性とキーワードのペアを抽出する。
 (S173)同一性判定部126は、探索属性+キーワード毎に出現回数をカウントし、出現回数または出現確率を列挙したBOWベクトルを生成する。
 (S174)同一性判定部126は、登録済みの非互換情報または非互換サブ情報(登録済み情報)との間でBOWベクトルの類似度(類似度#1)を算出する。登録済み情報のBOWベクトルは、非互換情報記憶部122に保存されていてもよいし、ここで生成されてもよい。類似度#1は、例えば、コサイン類似度である。
 (S175)同一性判定部126は、ステップS174で算出された類似度#1が閾値#1より大きいか判断する。類似度#1が閾値#1より大きい場合はステップS183に処理が進み、類似度#1が閾値#1以下の場合はステップS181に処理が進む。なお、登録済み情報が複数ある場合、少なくとも1つの登録済み情報の類似度#1が閾値#1より大きい場合、ステップS183に処理が進む。
 (S176)同一性判定部126は、登録済み情報との間で、後述するステップS183~S194によって生成されるキーワードリストの類似度(類似度#2)を算出する。登録済み情報のキーワードリストは、非互換情報記憶部122に保存されていてもよいし、ここで生成されてもよい。登録済み情報が複数ある場合、類似度#2を算出する登録済み情報は、類似度#1が閾値#1より大きいものに限定される。
 (S177)同一性判定部126は、ステップS176で算出された類似度#2が閾値#2より大きいか判断する。類似度#2が閾値#2より大きい場合はステップS178に処理が進み、類似度#2が閾値#2以下の場合はステップS181に処理が進む。なお、登録済み情報が複数ある場合、少なくとも1つの登録済み情報の類似度#2が閾値#2より大きい場合、ステップS178に処理が進む。
 (S178)同一性判定部126は、BOWベクトルが同一でありかつキーワードリストが同一の登録済み情報が存在するか判断する。該当する登録済み情報が存在する場合はステップS179に処理が進み、存在しない場合はステップS180に処理が進む。
 (S179)同一性判定部126は、選択した非互換サブ情報が新規情報でなく登録不可であると判定する。そして、ステップS182に処理が進む。
 (S180)同一性判定部126は、類似する登録済み情報が存在することを示す類似警告を出力する。類似する登録済み情報は、類似度#2が閾値#2より大きい登録済み情報である。例えば、同一性判定部126は、端末装置31,32に類似警告を送信する。そして、ステップS182に処理が進む。
 (S181)同一性判定部126は、選択した非互換サブ情報が新規情報であり、自動テストの成功と承認者による承認とを条件として登録可であると判定する。
 (S182)同一性判定部126は、ステップS172において、全ての非互換サブ情報を選択したか判断する。全ての非互換サブ情報を選択した場合は非互換情報同一性判定が終了し、未選択の非互換サブ情報がある場合はステップS172に処理が戻る。なお、非互換情報に含まれる全ての非互換サブ情報が新規情報と判定された場合、非互換情報の登録が許可されると共に、各非互換サブ情報の登録が許可されてもよい。また、非互換情報に含まれる一部の非互換サブ情報のみが新規情報と判定された場合、新規情報と判定された非互換サブ情報の登録が許可されてもよい。
 図35は、非互換情報同一性判定の手順例を示すフローチャート(続き2)である。
 (S183)同一性判定部126は、非互換サブ情報に含まれる命令を先頭から優先的に1つ選択する。同一性判定部126は、選択した命令がFETCH命令またはSEARCH命令であるか判断する。選択した命令がFETCH命令またはSEARCH命令である場合はステップS184に処理が進み、それ以外の場合はステップS192に処理が進む。
 (S184)同一性判定部126は、選択した命令が非互換サブ情報に含まれる最初のFETCH命令であるか判断する。最初のFETCH命令である場合はステップS185に処理が進み、最初のFETCHでない場合はステップS186に処理が進む。
 (S185)同一性判定部126は、キーワードリストにおいて次のノードを挿入する次位置を初期位置に設定する。そして、ステップS192に処理が進む。
 (S186)同一性判定部126は、選択した命令が、縦位置+かつキーワードありの命令か、または、縦位置-かつ横位置-の命令か判断する。上記条件を満たす命令の場合はステップS187に処理が進み、それ以外の場合はステップS188に処理が進む。
 (S187)同一性判定部126は、キーワードリストにおける次位置を現ノードの左に設定する。現ノードは現在着目している既存ノードであり、通常、キーワードリストに最後に追加されたノードである。そして、ステップS192に処理が進む。
 (S188)同一性判定部126は、選択した命令が、縦位置-かつ横位置+の命令か判断する。上記条件を満たす命令の場合はステップS189に処理が進み、それ以外の場合はステップS190に処理が進む。
 (S189)同一性判定部126は、キーワードリストにおける次位置を現ノードの右に設定する。そして、ステップS192に処理が進む。
 (S190)同一性判定部126は、選択した命令が、縦位置-かつ横位置が範囲指定の命令か判断する。上記条件を満たす命令の場合はステップS191に処理が進み、それ以外の場合はステップS192に処理が進む。
 (S191)同一性判定部126は、キーワードリストにおける次位置を、選択した命令の横位置の範囲内にある既存ノードの右に設定する。
 (S192)同一性判定部126は、選択した命令がキーワードを含むか判断する。選択した命令がキーワードを含む場合はステップS193に処理が進み、選択した命令がキーワードを含まない場合はステップS194に処理が進む。
 (S193)同一性判定部126は、選択した命令の命令番号とキーワードとを含むノードを生成し、ステップS183~S191で設定された次位置に挿入する。
 (S194)同一性判定部126は、ステップS183において、非互換サブ情報に含まれる全ての命令を選択したか判断する。全ての命令を選択した場合はステップS176に処理が進み、未選択の命令がある場合はステップS183に処理が戻る。
 以上説明したように、第2の実施の形態の情報処理システムは、データベース製品を使用するソースコードに対する非互換吸収の手順を規定した非互換情報を、知識情報として蓄積する。蓄積された非互換情報を用いることで、情報処理システムは、ソースコードの非互換吸収の一部または全部を自動化でき、非互換吸収を効率化できる。
 また、情報処理システムは、非互換情報を作成する作成者に対し、非互換情報の作成を支援するエディタを提供する。エディタは、ソースコードのサンプルの構文ツリーを表示し、構文ツリーに対するユーザ操作に基づいて非互換情報を自動的に生成する。よって、再利用可能な非互換情報を作成する負担が軽減される。
 また、情報処理システムは、知識データベースに非互換情報を登録する前に、その非互換情報が正常に動作することを確認する自動テストを実行する。よって、蓄積される非互換情報の品質が向上する。また、情報処理システムは、知識データベースに非互換情報を登録する前に、同一の非互換箇所を検出することができる実質的に同一の非互換情報が既に存在するか判定する。よって、実質的に同一の非互換情報が知識データベースに重複して登録されることが抑制され、非互換情報の検索や管理が効率化される。また、各非互換情報の使用実績が適切にカウントされ、各非互換情報の評価が適正化される。
 また、情報処理システムは、探索属性とキーワードのペアの出現頻度を示すBOWベクトルを用いて、類似する既存の非互換情報を絞り込み、キーワードの出現順序を示すキーワードリストを用いて、実質同一の既存の非互換情報が存在するか最終的に判定する。よって、キーワードの探索順序が異なるために2つの非互換情報の記載が異なる場合であっても、同一の非互換箇所を検出することができる実質的な同一性が判定される。
 また、キーワードの出現順序が考慮されるため、判定精度が向上し、異なる非互換箇所を検出する非互換情報が誤って実質同一と判定されるリスクが低下する。また、情報処理システムは、キーワードの出現順序を考慮しないBOWベクトルによって既存の非互換情報を絞り込んだ後に、キーワードの出現順序によって実質的な同一性を評価する。よって、同一性判定が効率的に実行される。
 上記については単に本発明の原理を示すものである。更に、多数の変形や変更が当業者にとって可能であり、本発明は上記に示し、説明した正確な構成および応用例に限定されるものではなく、対応する全ての変形例および均等物は、添付の請求項およびその均等物による本発明の範囲とみなされる。
 10 情報処理装置
 11 記憶部
 12 処理部
 13,14 非互換情報
 15,16 頻度情報
 17,18 順序情報

Claims (7)

  1.  第1のソフトウェアを使用するソースコードの中から第2のソフトウェアと非互換である記述を探索するための情報であって、2以上の言語要素がもつキーワードと前記2以上の言語要素の位置関係とに対する条件を示す第1の非互換情報を取得し、
     前記第1の非互換情報から2以上のキーワードを抽出し、同一のキーワードの出現頻度に基づく第1の頻度情報を生成し、前記位置関係の条件から推定される前記2以上のキーワードの出現順序を示す第1の順序情報を生成し、
     前記第1の頻度情報と第2の非互換情報に対応する第2の頻度情報との間の第1の類似度と、前記第1の順序情報と前記第2の非互換情報に対応する第2の順序情報との間の第2の類似度とに基づいて、前記第1の非互換情報および前記第2の非互換情報の同一性を判定する、
     処理をコンピュータに実行させる情報処理プログラム。
  2.  前記第1の非互換情報は、前記2以上の言語要素がもつ属性に対する条件を更に示し、
     前記第1の頻度情報の生成では、前記キーワードと前記属性とのペアを2以上抽出し、同一のペアの出現頻度を示すように前記第1の頻度情報を生成する、
     請求項1記載の情報処理プログラム。
  3.  前記第1の非互換情報は、構文ツリーにおいて第1の言語要素から第2の言語要素を探索する際の探索範囲を、前記位置関係に対する条件として規定し、
     前記第1の順序情報の生成では、前記探索範囲に基づいて前記出現順序を推定する、
     請求項1記載の情報処理プログラム。
  4.  前記同一性の判定では、前記第1の類似度と第1の閾値とを比較し、前記第1の類似度が前記第1の閾値を超える場合、前記第2の類似度と第2の閾値とを比較する、
     請求項1記載の情報処理プログラム。
  5.  前記第1の非互換情報が、第1の言語要素から第2の言語要素を探索する第1の探索と、前記第1の言語要素または前記第2の言語要素から第3の言語要素を探索する第2の探索とを規定している場合、前記第1の非互換情報を、前記第1の探索を示す第1の非互換サブ情報と、前記第2の探索を示す第2の非互換サブ情報とに分割する、
     処理を前記コンピュータに更に実行させ、
     前記第1の頻度情報の生成、前記第1の順序情報の生成および前記同一性の判定は、前記第1の非互換サブ情報および前記第2の非互換サブ情報それぞれに対して実行される、
     請求項1記載の情報処理プログラム。
  6.  第1のソフトウェアを使用するソースコードの中から第2のソフトウェアと非互換である記述を探索するための情報であって、2以上の言語要素がもつキーワードと前記2以上の言語要素の位置関係とに対する条件を示す第1の非互換情報を取得し、
     前記第1の非互換情報から2以上のキーワードを抽出し、同一のキーワードの出現頻度に基づく第1の頻度情報を生成し、前記位置関係の条件から推定される前記2以上のキーワードの出現順序を示す第1の順序情報を生成し、
     前記第1の頻度情報と第2の非互換情報に対応する第2の頻度情報との間の第1の類似度と、前記第1の順序情報と前記第2の非互換情報に対応する第2の順序情報との間の第2の類似度とに基づいて、前記第1の非互換情報および前記第2の非互換情報の同一性を判定する、
     処理をコンピュータが実行する情報処理方法。
  7.  第1のソフトウェアを使用するソースコードの中から第2のソフトウェアと非互換である記述を探索するための情報であって、2以上の言語要素がもつキーワードと前記2以上の言語要素の位置関係とに対する条件を示す第1の非互換情報を記憶する記憶部と、
     前記第1の非互換情報から2以上のキーワードを抽出し、同一のキーワードの出現頻度に基づく第1の頻度情報を生成し、前記位置関係の条件から推定される前記2以上のキーワードの出現順序を示す第1の順序情報を生成し、前記第1の頻度情報と第2の非互換情報に対応する第2の頻度情報との間の第1の類似度と、前記第1の順序情報と前記第2の非互換情報に対応する第2の順序情報との間の第2の類似度とに基づいて、前記第1の非互換情報および前記第2の非互換情報の同一性を判定する処理部と、
     を有する情報処理装置。
PCT/JP2021/020615 2021-05-31 2021-05-31 情報処理プログラム、情報処理方法および情報処理装置 WO2022254487A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP21943998.1A EP4350505A1 (en) 2021-05-31 2021-05-31 Information processing program, information processing method, and information processing device
PCT/JP2021/020615 WO2022254487A1 (ja) 2021-05-31 2021-05-31 情報処理プログラム、情報処理方法および情報処理装置
JP2023525135A JPWO2022254487A1 (ja) 2021-05-31 2021-05-31

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/020615 WO2022254487A1 (ja) 2021-05-31 2021-05-31 情報処理プログラム、情報処理方法および情報処理装置

Publications (1)

Publication Number Publication Date
WO2022254487A1 true WO2022254487A1 (ja) 2022-12-08

Family

ID=84323065

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/020615 WO2022254487A1 (ja) 2021-05-31 2021-05-31 情報処理プログラム、情報処理方法および情報処理装置

Country Status (3)

Country Link
EP (1) EP4350505A1 (ja)
JP (1) JPWO2022254487A1 (ja)
WO (1) WO2022254487A1 (ja)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001100998A (ja) 1999-09-29 2001-04-13 Hitachi Software Eng Co Ltd 計算機システム
JP2011095856A (ja) 2009-10-27 2011-05-12 Nec Corp 情報開示活性化システム、情報開示活性化方法およびプログラム
JP2012113536A (ja) 2010-11-25 2012-06-14 Hitachi Ltd システム移行支援装置および支援方法
JP2018181121A (ja) * 2017-04-18 2018-11-15 富士通株式会社 分析装置、分析プログラム及び分析方法
KR102125010B1 (ko) * 2020-03-17 2020-06-19 김명훈 데이터베이스 전환 분석 시스템 및 방법
KR20200080073A (ko) * 2018-12-26 2020-07-06 한남대학교 산학협력단 데이터베이스 전환 시스템 및 이를 이용한 데이터베이스 전환 방법

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001100998A (ja) 1999-09-29 2001-04-13 Hitachi Software Eng Co Ltd 計算機システム
JP2011095856A (ja) 2009-10-27 2011-05-12 Nec Corp 情報開示活性化システム、情報開示活性化方法およびプログラム
JP2012113536A (ja) 2010-11-25 2012-06-14 Hitachi Ltd システム移行支援装置および支援方法
JP2018181121A (ja) * 2017-04-18 2018-11-15 富士通株式会社 分析装置、分析プログラム及び分析方法
KR20200080073A (ko) * 2018-12-26 2020-07-06 한남대학교 산학협력단 데이터베이스 전환 시스템 및 이를 이용한 데이터베이스 전환 방법
KR102125010B1 (ko) * 2020-03-17 2020-06-19 김명훈 데이터베이스 전환 분석 시스템 및 방법

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FUMITO KONAKATAKAO MIURA: "Proposal of Semantic Similarity Method in Consideration of Arrangement of Words", 7TH FORUM ON DATA ENGINEERING AND INFORMATION MANAGEMENT (DEIM2015, 2 March 2015 (2015-03-02)
KONAKA, FUMITO: "Proposal of semantic similarity method considering word sequence", THE 7TH FORUM ON DATA ENGINEERING AND INFORMATION MANAGEMENT (THE 13TH ANNUAL CONFERENCE OF THE DATABASE SOCIETY OF JAPAN) BANDAI ATAMI HOTEL HANANOYU (FUKUSHIMA PREFECTURE)., 18 August 2015 (2015-08-18) - 4 March 2015 (2015-03-04), JP, pages 1 - 5, XP009541771 *

Also Published As

Publication number Publication date
EP4350505A1 (en) 2024-04-10
JPWO2022254487A1 (ja) 2022-12-08

Similar Documents

Publication Publication Date Title
US10169337B2 (en) Converting data into natural language form
Kim et al. Identifying and summarizing systematic code changes via rule inference
JP3963394B2 (ja) ソフトウェア障害情報をレポートするための装置
JPH06266780A (ja) 意味パターン認識による文字列検索方法及びその装置
KR101554424B1 (ko) 테스트 케이스 생성 자동화 방법 및 장치
US9311077B2 (en) Identification of code changes using language syntax and changeset data
CN115309451A (zh) 代码克隆检测方法、装置、设备、存储介质及程序产品
CN115291854A (zh) 代码补全方法、装置及设备
CN109947711B (zh) 一种对ios项目开发过程中的多语言文件自动化管理方法
EP4226240A1 (en) Natural language processing of api specifications for automatic artifact generation
Zhang et al. An Accurate Identifier Renaming Prediction and Suggestion Approach
WO2022254487A1 (ja) 情報処理プログラム、情報処理方法および情報処理装置
CN113821496B (zh) 数据库迁移方法、系统、设备及计算机可读存储介质
US20230062336A1 (en) String localization for universal use
WO2022195726A1 (ja) 情報処理プログラム、情報処理方法および情報処理装置
CN112231278A (zh) 项目工程文件的分析方法、装置、设备及存储介质
WO2022254504A1 (ja) 情報処理プログラム、情報処理方法および情報処理装置
JP2003345626A (ja) プロダクト・ナレッジ管理のためのナレッジ・オートメーション・エンジン
Wang et al. Formalism for detecting version differences in data models
JP5409039B2 (ja) 情報処理装置及び情報処理方法及びプログラム
JP7365446B2 (ja) モデルライフサイクル管理のために再利用解析を実行するための方法及びシステム
WO2022264316A1 (ja) 情報処理プログラム、情報処理方法および情報処理装置
JP6281239B2 (ja) プログラム開発サポート装置および方法
JP2011113298A (ja) 流用ソースコード解析システム及びプログラム並びに記録媒体
JP5342508B2 (ja) 情報処理装置及び情報処理方法及びプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21943998

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023525135

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 2021943998

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2021943998

Country of ref document: EP

Effective date: 20240102