WO2009104658A1 - 情報表示装置、方法及びプログラム - Google Patents

情報表示装置、方法及びプログラム Download PDF

Info

Publication number
WO2009104658A1
WO2009104658A1 PCT/JP2009/052830 JP2009052830W WO2009104658A1 WO 2009104658 A1 WO2009104658 A1 WO 2009104658A1 JP 2009052830 W JP2009052830 W JP 2009052830W WO 2009104658 A1 WO2009104658 A1 WO 2009104658A1
Authority
WO
WIPO (PCT)
Prior art keywords
type
information
score
unit
belonging
Prior art date
Application number
PCT/JP2009/052830
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 JP2009554357A priority Critical patent/JP5359891B2/ja
Priority to US12/918,287 priority patent/US20100328202A1/en
Publication of WO2009104658A1 publication Critical patent/WO2009104658A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/74Reverse engineering; Extracting design information from source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented

Definitions

  • the present invention is based on the priority claim of Japanese patent application: Japanese Patent Application No. 2008-037604 (filed on Feb. 19, 2008), the entire description of which is incorporated herein by reference. Shall.
  • the present invention relates to an information display device, method, and program, and more particularly, to an information display device, method, and program for displaying instance method information appearing in a source code of a program written in an object-oriented language.
  • Non-Patent Document 1 describes an information display device. As illustrated in FIG. 7, the information display device 110 described in Non-Patent Document 1 includes an input unit 111, a definition type collection unit 112, an output unit 116, and a storage device 117. The storage device 117 stores definition type information and source code.
  • the information display device 110 operates as follows. It is assumed that an editor for viewing or editing the program source code is already operating.
  • the input unit 111 receives user input from a mouse or keyboard. When a call to a specific instance method included in the source code displayed on the screen is selected, when an input corresponding to the function of “open declaration” (for example, input of the function key F3) is received, The input unit 111 transmits the information on the instance method to the definition type collection unit 112.
  • the definition type collection unit 112 When the definition type collection unit 112 receives the instance method information, the definition type collection unit 112 reads, from the definition type information stored in the storage device 117, the type information for the variable that refers to the receiver object of the received instance method.
  • the definition type information A shows an example of the configuration of definition type information held in the storage device 117.
  • the definition type information A indicates a variable and a type for the variable.
  • the definition type information A can be generated by a technique called type analysis, for example.
  • the definition type collection unit 112 acquires type information for a variable that references the receiver object from the definition type information A, acquires information (class definition) corresponding to the acquired type from the source code, and includes instances included in the class definition Method definition information (method definition) is output via the output unit 116.
  • the source code is assumed to be displayed in the editor. For example, it is assumed that the user selects “p.foo ();” on the fourth line and performs an input operation for calling the “open declaration” function. At this time, the variable p and the instance method foo () are transmitted from the input unit 111 to the definition type collection unit 112.
  • the definition type collection unit 112 acquires the type corresponding to the variable p from the definition type information A. In the case of the source code shown in FIG. 8, it is determined that the type of the variable p is P by type analysis.
  • the definition type collection unit 112 acquires the P class definition from the source code, and transmits the method definition of the instance method foo () defined in the P class information to the output unit 116.
  • the output unit 116 presents the method definition of the instance method foo () on the ninth line to the user.
  • the information display device 110 displays the information of the instance method by using the variable type information.
  • Non-Patent Document 1 The entire contents disclosed in Non-Patent Document 1 are incorporated herein by reference. The following analysis was made by the present inventors.
  • a problem in the information display device 110 will be described with reference to FIG. As described above, the information display device 110 includes the p.
  • the foo () method definition on the ninth line is displayed as information corresponding to the instance method call foo ().
  • the instance method actually called in the fourth line is not defined in the ninth line but defined in the fifteenth line. This is because the variable p on the fourth line refers to the instance of the class R by the substitution on the third line. Therefore, in the case of the source code of FIG. 8, it is more beneficial for the user to present the method definition on the 15th line instead of the 4th line to the user.
  • the type assigned to the variable (“definition type”) is distinguished from the type of the object (“runtime type”) referenced by the variable when the program is executed.
  • the definition type of the variable p is P
  • the runtime type is R.
  • the first problem in the information display device 110 is that when displaying the method definition corresponding to the specified instance method call, the method definition in the variable definition type is displayed. -It is a point that the processing contents of the method cannot be grasped.
  • the second problem in the information display device 110 is that when a plurality of definition information candidates are displayed when displaying a method definition corresponding to a specified instance method call, an appropriate method is displayed. It takes time to select a definition. This is because a plurality of types may correspond to the runtime type of the selected variable, and in such a case, the user is required to select desired definition information.
  • an information display device, method, and program for displaying definition information corresponding to processing contents of an instance method at the time of execution when displaying a method definition corresponding to a specified instance method call. It becomes a problem.
  • information display that is more likely to be selected by the user from a plurality of definition information candidates is displayed in a more easily selectable location Providing an apparatus, a method, and a program becomes a problem.
  • An information display device is: Displays definition information of the instance method in a type that can be referenced at runtime by a variable that references the receiver object of the instance method.
  • the information display device of the first development form is A storage device that stores, as reference information, a type that can be referred to at runtime by a variable; A runtime type collection unit that extracts from the reference information a type that may be referenced at runtime by a variable that references a receiver object of the instance method; A selection result display unit that displays definition information of the instance method in (included in) the extracted type.
  • the information display device of the second development form is A first rearrangement (score assignment) unit that assigns a higher score to a type generated in the application unit than a score assigned to a type generated in the library unit; and / or It is preferable to include a second rearrangement (score assignment) unit that assigns a higher score to a type belonging to the application unit than a score assigned to a type belonging to the library unit.
  • the information display device of the third development form is Scores are generated for types generated in the application part and belonging to the application part, types generated in the application part and not belonging to the application part, types not generated in the application part and belonging to the application part, and other types. It is preferable to assign.
  • the information display device of the fourth development form is Monotonic in this order for types generated in the application section and belonging to the application section, types generated in the application section and not belonging to the application section, types not generated in the application section and belonging to the application section, and other types Is preferably assigned a decreasing score.
  • the information display device of the fifth development form is It is preferable that the selection result display unit displays definition information of instance methods included in each type by sorting in descending order of score.
  • the information display device of the sixth development form is It is preferable that the selection result display unit displays the definition information of the instance method in the type having a higher score in a place where the user can easily see or select.
  • the information display method is: Displaying definition information of the instance method in a type that can be referenced at runtime by a variable that references a receiver object of the instance method selected by the user.
  • the information display method of the seventh development form is A runtime type that extracts a type that can be referenced at runtime by a variable that references a receiver object of the instance method from the reference information with reference to a storage device that stores a type that can be referenced by the variable at runtime as reference information Collection process; A selection result display step for displaying definition information of the instance method in (included in) the extracted type.
  • the information display method of the eighth development form is A first score assigning step for assigning a higher score to a type generated in the application unit than a score assigned to a type generated in the library unit; and / or It is preferable to include a second score assigning step for assigning a higher score to a type belonging to the application unit than a score assigned to a type belonging to the library unit.
  • the information display method of the ninth development form is Monotonic in this order for types generated in the application section and belonging to the application section, types generated in the application section and not belonging to the application section, types not generated in the application section and belonging to the application section, and other types Is preferably assigned a decreasing score.
  • the information display method of the tenth development form is In the selection result display step, it is preferable that the definition information of the instance method in the type having a higher score is displayed in a place that is easier for the user to see or select.
  • An information display program is: Causes the computer to execute a process of displaying definition information of the instance method in a type that can be referred to at runtime by a variable that references the receiver object of the instance method selected by the user.
  • the information display program of the eleventh development form is A runtime type that extracts a type that can be referenced at runtime by a variable that references a receiver object of the instance method from the reference information with reference to a storage device that stores a type that can be referenced by the variable at runtime as reference information Collection process, A selection result display process for displaying the definition information of the instance method in the extracted type is included in the computer.
  • the information display program of the 12th development form is A first score assignment process for assigning a higher score to a type generated in the application unit than a score assigned to a type generated in the library unit; and / or It is preferable to cause the computer to execute a second score assignment process for assigning a higher score to a type belonging to the application unit than a score assigned to a type belonging to the library unit.
  • the information display program of the thirteenth development form is Monotonic in this order for types generated in the application section and belonging to the application section, types generated in the application section and not belonging to the application section, types not generated in the application section and belonging to the application section, and other types It is preferable to cause a computer to execute a process of assigning a score that decreases to the computer.
  • the information display program of the 14th development form is In the selection result display process, it is preferable to cause the computer to execute a process of displaying the instance method definition information in a higher score type in a place that is easier for the user to see or select.
  • an information display device, method, and program for displaying definition information corresponding to processing contents of an instance method at the time of execution when displaying definition information of the instance method selected by the user. .
  • the reason is that when displaying instance method definition information, it is possible to display definition information in types that may be referenced at runtime by variables that reference instance method receiver objects. .
  • the present invention when there are a plurality of type candidates that may be referred to at the time of execution by a variable that refers to the receiver object of the instance method, it is possible to reduce the effort for the user to select a desired type. it can.
  • prioritization is performed from the viewpoint of whether it is generated in the application part or belongs to the application part from a plurality of types of candidates, and is displayed to the user when displayed on the GUI. This is because a useful type is displayed in a place that is easy for the user to see or select.
  • FIG. 1 is a block diagram illustrating a configuration of an information display apparatus 10 according to the present embodiment.
  • the information display device 10 includes a runtime type collection unit 12, a selection result display unit 15, and a storage device 17.
  • the storage device 17 stores, as reference information, an effective type that is referred to by a variable at the time of execution.
  • the runtime type collection unit 12 extracts, from the reference information, a type that can be referred to at runtime by a variable that references the receiver object of the instance method.
  • the selection result display unit 15 displays definition information of the instance method in the extracted type.
  • FIG. 2 is a block diagram illustrating a configuration of the information display apparatus 10 according to the present embodiment.
  • the information display device 10 includes a runtime type collection unit 12, a rearrangement (score assignment) unit A ⁇ b> 13, a rearrangement (score assignment) unit B ⁇ b> 14, and a selection result display unit 15.
  • the storage device 17 stores, as reference information, a set of types that variables that appear in the program may reference at the time of execution.
  • the runtime type collection unit 12 acquires, from the reference information, a set of types that are referred to at the time of execution by a variable that references the receiver object of the instance method.
  • the storage device 17 stores information indicating whether the type is generated in the application part as the generation information.
  • the first rearrangement (score assignment) unit A13 assigns a score to the acquired type based on the generation information.
  • the storage device 17 stores, as APP / LIB information, information indicating whether the type belongs to the application part or the library part.
  • the second rearrangement (score assignment) unit B14 assigns a score to the type based on the APP / LIB information.
  • the selection result display unit 15 displays the type of the instance method according to the type selected by the user by displaying the type with a higher score on the GUI in a place that is easier for the user to see and select. Is displayed.
  • the information display apparatus 10 presents a user with a type that may be referred to at the time of execution by a variable that references a receiver object of an instance method, and provides a method definition corresponding to the selected type.
  • a variable that references a receiver object of an instance method
  • the information display apparatus 10 presents a user with a type that may be referred to at the time of execution by a variable that references a receiver object of an instance method, and provides a method definition corresponding to the selected type.
  • the score for the type is obtained using information such as whether the type is generated in the code corresponding to the application part or belongs to the application part.
  • One of the problems of the present invention is solved by attaching a type with a higher score (that is, a type that seems to be more useful to the user) to a location that is easy to see and select on the GUI screen. To do. In other words, when displaying the method definition corresponding to the specified instance method call, the method definition that is more likely to be selected by the user from among multiple method definition candidates should be displayed in a place where it can be easily selected. Can do.
  • the information display apparatus 10 includes a computer 18 that operates under program control and a storage device 17 such as a memory or a hard disk.
  • the computer 18 is connected to an input unit 11 having a keyboard, a mouse and the like, and an output unit 16 having a monitor and the like.
  • the computer 18 includes a runtime type collection unit 12, a first rearrangement (score assignment) unit A13, a second rearrangement (score assignment) unit B14, and a selection result display unit 15.
  • the storage device 17 holds reference information, generation information, APP / LIB information, and source code.
  • the input unit 11 receives an input made by a user (user) based on a source code viewing / editing GUI (graphical user interface, not shown) displayed on the output unit (monitor, etc.) 16.
  • the input unit 11 detects that the user has selected an instance method calling part based on the browsing GUI and has given an instruction to display the definition information.
  • the runtime type collection unit 12 When the runtime type collection unit 12 receives the call information of the instance method selected by the input unit 11, the runtime type collection unit 12 reads the runtime type information for the variable that refers to the receiver object of the instance method from the reference information.
  • the sort information as shown in FIG. 3 is formed from the read type information, and is transmitted to the first sort (score assignment) unit A13.
  • Reference information A is a specific example of the reference information held in the storage device 17.
  • the reference information A is a table that associates a variable with a set of types that may be referenced by the variable at the time of execution.
  • the reference information A can be generated by, for example, CHA (class hierarchy analysis), RTA (rapid type analysis), VTA (variable type analysis), pointer analysis, and the like.
  • CHA class hierarchy analysis
  • RTA rapid type analysis
  • VTA variable type analysis
  • pointer analysis pointer analysis
  • the reference information obtained as a result of CHA and RTA has the configuration of reference information B shown in FIG.
  • the reference information obtained as a result of the flow-sensitive pointer analysis has the configuration of reference information C shown in FIG. Processing based on these reference information B and C will be described later.
  • the sorting information includes score information for sorting in addition to the type information.
  • the initial score at the time of generation is 0.
  • the rearrangement (score assignment) unit A13 When receiving the rearrangement information, the rearrangement (score assignment) unit A13 acquires the generation information of each type included in the rearrangement information from the generation information A. Only when the value corresponding to each type is true, for example, 2 is added to the score value corresponding to the rearrangement information. After the processing, the rearrangement (score assignment) unit A13 transmits the rearrangement information to the rearrangement (score assignment) unit B14.
  • generation information A A specific example of generation information is shown in generation information A.
  • the program is divided into an application part (APP) and a library part (LIB).
  • APP application part
  • LIB library part
  • the generation information A indicates whether each type has been generated by the application part of the program by true or false.
  • Such generation information can be generated by collecting a target type of an object generation instruction (for example, instruction new) appearing in the source code of the application unit.
  • object generation instruction for example, instruction new
  • the rearrangement (score assignment) unit B14 When receiving the rearrangement information, the rearrangement (score assignment) unit B14 acquires the APP / LIB information of each type included in the rearrangement information from the APP / LIB information held in the storage device 17. Only when the type is included in the application part (APP), for example, 1 is added to the corresponding score value of the rearrangement information. After the processing, the rearrangement (score assignment) unit B14 transmits the rearrangement information to the selection result display unit 15.
  • APP application part
  • APP / LIB information A A specific example of APP / LIB information is shown in APP / LIB information A. As described above, the program is divided into an application part and a library part, and APP / LIB information A indicates whether a certain type belongs to the application part (APP) or the library part (LIB). LIB).
  • the selection result display unit 15 Upon receiving the sort information, the selection result display unit 15 stores the types included in the sort information in a list type data structure, sorts the sorted list in descending order by the score value corresponding to each type, and then sorts the sorted list. Transmit to the output unit 16.
  • the selection result display unit 15 receives the type selected by the user from the input unit 11 and reads the class definition corresponding to the type from the source code. Further, the selection result display unit 15 outputs the method definition corresponding to the selected instance method included in the class definition to the GUI screen via the output unit 16.
  • the input unit 11 detects an input to the user's GUI, the location where the instance method of the source code displayed on the GUI is selected, and an input requesting the display of the definition is given by the user
  • the information on the selected instance method is transmitted to the runtime type collection unit 12.
  • the instance method information includes a location in the source code where the instance method appears, a variable name that refers to the receiver object, a character string (signature) that represents the method, and the like.
  • the runtime type collection unit 12 receives the instance method information, the runtime type collection unit 12 obtains type information (runtime type) for a variable referring to the receiver object of the instance method from the reference information stored in the storage device 17. Take out (step S11 in FIG. 6).
  • the reference information can be generated by, for example, CHA, RTA, VTA, and pointer analysis.
  • CTA and RTA a table indicating correspondence between types and sets of types is obtained instead of tables corresponding to sets of variables and types (reference information B in FIG. 4).
  • a set of types for the type in which the variable that refers to the receiver object of the selected instance method is defined is acquired.
  • flow-sensitive pointer analysis since variables are distinguished by places where they appear in the program, as shown in the reference information C in FIG. 5, the correspondence between a set of variables and places and a set of types is shown.
  • a table is obtained. In this case, a set of types is acquired based on the variable that refers to the receiver object of the instance method and the location in the program where the variable appears.
  • the runtime type collection unit 12 generates rearrangement information shown in FIG. 3 by using a set of types indicating runtime types of variables that refer to receiver objects.
  • the types A and B in the first column respectively correspond to elements of the set of runtime types.
  • the score in the second column is an integer, and 0 is set as an initial value.
  • the runtime type collection unit 12 displays the generated reordering information. It transmits to the rearrangement (score assignment) part A13.
  • the runtime type collection unit 12 transmits the rearrangement information directly to the selection result display unit 15. If the number of elements is 0, there is a possibility that a problem such as failure of the runtime type analysis has occurred, so an error is output at this stage and the processing is terminated.
  • the rearrangement (score assignment) unit A13 acquires the generation information of each type from the generation information stored in the storage device 17.
  • the value of the generation information of each type is true, the object of that type is generated by the application part of the program.
  • 2 is added to the value of the corresponding score (step S13).
  • the present embodiment determines with the possibility that it is information useful for a user so that the value of a score is large. In other words, the present embodiment is based on the assumption that the type information generated in the application unit is more useful to the user than the type information generated in the library unit.
  • the rearrangement (score assignment) unit B14 When receiving the rearrangement information, the rearrangement (score assignment) unit B14 acquires the APP / LIB information of each type from the APP / LIB information stored in the storage device 17. If the value corresponding to the type is APP, the type definition belongs to the application part, and if it is LIB, it belongs to the library part. The rearrangement (score assignment) unit B14 checks the value corresponding to the APP / LIB information for each type of rearrangement information, and if the value is APP, adds 1 to the score corresponding to that type (step S14). When the processing is completed for all types, the rearrangement (score assignment) unit B14 transmits the rearrangement information to the selection result display unit 15. In the present embodiment, the type definition belonging to the application part is based on the assumption that the type definition belonging to the library part is more beneficial to the user.
  • the ranking process A (step S13) and the ranking process B (step S14) are generated by the application unit, and the type definition of the type belonging to the application unit has a score of 3 (highest), and is generated by the application unit. Also, the score of the type whose type definition belongs to the library part is 2, the score of the type whose type definition belongs to the application part is 1 and the score of the other type is 0.
  • the scoring method does not have to be the same as in this embodiment. In the present embodiment, only a preferred case for assigning scores is shown. Therefore, the priority value may be changed by changing the value of the score added in steps S13 and S14.
  • the selection result display unit 15 sorts the sort information in descending order (that is, the higher the score, the higher the position of the list), and the type information is displayed on the GUI based on the sorted order.
  • a list is displayed (step S15). It is preferable to give a default focus to the list item that displays the type higher in the list. By giving the focus by default, for example, the selection by the user can be completed by a simple operation such as pressing the Enter key. Further, the display format does not necessarily have to be a list format, and any type having a higher score may be easier to view for the user.
  • the selection result display unit 15 receives from the input unit 11 information regarding what the user has selected from the list of types presented previously, the selection result display unit 15 stores definition information corresponding to the selected type. Extract from the source code stored in. Further, the selection result display unit 15 transmits to the output unit 16 a method definition that is included in the extracted type definition and that corresponds to the selected instance method. The output unit 16 displays the received method definition on the GUI screen (step S16).
  • the method definition of the selected instance method may not be included in the extracted type definition information. Therefore, in such a case, the parent type of the extracted type is searched based on the inheritance tree, and the parent type definition that is closest to the extracted type (the shortest path to the type exists in the inheritance tree). Method definition included in is acquired from the source code and displayed.
  • the processing of the sorting (score allocation) unit A13 and the sorting (score allocation) unit B14 is omitted, and the selection result directly from the runtime type collection unit 12
  • the rearrangement information may be transmitted to the display unit 15, and the selection result display unit 15 may display the type information without considering the score.
  • the processing of the rearrangement (score assignment) part A13 (step S13) and the processing of the rearrangement (score assignment) part B14 (step S14) may be reversed in order or in parallel (in parallel).
  • the assigned score values may be aggregated to calculate a score for each type. Further, either the processing of the rearrangement (score assignment) part A13 (step S13) or the processing of the rearrangement (score assignment) part B14 (step S14) may be omitted.
  • the information display device 10 is configured to acquire and display the runtime type from the reference information, not the definition type of the variable that refers to the receiver object of the instance method, when displaying the definition of the instance method. Yes. Therefore, the information display device 10 can display definition information corresponding to the runtime type of the instance method. Also, in this embodiment, by scoring a plurality of types corresponding to the runtime type, a list of candidate types is presented in a format that is easier to see or select for those that are useful to the user. It is configured. Therefore, the user can select a required type with less effort and refer to necessary definition information.
  • the operation of the information display apparatus 10 according to the present embodiment will be described using the program shown in FIG. 8 as an example. It is assumed that the user requests definition information corresponding to “p.foo ();” on the fourth line. Further, App, Q, and R are types belonging to the application unit, and P and Lib are types belonging to the library unit. In the class App, R is generated by new on the third line, so the generation information is true only for the type R.
  • reference information for a set of types (runtime type) corresponding to the variable p appearing on the fourth line will be described.
  • the content of the reference information differs depending on whether it is generated using CHA, RTA, VTA, or pointer analysis.
  • the set of types includes ⁇ P, Q, R ⁇ .
  • ⁇ Q, R ⁇ is included.
  • VTA and pointer analysis only ⁇ R ⁇ is included.
  • CHA is used at this time.
  • the set of types corresponding to the variable p is ⁇ P, Q, R ⁇ .
  • the runtime type collection unit 12 is p. Reference information of a variable that references the receiver object of foo () is acquired. The variable is p, and the corresponding reference information is ⁇ P, Q, R ⁇ .
  • the rearrangement (score assignment) unit A13 assigns scores for each of P, Q, and R using the generation information. As described above, only R is generated in the application part (App). Therefore, a score of 0 is assigned to P, 0 to Q, and 2 to R.
  • the rearrangement (score assignment) unit B14 assigns a score for each of P, Q, and R using APP / LIB information.
  • P is LIB
  • Q and R are APPs, so 0 is assigned to P, and 1 is assigned to Q and R.
  • 0 is assigned to P
  • 1 is assigned to Q
  • 3 is assigned to R.
  • the selection result display unit 15 displays R in the place where it is easy to see, then Q, and finally P in the order where it is easy to see.
  • RTA it is displayed in the same way in the order of R and Q in the same manner.
  • the type displayed by the selection result display unit 15 at the place where it is most easily visible and easy to select is R.
  • the type of the object referenced at the time of execution by the variable p in the fourth line is R from the third line. Accordingly, the definition information corresponding to the processing contents of the instance method at the time of execution is displayed to the user in the most visible place.
  • the selection result display unit 15 displays the definition on the 9th line when the user selects P, the definition on the 12th line when Q is selected, and the definition on the 15th line when R is selected. Each is displayed on the GUI screen.
  • the present invention can be applied to uses such as a program browsing function in a program development environment that supports program development. Further, the present invention can be applied to a use such as a program browsing tool that supports browsing of a program. It should be noted that the disclosures of the aforementioned patent documents and the like are incorporated herein by reference. Within the scope of the entire disclosure (including claims) of the present invention, the embodiments and examples can be changed and adjusted based on the basic technical concept. Various combinations and selections of various disclosed elements are possible within the scope of the claims of the present invention. That is, the present invention of course includes various variations and modifications that could be made by those skilled in the art according to the entire disclosure including the claims and the technical idea.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Abstract

 利用者によって選択されたインスタンス・メソッドの定義情報を表示する際に、実行時におけるインスタンス・メソッドの処理内容に応じた定義情報を表示する情報表示装置、方法及びプログラムを提供する。情報表示装置は、利用者によって選択されたインスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型に含まれるインスタンス・メソッドの定義情報を表示する。

