Disclosed herein are a system, non-transitory computer readable medium and method for fulfilling requests for source code. A description is associated with each section of source code text. A section of source code, whose description at least partially matches a source code request, is obtained and displayed.
|
8. A method comprising:
generating, using at least one processor, a descriptor for each section of text in a plurality of source code text files stored in a repository;
accessing, using the at least one processor, a search request for source code that performs a particular task when executed by a computer; and
displaying, using the at least one processor, each of the sections of text whose descriptor at least partially matches keywords in the search request, the displayed sections being adaptable for constructing at least part of the requested source code.
5. A non-transitory computer readable medium having instructions therein which, if executed, cause at least one processor to:
generate a natural language description for each section of text in a plurality of source code files, wherein to generate the natural language description for each section, the at least one processor is to delineate each section of the source code text in the source code files, wherein each delineated section of the source code text is substantially similar to a predefined source code template;
parse a request for a particular type of source code text that specifies a particular action to be performed by a computer; and
obtain each section of text whose description at least partially matches the parsed request, each obtained section being adaptable for generating at least some of the type of source code text requested.
1. A system comprising:
a repository to store source code text, the source code text comprising a plurality of sections;
an indexer module which, if executed, instructs at least one processor to associate each section with a descriptor comprising a natural language description of a respective section,
wherein to associate each section with the descriptor, a source code analyzer which, if executed, instructs the at least one processor to delineate each section in the source code text, wherein each delineated section of the source code text is substantially similar to a predefined source code template; and
a searcher module which, if executed, instructs the at least one processor to read a request for a particular type of source code and to obtain each section of the stored source code text whose descriptor at least partially matches the request, each obtained section being adaptable for producing at least some of the type of source code requested.
2. The system of
3. The system of
4. The system of
6. The non-transitory computer readable medium of
7. The non-transitory computer readable medium of
9. The method of
10. The method of
11. The method of
12. The method of
13. The method of
|
Source code contains a collection of high level computer instructions that may be readable by humans. Some source code may be re-used and incorporated into other programming modules. For example, some predefined objects, functions or queries may be imported into another program.
As noted above, some source code may be re-used and incorporated into other programming modules. Software developers may query leading commercial search engines to obtain recyclable source code. However, conventional search engines may compare key words in the query to the actual source code text. Unfortunately, the functionality of the source code may not be discernable from the source code text. That is, the source code may be written in a non-descriptive manner using cryptic programming language expressions. Thus, the source code may not be comparable to a query or request written by a human user. Furthermore, there may be smaller more precise sections of source code that may be beneficial to a user's search, but may be difficult to detect using conventional search tools.
In view of the foregoing, disclosed herein are a system, non-transitory computer readable medium, and method to fulfill requests for source code. In one example, a natural language description may be associated with each section of source code. In a further example, a section of source code, whose description at least partially matches a source code request, may be obtained and displayed. Rather than comparing the language of a user submitted request to cryptic source code expressions, the request may be compared to a natural language description of the source code expressions. Thus, the techniques disclosed herein may increase the likelihood of finding a particular type of source code notwithstanding the cryptic nature thereof. The aspects, features and advantages of the present disclosure will be appreciated when considered with reference to the following description of examples and accompanying figures. The following description does not limit the application; rather, the scope of the disclosure is defined by the appended claims and equivalents.
The computer apparatus 100 may also contain a processor 110, which may be any number of well known processors, such as processors from Intel® Corporation. In another example, processor 110 may be an application specific integrated circuit (“ASIC”). Non-transitory computer readable medium (“CRM”) 112 may store instructions that may be retrieved and executed by processor 110. As will be described in more detail below, the instructions may include an indexer module 116 and a searcher module 118. Furthermore, non-transitory CRM 112 may include a source code repository 114 that may be accessed by processer 110. In one example, non-transitory CRM 112 may be used by or in connection with any instruction execution system that can fetch or obtain the logic from non-transitory CRM 112 and execute the instructions contained therein.
Non-transitory computer readable media may comprise any one of many physical media such as, for example, electronic, magnetic, optical, electromagnetic, or semiconductor media. More specific examples of suitable non-transitory computer-readable media include, but are not limited to, a portable magnetic computer diskette such as floppy diskettes or hard drives, a read-only memory (“ROM”), an erasable programmable read-only memory, a portable compact disc or other storage devices that may be coupled to computer apparatus 100 directly or indirectly. Alternatively, non-transitory CRM 112 may be a random access memory (“RAM”) device or may be divided into multiple memory segments organized as dual in-line memory modules (“DIMMs”). The non-transitory CRM 112 may also include any combination of one or more of the foregoing and/or other devices as well. While only one processor and one non-transitory CRM are shown in
The instructions residing in non-transitory CRM 112 may comprise any set of instructions to be executed directly (such as machine code) or indirectly (such as scripts) by processor 110. In this regard, the terms “instructions,” “scripts,” and “applications” may be used interchangeably herein. The computer executable instructions may be stored in any computer language or format, such as in object code or modules of source code. Furthermore, it is understood that the instructions may be implemented in the form of hardware, software, or a combination of hardware and software and that the examples herein are merely illustrative.
Source code repository 114 may be utilized to store source code text and its associations with natural language descriptions. The architecture of source code repository 114 is not limited by any particular data structure. The data may be stored in volatile or non-volatile computer registers; in a relational database as a table having a plurality of different fields and records; XML or JSON documents; graph or array structures; or flat source code text files. Furthermore, source code repository 114 may also be stored in a cloud system. In one example, the source code text may comprise a plurality of sections. As will be explained further below, each section of text may correspond to a source code template. Indexer module 116 may instruct processor 110 to associate each section with a descriptor that may comprise a natural language description of a respective section. In a further example, searcher module 118 may instruct processor 110 to read a request for a particular type of source code and to obtain each section of the stored source code text whose descriptor at least partially matches the request. Each section obtained by searcher module 118 may be adaptable for producing at least some of the type of source code requested.
In addition to the modules shown in
Working examples of the system, method, and non-transitory computer-readable medium are shown in
As shown in block 202 of
Referring back to
With regard to source code request 302, certain keywords may be parsed therefrom (e.g., “galaxies,” “not bright” and “not saturated”). These parsed keywords partially match natural language description 308; thus, the source code section associated therewith (i.e., source code section 310) may be displayed to the requester. Since the source code is not an exact match (i.e., the returned code contains an extra condition requiring galaxies that are not “EDGE”), the user may edit the code accordingly.
Regarding source code request 304, the language therein at least partially matches descriptor 312 and descriptor 328. The source code sections associated with these two descriptors (i.e., source code section 314 and source code section 330 respectively) may be displayed to a user. As with source code request 302, these source code sections are not an exact match (i.e., descriptor 312 recites “Galaxies that are not bright”), but they may be edited to produce the type of source code sought out by the requestor. In a further example, each obtained section of source code text may be ranked in accordance with the similarity between the request and the natural language description of each section. In one example, the similarity may be measured using a similarity function, such as a cosine similarity function.
SELECT TOP 1000 galID
FROM galaxy g, galaxySpecs gs
WHERE g.galID=gs.galID
AND gs.characteristics=fSetCharact(‘SATURATED’)
AND g.petroRad<18
Each node of graph 500 of
Graph 524 may represent the following predefined source code template:
“g.galID=gs.galID AND gs.characteristics=fSetCharact(‘+val+’)”
In the template above, “val” is a variable whose value may be specified in source code that substantially matches the template. The above template may be associated with a predefined natural language description, “galaxies that are ‘+VAL’.” In graph 524, node 526 represents the table “galaxy;” node 528 represents the field “galID” belonging to the table “galaxy;” node 530 represents the “galID” field belonging to the table “galaxyspecs;” node 532 represents the table “galaxyspecs;” node 534 represents the field named “characteristics” belonging to the table “galaxyspecs;” node 536 represents the “=” symbol; node 538 represents the function “fSetCharact”; and, node 540 represents the variable “VAL,” which is a variable parameter for the function “fSetCharact.”
Referring back to
Advantageously, the foregoing system, method, and non-transitory computer readable medium serves source code queries or requests with more precise results. Rather than comparing an incoming query to cryptic source code expressions, the queries are compared to natural language descriptions of the code. In this regard, descriptions may be generated for smaller sections of source code that may be adaptable for producing at least some of the type of source code requested. Furthermore, the techniques disclosed herein may accommodate a request for source code by returning multiple fragments of code from multiple source code expressions. In turn, the requester may combine or edit these multiple fragments as needed. These multiple sections may originate from different code expressions and may be displayed in an order that is in accordance with the similarity between the requests and the descriptions. Thus, if the request can be partially met with smaller sections of source code (e.g., s1 and s2), but a third section cannot be found, then the response to the request may contain an ordered combination of code sections as follows: s1, missing-part, s2. The user may subsequently complete the missing portion. As such, the system, non-transitory computer readable medium, and method disclosed herein may assist a developer of computer software and promotes more efficient software development.
Although the disclosure herein has been described with reference to particular examples, it is to be understood that these examples are merely illustrative of the principles of the disclosure. It is therefore to be understood that numerous modifications may be made to the examples and that other arrangements may be devised without departing from the spirit and scope of the disclosure as defined by the appended claims. Furthermore, while particular processes are shown in a specific order in the appended drawings, such processes are not limited to any particular order unless such order is expressly set forth herein; rather, processes may be performed in a different order or concurrently and steps may be added or omitted.
Simitsis, Alkiviadis, Koutrika, Georgia
Patent | Priority | Assignee | Title |
11176329, | Feb 18 2020 | Bank of America Corporation | Source code compiler using natural language input |
11657232, | Feb 18 2020 | Bank of America Corporation | Source code compiler using natural language input |
Patent | Priority | Assignee | Title |
6144958, | Jul 15 1998 | A9 COM, INC | System and method for correcting spelling errors in search queries |
6446064, | Jun 08 1999 | GO ALBERT FRANCE | System and method for enhancing e-commerce using natural language interface for searching database |
7389224, | Mar 01 1999 | Canon Kabushiki Kaisha | Natural language search method and apparatus, including linguistically-matching context data |
7774198, | Oct 06 2006 | Xerox Corporation | Navigation system for text |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Mar 14 2013 | KOUTRIKA, GEORGIA | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 030026 | /0874 | |
Mar 14 2013 | SIMITSIS, ALKIVIADIS | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 030026 | /0874 | |
Mar 15 2013 | ENTIT SOFTWARE LLC | (assignment on the face of the patent) | / | |||
Oct 27 2015 | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | Hewlett Packard Enterprise Development LP | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 037079 | /0001 | |
Apr 05 2017 | Hewlett Packard Enterprise Development LP | ENTIT SOFTWARE LLC | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 042746 | /0130 | |
Sep 01 2017 | NetIQ Corporation | JPMORGAN CHASE BANK, N A | SECURITY INTEREST SEE DOCUMENT FOR DETAILS | 044183 | /0718 | |
Sep 01 2017 | MICRO FOCUS US , INC | JPMORGAN CHASE BANK, N A | SECURITY INTEREST SEE DOCUMENT FOR DETAILS | 044183 | /0718 | |
Sep 01 2017 | MICRO FOCUS SOFTWARE, INC | JPMORGAN CHASE BANK, N A | SECURITY INTEREST SEE DOCUMENT FOR DETAILS | 044183 | /0718 | |
Sep 01 2017 | ENTIT SOFTWARE LLC | JPMORGAN CHASE BANK, N A | SECURITY INTEREST SEE DOCUMENT FOR DETAILS | 044183 | /0718 | |
Sep 01 2017 | ARCSIGHT, LLC | JPMORGAN CHASE BANK, N A | SECURITY INTEREST SEE DOCUMENT FOR DETAILS | 044183 | /0718 | |
Sep 01 2017 | SERENA SOFTWARE, INC | JPMORGAN CHASE BANK, N A | SECURITY INTEREST SEE DOCUMENT FOR DETAILS | 044183 | /0718 | |
Sep 01 2017 | Borland Software Corporation | JPMORGAN CHASE BANK, N A | SECURITY INTEREST SEE DOCUMENT FOR DETAILS | 044183 | /0718 | |
Sep 01 2017 | Attachmate Corporation | JPMORGAN CHASE BANK, N A | SECURITY INTEREST SEE DOCUMENT FOR DETAILS | 044183 | /0718 | |
May 23 2019 | ENTIT SOFTWARE LLC | MICRO FOCUS LLC | CHANGE OF NAME SEE DOCUMENT FOR DETAILS | 050004 | /0001 | |
Jan 31 2023 | JPMORGAN CHASE BANK, N A | MICRO FOCUS LLC F K A ENTIT SOFTWARE LLC | RELEASE OF SECURITY INTEREST REEL FRAME 044183 0718 | 062746 | /0399 | |
Jan 31 2023 | JPMORGAN CHASE BANK, N A | Borland Software Corporation | RELEASE OF SECURITY INTEREST REEL FRAME 044183 0718 | 062746 | /0399 | |
Jan 31 2023 | JPMORGAN CHASE BANK, N A | MICRO FOCUS US , INC | RELEASE OF SECURITY INTEREST REEL FRAME 044183 0718 | 062746 | /0399 | |
Jan 31 2023 | JPMORGAN CHASE BANK, N A | SERENA SOFTWARE, INC | RELEASE OF SECURITY INTEREST REEL FRAME 044183 0718 | 062746 | /0399 | |
Jan 31 2023 | JPMORGAN CHASE BANK, N A | Attachmate Corporation | RELEASE OF SECURITY INTEREST REEL FRAME 044183 0718 | 062746 | /0399 | |
Jan 31 2023 | JPMORGAN CHASE BANK, N A | MICRO FOCUS SOFTWARE INC F K A NOVELL, INC | RELEASE OF SECURITY INTEREST REEL FRAME 044183 0718 | 062746 | /0399 | |
Jan 31 2023 | JPMORGAN CHASE BANK, N A | NetIQ Corporation | RELEASE OF SECURITY INTEREST REEL FRAME 044183 0718 | 062746 | /0399 | |
Jan 31 2023 | JPMORGAN CHASE BANK, N A | MICRO FOCUS LLC F K A ENTIT SOFTWARE LLC | RELEASE OF SECURITY INTEREST REEL FRAME 044183 0577 | 063560 | /0001 |
Date | Maintenance Fee Events |
Jul 12 2021 | REM: Maintenance Fee Reminder Mailed. |
Dec 27 2021 | EXP: Patent Expired for Failure to Pay Maintenance Fees. |
Date | Maintenance Schedule |
Nov 21 2020 | 4 years fee payment window open |
May 21 2021 | 6 months grace period start (w surcharge) |
Nov 21 2021 | patent expiry (for year 4) |
Nov 21 2023 | 2 years to revive unintentionally abandoned end. (for year 4) |
Nov 21 2024 | 8 years fee payment window open |
May 21 2025 | 6 months grace period start (w surcharge) |
Nov 21 2025 | patent expiry (for year 8) |
Nov 21 2027 | 2 years to revive unintentionally abandoned end. (for year 8) |
Nov 21 2028 | 12 years fee payment window open |
May 21 2029 | 6 months grace period start (w surcharge) |
Nov 21 2029 | patent expiry (for year 12) |
Nov 21 2031 | 2 years to revive unintentionally abandoned end. (for year 12) |