Abstract: A method and system is provided for generic model based multilingual source code instrumentation. Particularly, the invention provides a method and system for parsing the multilingual source code; creating an intermediate representation (IR) model for each of the programming language present in said parsed multilingual source code, wherein an instance of an unified programming model (UPLM) is created by loading all IR models created; inserting a language independent probe code to said UPLM; unparsing each of the IR model present in said probed UPLM to the multilingual source code; and executing the said unparsed multilingual source code.
FORM 2
THE PATENTS ACT, 1970
(39 of 1970)
&
THE PATENT RULES, 2003
COMPLETE SPECIFICATION
(See Section 10 and Rule 13)
Title of invention:
A METHOD AND SYSTEM FOR GENERIC MODEL BASED MULTILINGUAL SOURCE CODE INSTRUMENTATION
Applicant:
TATA Consultancy Services Limited A company Incorporated in India under The Companies Act, 1956
Having address:
Nirmal Building, 9th Floor,
Nariman Point, Mumbai 400021,
Maharashtra, India
The following specification particularly describes the invention and the manner in which it is to be performed.
FIELD OF THE INVENTION
The invention generally relates to source code instrumentation. Particularly the invention relates to generic model based multilingual source code instrumentation.
BACKGROUND OF THE INVENTION
Software developers often need to monitor the dynamic behaviour of program. This monitoring could be for dynamic analysis, debugging or testing purposes. In order to make the monitoring easy, program instrumentation mechanism is used. Program instrumentation is an activity which inserts a set of probes in program to enable information gathering that would be useful for monitoring the behaviour of program. A probe can be defined as a monitor call to track a particular entity in the program. These probes are placed at different program points. When the inserted probes execute at the same time as the program, program instrumentation tools and techniques ensure that this does not have an impact on the output of the program.
Program instrumentation techniques can be categorized on the basis of how the instrumentation is performed. First, source code instrumentation is performed at source level. This technique generally suffers from the problem of the need to support multiple languages and their dialects. Second, byte code instrumentation is performed at byte code level. This type of instrumentation is for Java and .NET programs. The underlying assumption is that while the language may evolve, its byte code architecture is unlikely to change as frequently, making the instrumentation technique and tool more easily usable. Third, binary instrumentation is done at object code level which would be executed dynamically.
There are various popular open source and commercial instrumentation tools available in market such as Cobertura, which is a bytecode instrumentation tool
developed for Java and supports statement and condition coverage instrumentation. Cobertura has been developed exclusively for Java programs and hence cannot be used for other languages. Conventional approach involves instrumentation tool developed for specific languages. The overhead of the instrumentation is also significantly less. Languages like C/C++/COBOL are compiled, and therefore every platform poses a challenge. Instrumentation of such languages is usually at source code level. An additional challenge from an instrumentation tool perspective is that each compiler supports its own language.
There is large number of systems developed in enormous number of languages. Also people work with project teams maintaining large legacy systems developed in languages like COBOL, (PLI) and as well as systems built using C/C++, Java, VB, Java script, C# among other languages. To maintain such applications there are number of dynamic program analysis, program transformation, testing and test selection tools. One of the challenges that developers face, is that there is no single instrumentation tool that supports all or even a large number of languages that they deal with. Working with multiple tools on multiple platforms is a challenge as they not only work at different levels and provide different kinds of instrumentation, they also produce different output. Using output from multiple tools is time and effort intensive and hampers us from providing generic solutions; it is also a potential cause of defects.
Hence there is a long standing need to develop a generic model based instrumentation tool which could support all or even a large number of multiple languages in source programs for instrumentation.
There is also a need to device a language independent probe code. Thus, it is evident that, there is a need for a solution that provides generic model based multilingual source code instrumentation by inserting a language independent probe code.
OBJECTS OF THE INVENTION
In accordance with the present invention, the primary objective is to provide a method and system for generic model based multilingual source code instrumentation by inserting a language independent probe code.
Another objective of the invention is to provide a method and system for parsing the multilingual source code using language specific parsers.
Another objective of the invention is to provide a method and system for creating an intermediate representation (IR) model for each of the programming language present in said parsed multilingual source code, wherein an instance of a unified programming model (UPLM) is created by loading all IR models created.
Another objective of the invention is to provide a method and system for inserting said language independent probe code to said UPLM and further assigning a unique identifier to each of the IR model present in said probed UPLM for monitoring.
Another objective of the invention is to provide a method and system for unparsing each of the IR model present in said probed UPLM to the multilingual source code.
Another objective of the invention is to provide a method and system for executing the said unparsed multilingual source code.
SUMMARY OF THE INVENTION
Before the present methods, systems, and hardware enablement are described, it is to be understood that this invention in not limited to the particular systems, and methodologies described, as there can be multiple possible embodiments of the
present invention which are not expressly illustrated in the present disclosure. It is also to be understood that the terminology used in the description is for the purpose of describing the particular versions or embodiments only, and is not intended to limit the scope of the present invention.
The present invention provides a method and system for generic model based multilingual source code instrumentation by inserting a language independent probe code.
In an embodiment of the invention a method is provided for parsing the multilingual source code using language specific parsers; creating an intermediate representation (IR) model for each of the programming language present in said parsed multilingual source code, wherein an instance of an unified programming model (UPLM) is created by loading all JR models created; inserting a language independent probe code to said UPLM and further assigning a unique identifier to each of the IR model present in said probed UPLM for monitoring; unparsing each of the IR model present in said probed UPLM to the multilingual source code; and executing the said unparsed multilingual source code.
In an embodiment of the invention a system is provided for generic model based multilingual source code instrumentation by inserting a language independent probe code, wherein the said system is comprises of an input module (302); a parser module (304); a intermediate representation (IR) model formation module (306); an instrumentor module (308); an unparser module (310); and a program executor module (312).
The above said method and system are preferably for generic model based multilingual source code instrumentation by inserting a language independent probe code but also may be used for many other applications.
BRIEF DESCRIPTION OF DRAWINGS
The foregoing summary, as well as the following detailed description of preferred embodiments, is better understood when read in conjunction with the appended drawings. For the purpose of illustrating the invention, there is shown in the drawings example constructions of the invention; however, the invention is not limited to the specific methods and apparatus disclosed in the drawings:
Figure 1 shows a flowchart (100) illustrating the method for generic model based multilingual source code instrumentation.
Figure 2 shows a Prior Art block diagram illustrating the system architecture for conventional source code instrumentation framework (200).
Figure 3 shows a block diagram illustrating the system architecture for generic model based multilingual source code instrumentation framework (300).
Figure 4 shows a block diagram (400) illustrating the system architecture of an instrumentor module (310).
DETAILED DESCRIPTION OF THE INVENTION
Some embodiments of this invention, illustrating its features, will now be discussed:
The words "comprising," "having," "containing," and "including," and other forms thereof, are intended to be equivalent in meaning and be open ended in that an item or items following any one of these words is not meant to be an exhaustive listing of such item or items, or meant to be limited to only the listed item or items.
It must also be noted that as used herein, the singular forms "a," "an," and "the" include plural references unless the context clearly dictates otherwise. Although any systems, methods, apparatuses, and devices similar or equivalent to those described herein can be used in the practice or testing of embodiments of the present invention, the preferred, systems and parts are now described. The disclosed embodiments are merely exemplary of the invention, which may be embodied in various forms.
The disclosed embodiments are merely exemplary of the invention, which may be embodied in various forms.
The present application provides a method for generic model based multilingual source code instrumentation, characterized in inserting a language independent probe code to parsed multilingual source code, the method comprises processor implemented steps of:
a. inputting said multilingual source code using an input module (302);
b. parsing the multilingual source code using a parser module (304);
c. creating an intermediate representation (IR) model for each of the
programming language present in said parsed multilingual source code,
wherein an instance of an unified programming model (UPLM) is created
by loading all IR models created using an intermediate representation (IR)
model formation module (306);
d. inserting said language independent probe code to said UPLM and further
assigning a unique identifier to each of the IR model present in said
probed UPLM for monitoring using an instrumentor module (308);
e. unparsing each of the IR model present in said probed UPLM to the
multilingual source code using an unparser module (310); and
f. executing the said unparsed multilingual source code using an executor
module (312).
The present application provides a system for generic model based multilingual source code instrumentation, characterized by inserting a language independent probe code to parsed multilingual source code, the system comprises:
a. an input module (302) adapted to input said multilingual source code;
b. a parser module (304) adapted to parse the multilingual source code;
c. an intermediate representation (IR) model formation module (306) adapted
to create an intermediate representation (IR) model for each of the
programming language present in said parsed multilingual source code,
wherein an instance of an unified programming model (UPLM) is created
by loading all IR models created;
d. an instrumentor module (308) adapted to insert said language independent
probe code to said UPLM and further assigning a unique identifier to each
of the IR model present in said probed UPLM for monitoring;
e. an unparser module (310) adapted to unparse each of the IR model present
in said probed UPLM to the multilingual source code; and
f. an executor module (312) adapted to execute the said unparsed
multilingual source code.
Referring to Figure 1 is a flowchart (100) illustrating the method for generic model based multilingual source code instrumentation.
The process starts at the step 102, multilingual source code is inputted. At the step 104, the inputted multilingual source code is parsed. At the step 106, an intermediate representation (IR) model is created for each of the programming language present in said parsed multilingual source code and an instance of a unified programming model (UPLM) is created by loading all IR models created. At the step 110, a language independent probe code is inserted to said UPLM. At the step 112, each of the IR model present in said probed UPLM is unparsed to the multilingual source code. The process ends at the step 114, the said unparsed multilingual source code is executed.
Referring to Figure 2 is a Prior Art block diagram illustrating the system architecture for conventional source code instrumentation framework (200).
The conventional source code instrumentation framework (200) which utilizes IR representation may comprises of an input module (202); a parser module (204); an intermediate representation (IR) module (206); a language specific probe instrumentor module (208); an unparser module (210); and a program executor module (212).
The input module (202) of the conventional source code instrumentation framework (200) is adapted to take input of source code. The inputted source code may be written in a single programming language or a plurality of programming languages. The parser module (204) is employed to parse the inputted source code using a plurality of language specific parsers. The parsing of the source code produces an Abstract Syntax Tree (AST) and Symbol Table (ST) as an output. The declarations in the source code provide detail of data being used and its type. Further this information is captured in the Symbol Table (ST). The computations and control flow in the source code are represented by the Abstract Syntax Tree (AST). The output of parser module (204) is utilized by the intermediate representation (IR) module (206) for storing the AST and the ST of each inputted source code. The IR Module (206) provides the parsed source code to the language specific probe inserter module (208). The language specific probe inserter module (208) inserts language specific probe code to the parsed source code stored IR module (206). The language specific probe inserter module (208) further monitors probed code by executing the language specific probed IR code. The language specific probed IR code is unparsed using the Unparser module (210). The unparser module (210) comprises of the plurality of language specific Unparsers. The unparser module (210) unparses the language specific probed IR code back to the original inputted software program. The language specific probed IR (208) is unparsed back to source code using a pretty printer. The unparsed code is executed using the program executor module (212).
Referring to Figure 3 is a block diagram illustrating the system architecture for generic model based multilingual source code instrumentation framework (300).
The generic model based multilingual source code instrumentation framework (300) comprises of an input module (302); a parser module (304); an intermediate representation (IR) model formation module (306); an instrumentor module (308); an unparser module (310); and a program executor module (312).
In an embodiment of the present invention, the input module (302) is adapted to take multilingual source code as input. The inputted multilingual source code may be written in a single programming language or may be of multiple programming languages. The inputted multilingual source code is further given to the parser module (304) for parsing.
In an embodiment of the present invention, the parser module (304) is comprises of a plurality of language specific parsers for parsing the multilingual source code. The parsing of the multilingual source code produces an Abstract Syntax Tree (AST) and Symbol Table (ST) as an output. The symbol table (ST) is adapted to capture declaration of a program in any of the programming language of the multilingual source code, wherein the declaration provides details of data being used and its type in the said program. The AST is representing computation and control flow of the program in any of the programming language of the multilingual source code.
In an embodiment of the present invention, the intermediate representation (IR) model formation module (306) creates an intermediate representation (IR) model for each of the programming language present in said parsed multilingual source code. The intermediate representation (IR) model formation module (306) is adapted to store the AST and the ST of each programming language present in said inputted multilingual source code separately. Further, an instance of a unified programming model (UPLM) is created by loading all IR models created using
the intermediate representation (IR) model formation module (306). The intermediate representation (IR) model formation module (306) contains all constructs belonging to all languages of the said inputted multilingual source code.
In an embodiment of the present invention, the instrumentor module (308) inserts said language independent probe code to said UPLM and further assigns a unique identifier to each of the IR model present in said probed UPLM for monitoring. The language independent probe code is the instrumentation probe or software code, which acts as a monitor call that is inserted at appropriate program points in the IR model present in said probed UPLM. The instrumentor module (308) is further adapted to assign a unique identifier to each of the IR model present in said probed UPLM. The instrumentor module (308) further monitors the IR model present in said probed UPLM for execution.
In an embodiment of the present invention, the unparser module (310) unparses each of the IR model present in said probed UPLM to the multilingual source code using a pretty printer. The unparser module (310) comprises of language specific unparsers for unparsing each of the IR model present in said probed UPLM to the multilingual source code.
In an embodiment of the present invention, the executor module (312) executes the said unparsed multilingual source code. The executor module (312) produces an output of the inputted multilingual source code and generates a coverage report of the execution of the said unparsed multilingual source code. The executor module (312) is further adapted to compile and debug the unparsed multilingual source code.
Referring to Figure 4 is a block diagram (400) illustrating the system architecture of an instrumentor module (308).
The instrumentor module (308) is further comprises of language independent probe inserter and tagging module (402) and probe monitoring module (404).
In an embodiment of the present invention, the language independent probe inserter and tagging module (402) traverses the ST and AST which are formed in IR model present in said probed UPLM. The language independent probes are inserted at appropriate locations in the IR model present in said probed UPLM. The language independent probe inserter and tagging module (402) assigns a unique identifier to each of the IR model present in said probed UPLM for monitoring. IR model present in said probed UPLM is further monitored using the probe monitoring module (404). The probe monitoring module (404) receives the tagged IR model present in said probed UPLM for execution and analysis.
WE CLAIM:
1. A method for generic model based multilingual source code
instrumentation, characterized in inserting a language independent probe
code to parsed multilingual source code, the method comprises processor
implemented steps of:
a. inputting said multilingual source code using an input module
(302);
b. parsing the multilingual source code using a parser module
(304);
c. creating an intermediate representation (IR) model for each of
the programming language present in said parsed multilingual
source code, wherein an instance of an unified programming
model (UPLM) is created by loading all IR models created
using an intermediate representation (IR) model formation
module (306);
d. inserting said language independent probe code to said UPLM
and further assigning a unique identifier to each of the IR
model present in said probed UPLM for monitoring using an
instrumentor module (308);
e. unparsing each of the IR model present in said probed UPLM
to the multilingual source code using an unparser module
(310); and
f. executing the said unparsed multilingual source code using an
executor module (312).
2. The method as claimed in claim I, wherein a plurality of language specific
parser is used for parsing the multilingual source code
3. The method as claimed in claim 1, wherein the intermediate representation (IR) model further comprises of a symbol table (ST) and an abstract syntax tree (AST).
4. The method as claimed in claim 4, wherein the symbol table (ST) is adapted to capture declaration of a program in any of the programming language of the multilingual source code, wherein the declaration provides details of data being used and its type in the said program.
5. The method as claimed in claim 4, wherein the AST is representing computation and control flow of the program in any of the programming language of the multilingual source code.
6. The method as claimed in claim 1, wherein the insertion of the language independent probe code to said UPLM is carried out by traversing the ST and AST.
7. The method as claimed in claim 1, wherein a plurality of language specific unparser is used for unparsing the each of the IR model present in said probed UPLM to the multilingual source code.
8. The method as claimed in claim 1, further comprises of compilation and debugging of the unparsed multilingual source code.
9. A system for generic model based multilingual source code instrumentation, characterized by inserting a language independent probe code to parsed multilingual source code, the system comprises:
a. an input module (302) adapted to input said multilingual source code;
b. a parser module (304) adapted to parse the multilingual source
code;
c. an intermediate representation (IR) model formation module
(306) adapted to create an intermediate representation (IR)
model for each of the programming language present in said
parsed multilingual source code, wherein an instance of an
unified programming model (UPLM) is created by loading all
IR models created;
d. an instrumentor module (308) adapted to insert said language
independent probe code to said UPLM and further assigning a
unique identifier to each of the IR model present in said probed
UPLM for monitoring;
e. an unparser module (310) adapted to unparse each of the IR
model present in said probed UPLM to the multilingual source
code; and
f. an executor module (312) adapted to execute the said unparsed
multilingual source code.
10. The system as claimed in claim 9, wherein the parser module (304) is further comprises of a plurality of language specific parser.
11. The system as claimed in claim 9, wherein the unparser module (310) is further comprises of a plurality of language specific unparser.
| # | Name | Date |
|---|---|---|
| 1 | 1401-MUM-2012-IntimationOfGrant26-05-2022.pdf | 2022-05-26 |
| 1 | ABSTRACT1.jpg | 2018-08-11 |
| 2 | 1401-MUM-2012-FORM 3.pdf | 2018-08-11 |
| 2 | 1401-MUM-2012-PatentCertificate26-05-2022.pdf | 2022-05-26 |
| 3 | 1401-MUM-2012-Response to office action [25-05-2022(online)].pdf | 2022-05-25 |
| 3 | 1401-MUM-2012-FORM 26(29-5-2012).pdf | 2018-08-11 |
| 4 | 1401-MUM-2012-US(14)-HearingNotice-(HearingDate-27-04-2021).pdf | 2021-10-03 |
| 4 | 1401-MUM-2012-FORM 2.pdf | 2018-08-11 |
| 5 | 1401-MUM-2012-Written submissions and relevant documents [12-05-2021(online)].pdf | 2021-05-12 |
| 5 | 1401-MUM-2012-FORM 18.pdf | 2018-08-11 |
| 6 | 1401-MUM-2012-FORM 1.pdf | 2018-08-11 |
| 6 | 1401-MUM-2012-Correspondence to notify the Controller [24-04-2021(online)].pdf | 2021-04-24 |
| 7 | 1401-MUM-2012-FORM-26 [24-04-2021(online)].pdf | 2021-04-24 |
| 7 | 1401-MUM-2012-FORM 1(4-6-2012).pdf | 2018-08-11 |
| 8 | 1401-MUM-2012-FER.pdf | 2018-08-11 |
| 8 | 1401-MUM-2012-CLAIMS [17-01-2019(online)].pdf | 2019-01-17 |
| 9 | 1401-MUM-2012-COMPLETE SPECIFICATION [17-01-2019(online)].pdf | 2019-01-17 |
| 9 | 1401-MUM-2012-DRAWING.pdf | 2018-08-11 |
| 10 | 1401-MUM-2012-DESCRIPTION(COMPLETE).pdf | 2018-08-11 |
| 10 | 1401-MUM-2012-FER_SER_REPLY [17-01-2019(online)].pdf | 2019-01-17 |
| 11 | 1401-MUM-2012-CORRESPONDENCE.pdf | 2018-08-11 |
| 11 | 1401-MUM-2012-OTHERS [17-01-2019(online)].pdf | 2019-01-17 |
| 12 | 1401-MUM-2012-ABSTRACT.pdf | 2018-08-11 |
| 12 | 1401-MUM-2012-CORRESPONDENCE(4-6-2012).pdf | 2018-08-11 |
| 13 | 1401-MUM-2012-CLAIMS.pdf | 2018-08-11 |
| 13 | 1401-MUM-2012-CORRESPONDENCE(29-5-2012).pdf | 2018-08-11 |
| 14 | 1401-MUM-2012-CLAIMS.pdf | 2018-08-11 |
| 14 | 1401-MUM-2012-CORRESPONDENCE(29-5-2012).pdf | 2018-08-11 |
| 15 | 1401-MUM-2012-ABSTRACT.pdf | 2018-08-11 |
| 15 | 1401-MUM-2012-CORRESPONDENCE(4-6-2012).pdf | 2018-08-11 |
| 16 | 1401-MUM-2012-CORRESPONDENCE.pdf | 2018-08-11 |
| 16 | 1401-MUM-2012-OTHERS [17-01-2019(online)].pdf | 2019-01-17 |
| 17 | 1401-MUM-2012-FER_SER_REPLY [17-01-2019(online)].pdf | 2019-01-17 |
| 17 | 1401-MUM-2012-DESCRIPTION(COMPLETE).pdf | 2018-08-11 |
| 18 | 1401-MUM-2012-COMPLETE SPECIFICATION [17-01-2019(online)].pdf | 2019-01-17 |
| 18 | 1401-MUM-2012-DRAWING.pdf | 2018-08-11 |
| 19 | 1401-MUM-2012-CLAIMS [17-01-2019(online)].pdf | 2019-01-17 |
| 19 | 1401-MUM-2012-FER.pdf | 2018-08-11 |
| 20 | 1401-MUM-2012-FORM 1(4-6-2012).pdf | 2018-08-11 |
| 20 | 1401-MUM-2012-FORM-26 [24-04-2021(online)].pdf | 2021-04-24 |
| 21 | 1401-MUM-2012-Correspondence to notify the Controller [24-04-2021(online)].pdf | 2021-04-24 |
| 21 | 1401-MUM-2012-FORM 1.pdf | 2018-08-11 |
| 22 | 1401-MUM-2012-FORM 18.pdf | 2018-08-11 |
| 22 | 1401-MUM-2012-Written submissions and relevant documents [12-05-2021(online)].pdf | 2021-05-12 |
| 23 | 1401-MUM-2012-FORM 2.pdf | 2018-08-11 |
| 23 | 1401-MUM-2012-US(14)-HearingNotice-(HearingDate-27-04-2021).pdf | 2021-10-03 |
| 24 | 1401-MUM-2012-FORM 26(29-5-2012).pdf | 2018-08-11 |
| 24 | 1401-MUM-2012-Response to office action [25-05-2022(online)].pdf | 2022-05-25 |
| 25 | 1401-MUM-2012-PatentCertificate26-05-2022.pdf | 2022-05-26 |
| 25 | 1401-MUM-2012-FORM 3.pdf | 2018-08-11 |
| 26 | ABSTRACT1.jpg | 2018-08-11 |
| 26 | 1401-MUM-2012-IntimationOfGrant26-05-2022.pdf | 2022-05-26 |
| 1 | (multilingual)(sourcecode)(G06F8_42)-GooglePatents_19-07-2018.pdf |
| 1 | 1401AE_24-03-2021.pdf |
| 2 | (multilingual)(sourcecode)(G06F8_42)-GooglePatents_19-07-2018.pdf |
| 2 | 1401AE_24-03-2021.pdf |