Description

情報表示装置、方法及びプログラム
[関連出願の記載]
 本発明は、日本国特許出願:特願2008-037604号(2008年 2月19日出願)の優先権主張に基づくものであり、同出願の全記載内容は引用をもって本書に組み込み記載されているものとする。
 本発明は情報表示装置、方法及びプログラムに関し、特に、オブジェクト指向型言語で記述されたプログラムのソースコードに登場するインスタンス・メソッドの情報を表示する情報表示装置、方法及びプログラムに関する。
 非特許文献1において、情報表示装置が記載されている。図7に示すように、非特許文献1に記載の情報表示装置110は、入力部111、定義型収集部112、出力部116、及び、記憶装置117を備える。記憶装置117は、定義型情報及びソースコードを格納する。
 情報表示装置110は、次のように動作する。プログラムのソースコードを閲覧又は編集するためのエディタは、すでに動作しているものとする。入力部111はマウスやキーボードから利用者の入力を受け付ける。画面に表示されたソースコードに含まれる特定のインスタンス・メソッドの呼び出しが選択された状態において、さらに「宣言を開ける」という機能に対応する入力(例えば、ファンクションキーF3の入力)を受け付けた場合、入力部111は、そのインスタンス・メソッドの情報を定義型収集部112に送信する。
 定義型収集部112は、インスタンス・メソッドの情報を受信した場合、受信したインスタンス・メソッドのレシーバ・オブジェクトを参照する変数に対する型情報を、記憶装置117に格納された定義型情報から読み込む。定義型情報Aは、記憶装置117に保持される定義型情報の構成の一例を示す。定義型情報Aは、変数とその変数に対する型を示す。定義型情報Aは、例えば、型解析と呼ばれる手法によって生成することができる。定義型収集部112はレシーバ・オブジェクトを参照する変数に対する型情報を定義型情報Aより取得し、取得した型に対応する情報(クラス定義)をソースコードから取得し、そのクラス定義に含まれるインスタンス・メソッドの定義情報(メソッド定義)を、出力部116を介して出力する。
 図8に示すプログラムのソースコードを参照して、従来の情報表示装置110の動作を具体的に説明する。ソースコードは、エディタに表示されているものとする。利用者は、例えば、4行目の”p.foo();”を選択し、「宣言を開ける」機能を呼び出す入力操作を行ったものとする。このとき、入力部111から定義型収集部112に、変数p及びインスタンス・メソッドfoo()が送信される。
 定義型収集部112は、変数pに対応する型を定義型情報Aから取得する。図8に示すソースコードの場合、型解析によって、変数pの型はPであると判定される。定義型収集部112は、Pのクラス定義をソースコードから取得し、Pのクラス情報の中に定義されたインスタンス・メソッドfoo()のメソッド定義を出力部116へ送信する。出力部116は、9行目のインスタンス・メソッドfoo()のメソッド定義を利用者に提示する。このように、情報表示装置110は、変数の型の情報を利用して、インスタンス・メソッドの情報を表示する。
宮本信二著、"第4回:Eclipseの便利な機能"、[online]、2005年2月9日、impress IT Corporation、 [2007年12月13日検索]、インターネット<http://www.thinkit.co.jp/free/tech/3/4/1.html>
 以上の非特許文献1の全開示内容は、本書に引用をもって繰り込み記載されているものとする。
 以下の分析は、本発明者によってなされたものである。図8を参照して、情報表示装置110における問題点について説明する。上記の通り、情報表示装置110は、4行目のp.foo()というインスタンス・メソッドの呼び出しに対応する情報として、9行目のfoo()メソッド定義を表示する。しかしながら、プログラムの実行時において、4行目において実際に呼び出されるインスタンス・メソッドは9行目で定義されているものではなく、15行目で定義されているものである。なぜならば、4行目の変数pは3行目の代入によって、クラスRのインスタンスを参照するからである。したがって、図8のソースコードの場合には、4行目ではなく15行目のメソッド定義を利用者に提示した方が、利用者にとって有益である。ここでは、変数に割り当てられた型(「定義型」)と、変数によってプログラムの実行時に参照されるオブジェクトの型(「実行時型」)と、を区別する。図8のソースコードにおいては、変数pの定義型はPであり、一方、実行時型はRである。
 情報表示装置110における第1の問題点は、指定されたインスタンス・メソッドの呼び出しに対応するメソッド定義を表示する際、変数の定義型におけるメソッド定義が表示されるため、利用者は実行時におけるインスタンス・メソッドの処理内容を把握することができないという点である。
 情報表示装置110における第2の問題点は、指定されたインスタンス・メソッドの呼び出しに対応するメソッド定義を表示する際に、表示される定義情報の候補が複数となった場合には、適切なメソッド定義を選択するのに手間を要することである。選択された変数の実行時型には複数の型が対応する場合があり、かかる場合、利用者はその中から所望の定義情報を選択する必要に迫られるからである。
 そこで、指定されたインスタンス・メソッドの呼び出しに対応するメソッド定義を表示する際に、実行時におけるインスタンス・メソッドの処理内容に応じた定義情報を表示する情報表示装置、方法及びプログラムを提供することが課題となる。また、指定されたインスタンス・メソッドの呼び出しに対応するメソッド定義情報を表示する際に、複数の定義情報の候補から利用者によって選択される可能性が高いものほど選択しやすい場所に表示する情報表示装置、方法及びプログラムを提供することが課題となる。
 本発明の第1の視点に係る情報表示装置は、
インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型における(含まれる)該インスタンス・メソッドの定義情報を表示する。
 第1の展開形態の情報表示装置は、
 変数によって実行時に参照され得る型を参照情報として記憶する記憶装置と、
 前記インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照される可能性のある型を前記参照情報から抽出する実行時型収集部と、
 抽出された型における(含まれる)前記インスタンス・メソッドの定義情報を表示する選択結果表示部と、を備える。
 第2の展開形態の情報表示装置は、
 アプリケーション部において生成された型に対し、ライブラリ部において生成された型に対して割り当てられるスコアよりも高いスコアを割り当てる第1の並び替え(スコア割り当て)部、及び/又は、
 アプリケーション部に属する型に対し、ライブラリ部に属する型に対して割り当てられるスコアよりも高いスコアを割り当てる第2の並び替え(スコア割り当て)部を備えることが好ましい。
 第3の展開形態の情報表示装置は、
 アプリケーション部で生成されかつアプリケーション部に属する型、アプリケーション部で生成されかつアプリケーション部に属さない型、アプリケーション部で生成されずかつアプリケーション部に属する型、及び、それ以外の型に対し、それぞれスコアを割り当てることが好ましい。
 第4の展開形態の情報表示装置は、
  アプリケーション部で生成されかつアプリケーション部に属する型、アプリケーション部で生成されかつアプリケーション部に属さない型、アプリケーション部で生成されずかつアプリケーション部に属する型、及び、それ以外の型に対し、この順に単調に減少するスコアを割り当てることが好ましい。
第5の展開形態の情報表示装置は、
 前記選択結果表示部が、スコアの降順にソートして各型に含まれるインスタンス・メソッドの定義情報を表示することが好ましい。
 第6の展開形態の情報表示装置は、
 前記選択結果表示部が、スコアの高い型における前記インスタンス・メソッドの定義情報ほど利用者にとって見やすい又は選択しやすい場所に表示することが好ましい。
 本発明の第2の視点に係る情報表示方法は、
 利用者によって選択されたインスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型における(含まれる)該インスタンス・メソッドの定義情報を表示する工程を含む。
 第7の展開形態の情報表示方法は、
 変数によって実行時に参照され得る型を参照情報として記憶する記憶装置を参照して、前記インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型を前記参照情報から抽出する実行時型収集工程と、
 抽出された型における(含まれる)前記インスタンス・メソッドの定義情報を表示する選択結果表示工程と、を含む。
 第8の展開形態の情報表示方法は、
 アプリケーション部において生成された型に対し、ライブラリ部において生成された型に対して割り当てられるスコアよりも高いスコアを割り当てる第1のスコア割り当て工程、及び/又は、
 アプリケーション部に属する型に対し、ライブラリ部に属する型に対して割り当てられるスコアよりも高いスコアを割り当てる第2のスコア割り当て工程を含むことが好ましい。
 第9の展開形態の情報表示方法は、
 アプリケーション部で生成されかつアプリケーション部に属する型、アプリケーション部で生成されかつアプリケーション部に属さない型、アプリケーション部で生成されずかつアプリケーション部に属する型、及び、それ以外の型に対し、この順に単調に減少するスコアを割り当てることが好ましい。
 第10の展開形態の情報表示方法は、
 前記選択結果表示工程において、スコアの高い型における前記インスタンス・メソッドの定義情報ほど利用者にとって見やすい又は選択しやすい場所に表示することが好ましい。
 本発明の第3の視点に係る情報表示プログラムは、
 利用者によって選択されたイインスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型における(含まれる)該インスタンス・メソッドの定義情報を表示する処理をコンピュータに実行させる。
 第11の展開形態の情報表示プログラムは、
 変数によって実行時に参照され得る型を参照情報として記憶する記憶装置を参照して、前記インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型を前記参照情報から抽出する実行時型収集処理と、
 抽出された型における(含まれる)前記インスタンス・メソッドの定義情報を表示する選択結果表示処理と、をコンピュータに実行させる。
 第12の展開形態の情報表示プログラムは、
 アプリケーション部において生成された型に対し、ライブラリ部において生成された型に対して割り当てられるスコアよりも高いスコアを割り当てる第1のスコア割り当て処理、及び/又は、
 アプリケーション部に属する型に対し、ライブラリ部に属する型に対して割り当てられるスコアよりも高いスコアを割り当てる第2のスコア割り当て処理をコンピュータに実行させることが好ましい。
 第13の展開形態の情報表示プログラムは、
 アプリケーション部で生成されかつアプリケーション部に属する型、アプリケーション部で生成されかつアプリケーション部に属さない型、アプリケーション部で生成されずかつアプリケーション部に属する型、及び、それ以外の型に対し、この順に単調に減少するスコアを割り当てる処理をコンピュータに実行させることが好ましい。
 第14の展開形態の情報表示プログラムは、
 前記選択結果表示処理において、スコアの高い型における前記インスタンス・メソッドの定義情報ほど利用者にとって見やすい又は選択しやすい場所に表示する処理をコンピュータに実行させることが好ましい。
 本発明によって、利用者によって選択されたインスタンス・メソッドの定義情報を表示する際に、実行時におけるインスタンス・メソッドの処理内容に応じた定義情報を表示する情報表示装置、方法及びプログラムが提供される。その理由は、インスタンス・メソッドの定義情報を表示する際に、インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照される可能性のある型における定義情報を表示することができるからである。
 また、本発明によって、インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照される可能性のある型の候補が複数ある場合、利用者が所望の型を選択する労力を削減することができる。その理由は、複数の型の候補の中から、アプリケーション部の中で生成されるか、又は、アプリケーション部に属するか、という観点による優先順位付けを行い、GUIに表示する際に、利用者にとって有益な型ほど利用者に見やすく、又は、選択しやすい場所に表示するからである。
本発明の第1の実施形態に係る情報表示装置の構成を示すブロック図である。 本発明の第2の実施形態に係る情報表示装置の構成を示すブロック図である。 本発明の実施例に係る情報表示装置における並び替え情報の形式を示す図である。 本発明の実施例に係る情報表示装置における参照情報の他の形式を示す図である。 本発明の実施例に係る情報表示装置における参照情報のさらに他の形式を示す図である。 本発明の実施例に係る情報表示装置の動作を示す流れ図である。 従来の情報表示装置の構成を示すブロック図である。 オブジェクト指向型言語の一つであるJava(登録商標)言語によって記述されたプログラムのソースコードである。
符号の説明
10、110 情報表示装置
11、111 入力部
12 実行時型収集部
13 並び替え(スコア割り当て)部A
14 並び替え(スコア割り当て)部B
15 選択結果表示部
16、116 出力部
17、117 記憶装置
18 計算機
112 定義型収集部
(実施形態1)
 本発明の第1の実施形態に係る情報表示装置について図面を参照して説明する。図1は、本実施形態に係る情報表示装置10の構成を示すブロック図である。情報表示装置10は、実行時型収集部12、選択結果表示部15及び記憶装置17を備える。記憶装置17は、変数によって実行時に参照される能性のある型を参照情報として記憶する。実行時型収集部12は、インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照される可能性のある型を参照情報から抽出する。選択結果表示部15は、抽出された型におけるインスタンス・メソッドの定義情報を表示する。
(実施形態2)
 次に、本発明の第2の実施形態に係る情報表示装置について図面を参照して説明する。図2は、本実施形態に係る情報表示装置10の構成を示すブロック図である。情報表示装置10は、図2を参照すると、実行時型収集部12、並び替え(スコア割り当て)部A13、並び替え(スコア割り当て)部B14、選択結果表示部15を備える。
 記憶装置17は、参照情報として、プログラム中に登場する変数が実行時に参照する可能性のある型の集合を保存する。実行時型収集部12は、インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照される型の集合を参照情報から取得する。
 記憶装置17は、生成情報として、型がアプリケーション部分で生成されるか否かを示す情報を保存する。第1の並び替え(スコア割り当て)部A13は、生成情報に基づいて、取得した型に対してスコアを割り当てる。
 記憶装置17は、APP/LIB情報として、型がアプリケーション部分に属するのか、又は、ライブラリ部分に属するのかを示す情報を保存する。第2の並び替え(スコア割り当て)部B14は、APP/LIB情報に基づいて、型に対してスコアを割り当てる。
 選択結果表示部15は、GUI上において、高いスコアが付された型ほど利用者にとって見やすく、かつ、選択しやすい場所に表示し、利用者によって選択された型に応じたインスタンス・メソッドの定義情報を表示する。
 本実施形態に係る情報表示装置10は、インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照される可能性のある型を利用者に提示し、選択された型に対応するメソッド定義を表示することによって、本発明の課題の1つを解決する。すなわち、指定されたインスタンス・メソッドの呼び出しに対応するメソッド定義を表示する際、実行時型に相当するメソッド定義を表示することができる。
 さらに、利用者に提示する型の候補が複数ある場合、それらの型は、アプリケーション部分に相当するコード内で生成されているか、アプリケーション部分に属するか、等の情報を利用して、型に対するスコア付けを行い、スコアがより高い型(すなわち、より利用者にとって有益と思われる型)をGUI画面上の見やすく、かつ、選択しやすい箇所に出力することによって、本発明の課題の1つを解決する。すなわち、指定されたインスタンス・メソッドの呼び出しに対応するメソッド定義を表示する際に、複数のメソッド定義の候補の中から利用者によって選択される可能性が高いものほど選択しやすい場所に表示することができる。
 次に、本発明の第1の実施例について図面を参照して詳細に説明する。
 図2を参照すると、本実施例に係る情報表示装置10は、プログラム制御によって動作する計算機18と、メモリやハードディスク等の記憶装置17とを備える。計算機18は、キーボード、マウス等を有する入力部11と、モニタ等を有する出力部16とに接続される。計算機18は、実行時型収集部12、第1の並び替え(スコア割り当て)部A13、第2の並び替え(スコア割り当て)部B14及び選択結果表示部15を備える。記憶装置17は、参照情報、生成情報、APP/LIB情報及びソースコードを保持する。
 これらの各部は、次のように動作する。入力部11は、ユーザ(利用者)が出力部(モニタ等)16に表示されたソースコード閲覧・編集用のGUI(グラフィカル・ユーザ・インタフェース、非図示)に基づいて、行う入力を受け付ける。本実施例において、入力部11は、ユーザが閲覧用のGUIに基づいて、インスタンス・メソッドの呼び出し部分を選択し、かつ、その定義情報を表示させる旨の指示を行ったことを検知する。
 実行時型収集部12は、入力部11によって選択されたインスタンス・メソッドの呼び出し情報を受信すると、当該インスタンス・メソッドのレシーバ・オブジェクトを参照する変数に対する実行時型情報を参照情報から読み込む。読み込んだ型の情報から図3に示すような、並び替え情報を構成し、第1の並び替え(スコア割り当て)部A13に送信する。
 参照情報Aは、記憶装置17に保持される参照情報の具体例である。参照情報Aは、変数とその変数によって実行時に参照される可能性のある型の集合と、を対応づける表である。かかる参照情報Aは、例えば、CHA(クラス・ヒエラルキー・アナリシス)や、RTA(ラピッド・タイプ・アナリシス)、VTA(バリアブル・タイプ・アナリシス)、ポインタ解析などによって生成することができる。特に、CHAとRTAの結果として得られる参照情報は、図4に示す参照情報Bの構成からなる。一方、flow-sensitive(フロー・センシティブ)なポインタ解析の結果として得られる参照情報は、図5に示す参照情報Cの構成からなる。これらの参照情報B、Cに基づく処理については、後述する。
 並び替え情報は型情報に加えて、並べ替えのためのスコア情報を有する。生成時のスコアの初期値は0とする。
 並び替え(スコア割り当て)部A13は、並び替え情報を受信すると、生成情報Aから、並び替え情報に含まれる各型の生成情報を取得する。各型に対応する値がtrueの場合に限って、並び替え情報の対応するスコアの値に、例えば、2を加える。処理終了後、並び替え(スコア割り当て)部A13は並び替え情報を並び替え(スコア割り当て)部B14に送信する。
 生成情報の具体例を生成情報Aに示す。本実施例において、プログラムはアプリケーション部(APP)とライブラリ部(LIB)とに分割されているものとする。例えば、広く利用されているプログラム開発環境Eclipse(エクリプス)においては、アプリケーション部とライブラリ部とが区切られて管理される。生成情報Aは、各型がプログラムのアプリケーション部で生成されているか否かをtrue又はfalseによって示す。かかる生成情報は、アプリケーション部のソースコードに登場するオブジェクト生成命令(例えば、命令new)の対象となる型を収集することによって、生成することができる。本実施例では、あらかじめ記憶装置17に生成情報が保持されているものとする。
 並び替え(スコア割り当て)部B14は、並び替え情報を受信すると、記憶装置17が保持するAPP/LIB情報から、並び替え情報に含まれる各型のAPP/LIB情報を取得する。当該型がアプリケーション部(APP)に含まれる場合のみ、並び替え情報の対応するスコアの値に、例えば、1を加える。処理終了後、並び替え(スコア割り当て)部B14は、並び替え情報を選択結果表示部15に送信する。
 APP/LIB情報の具体例をAPP/LIB情報Aに示す。先に述べた通り、プログラムはアプリケーション部とライブラリ部に分割され、APP/LIB情報Aは、ある型がアプリケーション部(APP)に属するかライブラリ部(LIB)に属するかを型と値(APP又はLIB)との組によって格納している。
 選択結果表示部15は、並び替え情報を受信すると、並び替え情報に含まれる型をリスト型のデータ構造に格納し、各型に対応するスコアの値によって降順にソートした後、ソートしたリストを出力部16に送信する。また、選択結果表示部15は、利用者が選択した型を入力部11から受信し、その型に対応するクラス定義をソースコードから読み込む。さらに、選択結果表示部15は、クラス定義に含まれる、選択されたインスタンス・メソッドに対応するメソッド定義を、出力部16を介してGUI画面に出力する。
 次に、図6のフローチャートを参照して本実例に係る情報表示装置10全体の動作について詳細に説明する。
 入力部11は、利用者のGUIへの入力を検出し、GUIに表示されているソースコードのインスタンス・メソッドの呼び出し箇所が選択され、その定義の表示を求める入力が利用者より与えられた場合には、実行時型収集部12に選択されたインスタンス・メソッドの情報を送信する。インスタンス・メソッドの情報とは、そのインスタンス・メソッドが登場するソースコード中の場所、レシーバ・オブジェクトを参照する変数名、メソッドを表現する文字列(シグニチャ)等を含む。実行時型収集部12は、インスタンス・メソッドの情報を受信すると、記憶装置17に格納された参照情報から、そのインスタンス・メソッドのレシーバ・オブジェクトを参照する変数に対する型の情報(実行時型)を取り出す(図6のステップS11)。
 先に述べたように、参照情報は、例えば、CHA、RTA、VTA、ポインタ解析によって生成することができる。特に、CTAとRTAの場合、変数と型の集合が対応した表ではなく、型と型の集合との対応を示す表が得られる(図4の参照情報B)。この場合、選択されたインスタンス・メソッドのレシーバ・オブジェクトを参照する変数が定義された型に対する型の集合を取得する。また、flow-sensitiveなポインタ解析の場合、変数はプログラム中に登場する場所によって区別されるため、図5の参照情報Cに示すように、変数及び場所の組と型の集合との対応を示す表が得られる。この場合、当該インスタンス・メソッドのレシーバ・オブジェクトを参照する変数と、その変数が登場するプログラム中の場所とに基づいて、型の集合を取得する。
 実行時型収集部12は、レシーバ・オブジェクトを参照する変数の実行時型を示す型の集合を用いて、図3に示す並び替え情報を生成する。第1列の型A、Bはそれぞれ実行時型の集合の要素にそれぞれ対応する。一方、第2列のスコアは整数とし、初期値として0が設定されるものとする。
 レシーバ・オブジェクトを参照する変数の実行時型の集合の要素数が2以上である(1より大きい)場合(ステップS12のYes)には、実行時型収集部12は、生成した並び替え情報を並び替え(スコア割り当て)部A13に送信する。一方、要素数が1の場合(ステップS12のNo)には、ソートの必要がないため、実行時型収集部12は、並び替え情報を直接、選択結果表示部15に送信する。なお、要素数が0の場合は、実行時型の解析に失敗するなどの問題が発生している可能性があるために、この段階でエラーを出力して処理を終える。
 次に、並び替え(スコア割り当て)部A13は、並び替え情報を受信すると、記憶装置17に格納された生成情報から、各型の生成情報を取得する。各型の生成情報の値がtrueである場合には、その型のオブジェクトはプログラムのアプリケーション部で生成される。並び替え情報に含まれる型のそれぞれについて、生成情報の値がtrueである場合には対応するスコアの値に2を加える(ステップS13)。本実施例においては、スコアの値が大きいほど利用者にとって有益な情報である可能性が高いものと判定する。すなわち、本実施例は、アプリケーション部で生成されている型の情報の方が、ライブラリ部で生成されている型の情報よりも、ユーザにとって有益であるとの仮定に基づく。並び替え(スコア割り当て)部A13は並び替え情報に含まれるすべての型を処理すると、前記並び替え情報を並び替え(スコア割り当て)部B14に送信する。
 並び替え(スコア割り当て)部B14は、並び替え情報を受信すると、記憶装置17に格納されたAPP/LIB情報から、各型のAPP/LIB情報を取得する。型に対応する値がAPPである場合にはその型定義はアプリケーション部に属し、LIBである場合にはライブラリ部に属する。並び替え(スコア割り当て)部B14は、並び替え情報の各型について、APP/LIB情報の対応する値を調べ、値がAPPであればその型に対応するスコアに1を加える(ステップS14)。すべての型について処理を終えると、並び替え(スコア割り当て)部B14は、並び替え情報を選択結果表示部15に送信する。なお、本実施例では、アプリケーション部に属する型定義の方が、ライブラリ部に属する型定義よりも、ユーザにとって有益であるものとの仮定に基づく。
 ランク付け処理A(ステップS13)とランク付け処理B(ステップS14)とによって、アプリケーション部で生成され、かつ、型定義がアプリケーション部に属する型のスコアは3(最高)、アプリケーション部で生成され、かつ、型定義がライブラリ部に属する型のスコアは2、アプリケーション部で生成されず、かつ、型定義がアプリケーション部に属する型のスコアは1、それ以外の型のスコアは0となる。スコア付けの方法は本実施の形態の通りである必要はない。本実施例においては、スコアの割り当てについての好適な事例を示したにすぎない。したがって、ステップS13、S14において加算されるスコアの値を変更し、優先度を変更してもよい。
 選択結果表示部15は、並び替え情報を受信すると、並び替え情報を降順でソートし(すなわちスコアが大きいものほどリストの上位に位置する)、ソートした順番に基づいて、型情報をGUI上にリスト表示する(ステップS15)。リスト上位の型を表示するリスト・アイテムに対し、デフォルトでフォーカスを与えておくことが好ましい。デフォルトでフォーカスを与えておくことによって、例えば、Enterキーを押すなどの簡単な操作によって利用者による選択を完了させることができる。また、表示形式は、必ずしもリスト形式である必要はなく、スコアの大きい型ほど利用者にとって見やすいものであればよい。したがって、ソートした後、スコアの降順でGUI表示をする代わりに、又は、かかる表示とともに、スコアが大きい型ほど文字のフォントのサイズを大きくしたり、見やすい色としたり、又は、文字を強調処理してもよい。選択結果表示部15は、先に提示した型の一覧の中から利用者が何を選択したかに関する情報を、入力部11から受信した場合、選択された型に対応する定義情報を記憶装置17に格納されたソースコードから取り出す。さらに、選択結果表示部15は、取り出した型定義に含まれ、かつ、選択されたインスタンス・メソッドに対応するメソッド定義を出力部16へ送信する。出力部16は、受信したメソッド定義をGUI画面上に表示する(ステップS16)。なお、オブジェクト指向型言語は継承の機能を有するため、選択されたインスタンス・メソッドのメソッド定義が取り出された型の定義情報に含まれていない場合があり得る。そこで、かかる場合には、取り出された型の親の型を継承木に基づいて探索し、もっとも取り出された型に近い(継承木において当該型への最も短いパスが存在する)親の型定義に含まれるメソッド定義をソースコードから取得して表示する。
 なお、実行時型が複数ある場合であっても、並び替え(スコア割り当て)部A13及び並び替え(スコア割り当て)部B14の処理を省略して、実行時型収集部12から、直接、選択結果表示部15に並び替え情報を送信し、選択結果表示部15はスコアを考慮することなく型情報を表示してもよい。また、並び替え(スコア割り当て)部A13の処理(ステップS13)と並び替え(スコア割り当て)部B14の処理(ステップS14)とは、順序を逆にしてもよいし、並行して(並列に)処理を進めた後に、各処理において、割り当てられたスコアの値を集計して、各型に対するスコアを算出するようにしてもよい。また、並び替え(スコア割り当て)部A13の処理(ステップS13)と並び替え(スコア割り当て)部B14の処理(ステップS14)のいずれかを省略してもよい。
 次に、本実施例の情報表示装置の効果について説明する。情報表示装置10は、インスタンス・メソッドの定義を表示する際、インスタンス・メソッドのレシーバ・オブジェクトを参照する変数の定義型ではなく、実行時型を参照情報から取得して表示するように構成されている。したがって、情報表示装置10はインスタンス・メソッドの実行時型に対応する定義情報を表示することができる。また、本実施例では、実行時型に対応する複数の型にスコアをつけることによって、候補となる型の一覧を利用者にとって有益なものほど見やすく、又は、選択しやすい形式によって提示するように構成されている。したがって、利用者は少ない労力で必要とする型を選択し、必要な定義情報を参照することができる。
 次に、本発明の第2の実施例に係る情報表示装置について図面を参照して説明する。
 本実施例に係る情報表示装置10の動作を、図8に示すプログラムを例として説明する。利用者は4行目の「p.foo();」に対応する定義情報を要求したとする。また、App、Q、R、はアプリケーション部に属する型であり、PとLibはライブラリ部に属する型であるとする。クラスAppの中において、3行目のnewによってRが生成されているため、生成情報は型Rに対してのみtrueとなる。
 ここでは、4行目に登場する変数pに対応する型の集合(実行時型)に対する参照情報について説明する。CHA、RTA、VTA、ポインタ解析、のいずれを利用して生成したかによって、参照情報の内容は異なったものとなる。CHAの場合、型の集合には{P、Q、R}が含まれる。RTAの場合には{Q、R}が含まれる。VTAとポインタ解析の場合には{R}のみが含まれる。ここでは、一例として、CHAを用いた場合について説明する。このとき、変数pに対応する型の集合は{P、Q、R}である。
 実行時型収集部12はp.foo()のレシーバ・オブジェクトを参照する変数の参照情報を取得する。前記変数はpであり、対応する参照情報は{P、Q、R}である。
 次に、並び替え(スコア割り当て)部A13は、P、Q、Rそれぞれについて生成情報を用いてスコアを付ける。上記の通り、Rのみがアプリケーション部分(App)の中で生成される。したがって、Pには0、Qには0、Rには2のスコアが割り当てられる。
 次に、並び替え(スコア割り当て)部B14は、P、Q、RそれぞれについてAPP/LIB情報を用いてスコアを割り当てる。いま、PはLIB、QとRはAPPであるため、Pには0、QとRには1のスコアが割り当てられる。並び替え(スコア割り当て)部A13において割り当てられたスコアと足し合わせると、結局、Pには0、Qには1、Rには3がスコアとして付けられる。
 このとき、選択結果表示部15は、Rを最も見やすい場所に表示し、次にQ、最後にPの順で見やすい場所に表示される。なお、RTAの場合には、同様にして、R、Qの順で見やすい場所に表示される。このように、選択結果表示部15によって、最も見やすく、かつ、選択しやすい場所に表示される型はRとなる。4行目における変数pによって、実行時に参照されるオブジェクトの型は3行目よりRである。したがって、利用者には、最も見やすい場所に、実行時におけるインスタンス・メソッドの処理内容に応じた定義情報が表示されることになる。
 選択結果表示部15は、利用者がPを選択した場合には9行目の定義、Qを選択した場合には12行目の定義、Rを選択した場合には15行目の定義を、それぞれGUI画面上に表示する。
 本発明は、プログラムの開発を支援するプログラム開発環境のプログラム閲覧機能といった用途に適用することができる。また、プログラムの閲覧を支援するプログラム閲覧ツールといった用途にも適用することができる。
 なお、前述の特許文献等の各開示を、本書に引用をもって繰り込むものとする。本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態ないし実施例の変更・調整が可能である。また、本発明の請求の範囲の枠内において種々の開示要素の多様な組み合わせないし選択が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。

Claims (17)

  1.  利用者によって選択されたインスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型に含まれる該インスタンス・メソッドの定義情報を表示することを特徴とする情報表示装置。
  2.  変数によって実行時に参照され得る型を参照情報として記憶する記憶装置と、
     前記インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照される可能性のある型を前記参照情報から抽出する実行時型収集部と、
     抽出された型に含まれる前記インスタンス・メソッドの定義情報を表示する選択結果表示部と、を備えることを特徴とする、請求項1に記載の情報表示装置。
  3.  アプリケーション部において生成された型に対し、ライブラリ部において生成された型に対して割り当てられるスコアよりも高いスコアを割り当てる第1の並び替え部、及び/又は、
     アプリケーション部に属する型に対し、ライブラリ部に属する型に対して割り当てられるスコアよりも高いスコアを割り当てる第2の並び替え部を備えることを特徴とする、請求項2に記載の情報表示装置。
  4.  アプリケーション部で生成されかつアプリケーション部に属する型、アプリケーション部で生成されかつアプリケーション部に属さない型、アプリケーション部で生成されずかつアプリケーション部に属する型、及び、それ以外の型に対し、それぞれスコアを割り当てることを特徴とする、請求項3に記載の情報表示装置。
  5.  アプリケーション部で生成されかつアプリケーション部に属する型、アプリケーション部で生成されかつアプリケーション部に属さない型、アプリケーション部で生成されずかつアプリケーション部に属する型、及び、それ以外の型に対し、この順に単調に減少するスコアを割り当てることを特徴とする、請求項3に記載の情報表示装置。
  6.  前記選択結果表示部は、スコアの降順にソートして各型に含まれるインスタンス・メソッドの定義情報を表示することを特徴とする、請求項3乃至5のいずれか1項に記載の情報表示装置。
  7.  前記選択結果表示部は、スコアの高い型における前記インスタンス・メソッドの定義情報ほど利用者にとって見やすい又は選択しやすい場所に表示することを特徴とする、請求項3乃至5のいずれか1項に記載の情報表示装置。
  8.  利用者によって選択されたインスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型に含まれる該インスタンス・メソッドの定義情報を表示する工程を含むことを特徴とする情報表示方法。
  9.  変数によって実行時に参照され得る型を参照情報として記憶する記憶装置を参照して、前記インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型を前記参照情報から抽出する実行時型収集工程と、
     抽出された型に含まれる前記インスタンス・メソッドの定義情報を表示する選択結果表示工程と、を含むことを特徴とする、請求項8に記載の情報表示方法。
  10.  アプリケーション部において生成された型に対し、ライブラリ部において生成された型に対して割り当てられるスコアよりも高いスコアを割り当てる第1のスコア割り当て工程、及び/又は、
     アプリケーション部に属する型に対し、ライブラリ部に属する型に対して割り当てられるスコアよりも高いスコアを割り当てる第2のスコア割り当て工程を含むことを特徴とする、請求項9に記載の情報表示方法。
  11.  アプリケーション部で生成されかつアプリケーション部に属する型、アプリケーション部で生成されかつアプリケーション部に属さない型、アプリケーション部で生成されずかつアプリケーション部に属する型、及び、それ以外の型に対し、この順に単調に減少するスコアを割り当てることを特徴とする、請求項10に記載の情報表示方法。
  12.  前記選択結果表示工程において、スコアの高い型における前記インスタンス・メソッドの定義情報ほど利用者にとって見やすい又は選択しやすい場所に表示することを特徴とする、請求項10又は11に記載の情報表示方法。
  13.  利用者によって選択されたインスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型に含まれる該インスタンス・メソッドの定義情報を表示する処理をコンピュータに実行させることを特徴とする情報表示プログラム。
  14.  変数によって実行時に参照され得る型を参照情報として記憶する記憶装置を参照して、前記インスタンス・メソッドのレシーバ・オブジェクトを参照する変数によって実行時に参照され得る型を前記参照情報から抽出する実行時型収集処理と、
     抽出された型に含まれる前記インスタンス・メソッドの定義情報を表示する選択結果表示処理と、をコンピュータに実行させることを特徴とする、請求項13に記載の情報表示プログラム。
  15.  アプリケーション部において生成された型に対し、ライブラリ部において生成された型に対して割り当てられるスコアよりも高いスコアを割り当てる第1のスコア割り当て処理、及び/又は、
     アプリケーション部に属する型に対し、ライブラリ部に属する型に対して割り当てられるスコアよりも高いスコアを割り当てる第2のスコア割り当て処理をコンピュータに実行させることを特徴とする、請求項14に記載の情報表示プログラム。
  16.  アプリケーション部で生成されかつアプリケーション部に属する型、アプリケーション部で生成されかつアプリケーション部に属さない型、アプリケーション部で生成されずかつアプリケーション部に属する型、及び、それ以外の型に対し、この順に単調に減少するスコアを割り当てる処理をコンピュータに実行させることを特徴とする、請求項15に記載の情報表示プログラム。
  17.  前記選択結果表示処理において、スコアの高い型における前記インスタンス・メソッドの定義情報ほど利用者にとって見やすい又は選択しやすい場所に表示する処理をコンピュータに実行させることを特徴とする、請求項15又は16に記載の情報表示プログラム。
PCT/JP2009/052830 2008-02-19 2009-02-19 情報表示装置、方法及びプログラム WO2009104658A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2009554357A JP5359891B2 (ja) 2008-02-19 2009-02-19 情報表示装置、方法及びプログラム
US12/918,287 US20100328202A1 (en) 2008-02-19 2009-02-19 Information display device, information display method, and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2008-037604 2008-02-19
JP2008037604 2008-02-19

Publications (1)

Publication Number Publication Date
WO2009104658A1 true WO2009104658A1 (ja) 2009-08-27

Family

ID=40985536

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/052830 WO2009104658A1 (ja) 2008-02-19 2009-02-19 情報表示装置、方法及びプログラム

Country Status (3)

Country Link
US (1) US20100328202A1 (ja)
JP (1) JP5359891B2 (ja)
WO (1) WO2009104658A1 (ja)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04181436A (ja) * 1990-11-16 1992-06-29 Fujitsu Ltd デバック方式
JP2002517815A (ja) * 1998-06-03 2002-06-18 マイクロソフト コーポレイション オブジェクトベースプログラミングでのメソッド参照

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04181426A (ja) * 1990-11-16 1992-06-29 Hitachi Ltd オブジェクト指向プログラム表示方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04181436A (ja) * 1990-11-16 1992-06-29 Fujitsu Ltd デバック方式
JP2002517815A (ja) * 1998-06-03 2002-06-18 マイクロソフト コーポレイション オブジェクトベースプログラミングでのメソッド参照

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JUN AOKI, OBJECTORRERY (THE FORMER TITLE: VISUALCOMPASS), 1998, Retrieved from the Internet <URL:http://www.sra.co.jp/smalltalk/ObjectOrrery/Japanese/intro/compassShort.htm,http://www.sra.co.jp/smalltalk/ObjectOrrery/Japanese/manual/man03ins.htm> [retrieved on 20090316] *
MIYAMOTO: "Eclipse3 de Hajimeru Java Web Application Kaihatsu Dai 4 Kai: Eclipse no Benri na Kino", 9 February 2005 (2005-02-09), Retrieved from the Internet <URL:http://www.thinkit.co.jp/free/tech/3/4/l.html> [retrieved on 20090304] *

Also Published As

Publication number Publication date
JP5359891B2 (ja) 2013-12-04
JPWO2009104658A1 (ja) 2011-06-23
US20100328202A1 (en) 2010-12-30

Similar Documents

Publication Publication Date Title
EP3876116B1 (en) Method and apparatus for running mini program, electronic device, and storage medium
JP4965623B2 (ja) 所定のソフトウェアの実行パラメータを入力フィールドへ入力することを支援するための方法、システム、およびプログラム
US10120654B2 (en) Domain specific language design
US7415696B2 (en) Extensible help facility for a computer software application
US8578328B2 (en) Method for presenting candidate for link target to component in web application, as well as computer program and computer system for the same
US7093199B2 (en) Design environment to facilitate accessible software
CN108351764B (zh) 数据处理方法和系统
US20060209035A1 (en) Device independent specification of navigation shortcuts in an application
US20070244691A1 (en) Translation of user interface text strings
JP2006228228A (ja) アクティブコンテンツウィザードおよびヘルプ機能を改善する方法
US20060107234A1 (en) Computer-implemented graphical user interface previews
US9471405B1 (en) Methods and systems for access to legacy programs using non-legacy interfaces
JP2000112708A (ja) ユ―ザ・インタフェ―ス及びその構築方法
US8527259B1 (en) Contextual translation of digital content
KR20050061534A (ko) 툴-팁 재생 시스템, 툴-팁 디스플레이 방법 및 머신 판독가능 저장 장치
US8701086B2 (en) Simplifying analysis of software code used in software systems
JP2014021508A (ja) 文書関連付け装置及びプログラム
WO2017141893A1 (ja) ソフトウェア分析装置及びソフトウェア分析方法
US11803697B2 (en) Method and system for labeling and organizing data for summarizing and referencing content via a communication network
US20070057921A1 (en) Standardized/extensible semantics in device independent navigation shortcuts in an application
CN112799760B (zh) 一种表单渲染方法及其装置
JP6866270B2 (ja) Sql文抽出装置、sql文抽出方法及びプログラム
JP2005346666A (ja) Webページ翻訳装置及びwebページ翻訳方法
US20150261388A1 (en) Method and apparatus for gesture operation on address bar and touch screen terminal
JP5359891B2 (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: 09712687

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2009554357

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 12918287

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09712687

Country of ref document: EP

Kind code of ref document: A1