Trace table generation method, trace table generation device, program, and trace table
The trace table generation method and device improve program execution understanding by visually representing variable transitions and judgment results, making it easier for students to comprehend program processes.
Patent Information
- Application Number
- JP2024106757
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2026-01-16
AI Technical Summary
Existing trace table generation methods do not effectively facilitate understanding of program execution processes for programming students.
A method and device that generate a trace table by arranging variable transitions in rows and increasing columns based on execution data, incorporating judgment results and moving images to visually represent program execution.
Enhances students' comprehension of program execution by clearly displaying variable transitions and judgment results, facilitating easier understanding of program processes.
Smart Images

Figure 2026007176000001_ABST
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a method for generating a trace table that indicates the execution process of a program by a computer. [Background technology]
[0002] A trace table, which is partially displayed in a fill-in-the-blank format, has been known as a programming learning support tool (see, for example, Non-Patent Document 1). A trace table is a table that shows how the values of variables change during the execution of a program. [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] Miyuki Murata, Naoko Kato, and Tetsuro Kakeshita, "Analysis of Classroom Practice and Learning Behavior Using the Programming Learning Support Tool pgtracer for Self-Study," Information Processing Society of Japan Transactions on Education and Computers, June 15, 2020, Vol. 6, No. 2, pp. 25-37 Summary of the Invention [Problem to be solved by the invention]
[0004] An object of the present disclosure is to provide a trace table generation method and the like that can generate a trace table that makes it easier for programming students to understand the execution process of a program. [Means for solving the problem]
[0005] In order to achieve the above object, a trace table generation method according to one embodiment of the present disclosure is a trace table generation method in which a computer generates a trace table consisting of instruction lines that constitute a target program and information indicating variable transitions when the instruction lines are executed by the computer, and includes an acquisition step of acquiring trace data indicating the variable transitions, and a generation step of generating the trace table based on the trace data acquired in the acquisition step, in which the trace table is generated by arranging values at the transitions of the variables included in the instruction lines in one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table in accordance with the transitions of the values, to generate the trace table.
[0006] In order to achieve the above object, a trace table generation device according to one embodiment of the present disclosure is a trace table generation device that generates a trace table consisting of instruction lines that constitute a target program and information indicating variable transitions when the instruction lines are executed by a computer, and includes an acquisition unit that acquires trace data indicating the variable transitions, and a generation unit that generates the trace table based on the trace data acquired by the acquisition unit, and the generation unit generates the trace table by arranging values at the transitions of the variables included in the instruction lines in one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table as the values transition.
[0007] To achieve the above goal, a program according to one embodiment of the present disclosure causes a computer to execute the steps included in the above trace table generation method.
[0008] In order to achieve the above goal, a trace table according to one embodiment of the present disclosure is a trace table generated by the above trace table generation method. [Effects of the Invention]
[0009] The present disclosure provides a trace table generation method and the like that can generate a trace table that makes it easier for programming students to understand the execution process of a program. [Brief explanation of the drawings]
[0010] [Figure 1] FIG. 1 is a block diagram showing the configuration of a system including a trace table generating device according to an embodiment. [Figure 2] FIG. 2 is a flowchart showing the operation of the trace table generating device according to the embodiment. [Figure 3] FIG. 3 is a diagram that schematically illustrates the flowchart shown in FIG. [Figure 4] FIG. 4 is a diagram showing a first specific example of a trace table displayed on the display unit. [Figure 5A] FIG. 5A is a diagram for explaining an example of how the trace table is displayed when a moving image is played back. [Figure 5B] FIG. 5B is a diagram for explaining an example of how the trace table is displayed when a moving image is played back. [Figure 6A] FIG. 6A is a diagram for explaining a modification of the trace table shown in FIG. [Figure 6B] FIG. 6B is a diagram for explaining a modification of the trace table shown in FIG. [Figure 7] FIG. 7 is a diagram showing a second specific example of the trace table displayed on the display unit. [Figure 8] FIG. 8 is a diagram showing a third specific example of the trace table displayed on the display unit. DETAILED DESCRIPTION OF THE INVENTION
[0011] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. Note that each of the embodiments described below represents a specific example of the present disclosure. Therefore, the numerical values, shapes, materials, components, component placement and connection configurations, processes (steps), and process order shown in the following embodiments are merely examples and are not intended to limit the present disclosure. Therefore, among the components in the following embodiments, components that are not described in the independent claims of the present disclosure will be described as optional components.
[0012] (Embodiment) [composition] First, a trace table generating device 1 according to an embodiment will be described with reference to Fig. 1. Fig. 1 is a block diagram showing the configuration of a system including the trace table generating device 1 according to an embodiment.
[0013] As shown in FIG. 1, the present disclosure comprises a trace table generating device 1 and an external device 2.
[0014] The trace table generating device 1 is a device that generates a trace table consisting of lines of instructions that make up a target program and information indicating transitions of variables when the lines of instructions are executed by a computer. The trace table generating device 1 is, for example, a terminal device such as a personal computer. The trace table generating device 1 also includes an input unit 11, a storage unit 12, a control unit 13, and an output unit 14. The lines of instructions are text (i.e., code) that contains instructions to a computer. The trace table is a table that indicates how the values of variables change during the execution of the target program.
[0015] The input unit 11 is an interface that accepts input from a user (e.g., a programming student). The input unit 11 accepts input of a target program and stores the accepted target program in the storage unit 12. The target program is, for example, a program created by a user and is a program composed of lines of commands. The input unit 11 may also specify a storage location for the target program, and the target program may be read from the specified storage location into the storage unit 12.
[0016] The storage unit 12 is a storage device that stores various data (for example, a target program received by the input unit 11) and a program executed by the control unit 13. The storage unit 12 is realized by, for example, a memory.
[0017] The control unit 13 controls the entire trace table generating device 1. The control unit 13 is realized by a microcomputer, a processor, or the like. That is, the functions of the control unit 13 are realized by the microcomputer, the processor, or the like executing a program stored in the storage unit 12. The control unit 13 also includes an acquisition unit 131 and a generation unit 132.
[0018] The acquisition unit 131 executes the target program accepted by the input unit 11 to acquire trace data indicating transitions of variables when lines of instructions constituting the target program are executed by a computer. The acquisition unit 131 also acquires, as trace data, a determination result of the lines of instructions that involves a determination of true or false. The acquisition unit 131 also stores the acquired trace data in the storage unit 12. The acquisition unit 131 is realized, for example, by a simulator or a debugger. The determination result of the lines of instructions is, for example, a result indicating whether or not the value of the transition of a variable included in the line of instructions satisfies a condition indicated in the line of instruction.
[0019] The generation unit 132 generates a trace table based on the trace data acquired by the acquisition unit 131. Specifically, the generation unit 132 generates the trace table by arranging values at the transition of variables included in an instruction line in one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table as the value transitions. The generation unit 132 also generates the trace table by arranging the judgment result of the instruction line in one or more rows, including the same row as the corresponding instruction line, in the value column of the trace table. Note that in this specification, the trace table is a table in which the instruction lines of the target program accepted by the input unit 11 are associated with the trace data acquired by the acquisition unit 131. The trace table generated by the generation unit 132 will be described in detail later.
[0020] The output unit 14 is an interface that outputs the trace table generated by the generation unit 132 to the external device 2. The output unit 14 may perform, for example, wireless communication or wired communication. Furthermore, the communication standard of the communication performed by the output unit 14 is not particularly limited.
[0021] The external device 2 is a device that displays to a user the trace table generated by the trace table generating device 1. The external device 2 is, for example, a terminal device such as a personal computer. The external device 2 also includes a communication unit 21, a control unit 22, and a display unit 23.
[0022] The communication unit 21 is a communication circuit for the external device 2 to communicate with the trace table generating device 1. The communication unit 21 may perform, for example, wireless communication or wired communication. Furthermore, the communication standard of the communication performed by the communication unit 21 is not particularly limited.
[0023] The control unit 22 controls the entire external device 2. The control unit 22 is realized by a microcomputer, a processor, or the like. That is, the functions of the control unit 22 are realized by the microcomputer, the processor, or the like executing a program stored in a memory.
[0024] The control unit 22 displays the trace table received by the communication unit 21 on the display unit 23 .
[0025] The display unit 23 is realized by, for example, a display including a liquid crystal panel or an organic EL panel.
[0026] The input unit 11 may accept a target program created in advance by the user, or may accept lines of commands input by the user.
[0027] Furthermore, instead of displaying the trace table on the display unit 23 of the external device 2, the trace table generating device 1 may use the output unit 14 as a display that displays the trace table generated by the generating unit 132 to the user.
[0028] [Operation] Next, the operation of the trace table generating device 1 according to the embodiment will be described with reference to Fig. 2 and Fig. 3. Fig. 2 is a flowchart showing the operation of the trace table generating device 1 according to the embodiment. Fig. 3 is a diagram that schematically expresses the flowchart shown in Fig. 2.
[0029] First, the input unit 11 receives an input of a target program (step S1).
[0030] The acquiring unit 131 executes the target program received by the input unit 11 to acquire trace data indicating transitions of variables when lines of instructions constituting the target program are executed by a computer (step S2). In Fig. 3, the table shown under the word "simulator" is the trace data. In the example shown in Fig. 3, the trace data is expressed in a format that can be visually understood by humans, but the format is not limited to this as long as it is expressed in a format that can be understood by the trace table generating device 1.
[0031] The generation unit 132 generates a trace table based on the trace data acquired by the acquisition unit 131 in step S2 (step S3). Specifically, the generation unit 132 generates the trace table by arranging values at the transition of variables included in an instruction line in one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table in accordance with the transition of the value. Note that in FIG. 3, the table at the end of the arrow in step S3 is the trace table. Also, in FIG. 3, the generation unit 132 generates multiple trace tables, but it is sufficient to generate at least one trace table. For example, the generation unit 132 may generate multiple trace tables in which values at the transition of variables are arranged in order according to the order in which the instruction lines are executed, or may generate one trace table in which all of the trace data acquired in step S2 is displayed.
[0032] The output unit 14 outputs the trace table generated by the generation unit 132 in step S3 to the external device 2 (step S4). After step S4, the external device 2 displays the trace table on the display unit 23.
[0033] In step S2, the acquiring unit 131 may further acquire the determination result of the command line.
[0034] In step S3, the generating unit 132 may also generate the trace table by arranging the determination results of the instruction lines in the value column of the trace table in one or more rows including the same row as the corresponding instruction line.
[0035] In step S3, the generating unit 132 may also generate the trace table by arranging arrows at the values of the transitions of variables according to the order in which the lines of instructions are executed.
[0036] Furthermore, in step S4, the output unit 14 may further output voice data that reads out the values of the transitions of variables included in the command line and the determination results of the command line to the external device 2. For example, the output unit 14 generates voice data using existing voice synthesis software and outputs the voice data to the external device 2.
[0037] In step S4, the output unit 14 may update the columns of the trace table generated in step S3 to include some of the columns and output the updated trace table. Specific examples of the trace table will be described later.
[0038] In step S3, the generation unit 132 may generate a trace table as a structure of a moving image, and in step S4, the output unit 14 may output the trace table from which a moving image is reproduced in response to a user's operation of an operation button. The output unit 14 outputs the trace table to the external device 2, for example, using existing moving image generation software. Specific examples of the trace table will be described later.
[0039] [Example of trace table] Specific examples of trace tables displayed on display unit 23 will be described with reference to Fig. 4 to Fig. 8. In the specific examples shown in Fig. 4 to Fig. 8, the target program is a program created using the programming language Python (registered trademark). The specific examples of trace tables shown in Fig. 4 to Fig. 8 are specific examples of trace tables generated by generation unit 132.
[0040] First, a first specific example of a trace table displayed on the display unit 23 will be described with reference to Fig. 4. Fig. 4 is a diagram showing a first specific example of a trace table displayed on the display unit 23. The target program shown in Fig. 4 is a program that displays "Pass" if the score x is 60 points or more, and displays "Fail" if the score x is less than 60 points.
[0041] 4, the trace table is made up of a first area 31, a second area 32, a third area 33, and a fourth area 34. It is sufficient that the trace table is made up of at least the first area 31.
[0042] The first area 31 is an area where a trace table is displayed, including the lines of instructions of the target program received by the input unit 11 and the trace data acquired by the acquisition unit 131. In the specific example shown in Fig. 4, in the trace table displayed in the first area 31, columns A to B display the lines of instructions of the target program received by the input unit 11, and columns C to E display the trace data acquired by the acquisition unit 131. Each column will be described below.
[0043] Column A displays the number of lines of instruction in the target program (i.e., the order in which the lines of instruction in the target program are executed by the computer). Column B displays the lines of instruction that make up the target program. Column C displays the items when each line of instruction is executed by the computer. Columns D and E display the values of variable transitions and the judgment results of the lines of instruction when each line of instruction is executed by the computer. In the specific example shown in Figure 4, the values of variable transitions refer to characters expressed as numbers or mathematical expressions, such as "80" or "80>=60", and the judgment results of the lines of instruction refer to characters expressed in a language including "True" or "False", etc.
[0044] Furthermore, when one looks at each row of the table displayed in the first area 31, the values at the transition of the variables included in the command line and the judgment results of the command line are displayed in one or more rows, including the same row as the command line. For example, in a row where column A indicates "2," the values at the transition of the variables included in the command line are displayed in one row. Also, in a row where column A indicates "3," the values at the transition of the variables included in the command line and the judgment results of the command line are displayed in two rows.
[0045] In columns D and E, arrows are placed at the values of the variable transitions and the judgment results of the command lines according to the order in which the command lines are executed.
[0046] In the specific example shown in FIG. 4, the target program is executed after the value of variable x is set to each of two values (80, 50) in the row where column A indicates "2." In other words, the instruction line constituting the target program is executed twice by the computer. Specifically, column D displays trace data obtained in the first execution, and column E displays trace data obtained in the second execution. Looking at each row in columns D to E, for example, in the row where column A indicates "2," two trace data obtained from the same instruction line are shown. In other words, when an instruction line constituting the target program is executed multiple times, multiple trace data obtained from the same instruction line are arranged in different columns of the trace table in one or more rows, including the same row as the instruction line.
[0047] Furthermore, the trace table displayed in the first area 31 plays back a moving image showing the execution process of the target program in response to the user's operation of the operation button. A specific example of playing back a moving image will be described later.
[0048] The second area 32 is an area that displays a scroll bar that indicates the playback position of the video. In the specific example shown in Fig. 4, the second area 32 indicates that playback of the video has been completed to the end. The scroll bar displayed in the second area 32 is an icon that can be operated by the user, and the playback position of the video is updated when the user slides the scroll bar to any position.
[0049] The third area 33 is an area for displaying operation buttons that accept operations on the moving image by the user. In the specific example shown in Fig. 4, nine operation buttons are displayed in the third area 33, but it is not necessary to display nine operation buttons. Each operation button will be described below.
[0050] The leftmost operation button is an operation button for decreasing the forward and reverse playback speeds of the video, and the rightmost operation button is an operation button for increasing the forward and reverse playback speeds of the video. The second operation button from the left is an operation button for changing the playback position of the video to the beginning, and the second operation button from the right is an operation button for changing the playback position of the video to the end. The third operation button from the left is an operation button for changing the playback position of the video to the previous playback position, and the third operation button from the right is an operation button for changing the playback position of the video to the next playback position. The fourth operation button from the left is an operation button for playing the video in reverse, and the fourth operation button from the right is an operation button for playing the video. The operation button displayed in the center is an operation button for stopping forward and reverse playback of the video.
[0051] The fourth area 34 is an area for displaying selection icons that accept settings for the playback state of the video. For example, if the user selects the selection icon labeled "Once" on the right, the video is played back or played back in reverse only once. If the user selects the selection icon labeled "Loop" on the right, the video is played back or played back in reverse continuously. If the user selects the selection icon labeled "Reflect" on the right, the video is played back in reverse once playback has been completed, and then the video is played back once reverse playback has been completed.
[0052] Next, a display example of the trace table when a moving image is played will be described with reference to Fig. 5A and Fig. 5B. Fig. 5A and Fig. 5B are diagrams for explaining a display example of the trace table when a moving image is played. Fig. 5B is a diagram showing an image displayed after Fig. 5A is displayed when a moving image is played. Note that the command lines and trace data constituting the target program shown in Fig. 5A and Fig. 5B are the same as the command lines and trace data constituting the target program shown in Fig. 4.
[0053] 5A, in the first area 31, in the row where column A, which is the target of execution in the target program, indicates "2," the displays in columns B, C, and D are displayed in inverted black and white. Also, in column B, an arrow is displayed from the row where column A indicates "2" to the row where column A indicates "3." Also, in column D, an arrow is displayed from the row where column A indicates "1" to the row where column A indicates "2," and from the row where column A indicates "2" to the row where column A indicates "3."
[0054] 5B, when focusing on the first area 31, in the row where column A, which is the next to be executed in the target program, indicates "3," the displays in columns B, C, and D are displayed in reversed black and white. In column D, arrows are shown from the row where column A indicates "1" to the row where "2" indicates "2," from the row where "2" indicates "3," and from the row where column A indicates "3" to the row one below.
[0055] As shown in the specific examples of Figures 5A and 5B, the lines and arrows displayed in reverse video move, making it easier for the user to visually recognize the order in which the target program is executed by the computer.
[0056] 5A and 5B, synthetic speech may be played in synchronization with the playback of the video. For example, when the video shown in FIG. 5A is being played, synthetic speech such as "X is 80" may be played.
[0057] 5A and 5B, the values of the variable transitions and the determination results of the command lines shown in columns D and E may be displayed in accordance with the timing at which the video is played. When the video shown in Fig. 5A is played, for example, only the "80" in the second line of column D may be displayed as the values of the variable transitions and the determination results of the command lines shown in columns D and E, with the rest being displayed as blanks.
[0058] Furthermore, when a moving image is played back in reverse, the image shown in FIG. 5A is displayed after the image shown in FIG. 5B is displayed.
[0059] Furthermore, in the specific example shown in FIGS. 5A and 5B, the arrows displayed in columns D and onwards can be "one arrow" only in the same row as the arrow in column B.
[0060] 6A and 6B are diagrams for explaining modified examples of the trace table shown in Fig. 4. The trace table shown in Fig. 6A and 6B differs from the trace table shown in Fig. 4 in that a scroll bar 311 is displayed in the first area 31.
[0061] The scroll bar 311 is an icon that can be operated by the user, and the user can slide the scroll bar 311 to any position to update the columns of the trace table displayed in the first area 31. In the example shown in Fig. 6A, the scroll bar 311 is located at the left end, and columns A to E are displayed in the first area 31. In the example shown in Fig. 6B, the scroll bar 311 is located at the right end, and columns A to C and columns X to Y are displayed in the first area 31. As in the modified examples shown in Figs. 6A and 6B, when there are many columns that display values in variable transitions and judgment results of instruction lines, a trace table that includes only some of the columns may be displayed.
[0062] As described above, the trace table generating device 1 generates a trace table in which values at the transition of variables included in an instruction line are arranged in one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table. As a result, as the value of the variable transitions, the values are arranged by transitioning in a direction in which the number of columns increases (i.e., to the right), rather than in a direction in which the number of rows increases (i.e., downward), so that the user can easily visually recognize the correspondence between the instruction line executed by the computer and the values at the transition of variables corresponding to the instruction line.
[0063] Furthermore, the trace table generating device 1 generates a trace table in which the judgment results of the command lines are arranged in the value column of the trace table in one or more rows including the same row as the corresponding command line, thereby making it easier for the user to visually recognize the correspondence between the command lines executed by the computer and the judgment results of the command lines.
[0064] In addition, the trace table generating device 1 generates a trace table in which arrows are placed on the values of variable transitions according to the order in which the lines of instructions are executed, making it easier for the user to visually recognize the order in which the target program was executed by the computer.
[0065] Furthermore, the trace table generating device 1 outputs the trace table generated in the generating step (S3) to the external device 2, so that the user can check the trace table via the external device 2.
[0066] In addition, the trace table generation device 1 outputs audio data that reads out the values of the variable transitions contained in the command lines, making it easier for the user to recognize the correspondence between the command lines executed by the computer and the values of the variable transitions contained in the command lines.
[0067] In addition, the trace table generation device 1 updates the multiple columns that make up the trace table to a trace table that includes only some of the multiple columns and outputs it, so that the user can select and check the necessary data from the trace table.
[0068] Furthermore, since the trace table generating device 1 plays back moving images in response to the user's operation of the operation buttons, the user can easily visually recognize the order in which the target programs are executed by the computer.
[0069] Next, a second specific example of the trace table displayed on the display unit 23 will be described with reference to Fig. 7. Fig. 7 is a diagram showing a second specific example of the trace table displayed on the display unit 23. Note that the target program shown in Fig. 7 is different from the target program shown in Fig. 4. The target program shown in Fig. 7 is a program that displays the addition of "10" to the variable x five times.
[0070] As shown in Fig. 7, the trace table is made up of a first area 31, a second area 32, a third area 33, and a fourth area 34. Note that the second area 32, the third area 33, and the fourth area 34 shown in Fig. 7 are the same as the second area 32, the third area 33, and the fourth area 34 shown in Fig. 4, and therefore a description thereof will be omitted.
[0071] The first area 31 shown in Fig. 7 differs from the first area 31 shown in Fig. 4 in that columns F to H are additionally displayed. Note that, like columns D to E, columns F to H display the values of variable transitions when each command line is executed by the computer and the judgment results of the command line.
[0072] 7, the target program is executed after the value of variable x is set to one value (0) in the row where column A indicates "2." In other words, trace data obtained by executing the instruction lines constituting the target program once by the computer is displayed. Specifically, in column D, the instruction lines from row where column A indicates "2" to row where column A indicates "6" are executed, and then the instruction lines from row where column A indicates "4" to row where column A indicates "6" are executed in columns E to H. In other words, the transition values of variables corresponding to the repeatedly executed instruction lines (in the specific example shown in FIG. 7, the instruction lines from row where column A indicates "4" to row where column A indicates "6") are arranged in different columns of the trace table. This allows the transition of variable values to be arranged in the direction of increasing columns (i.e., to the right) rather than in the direction of increasing rows (i.e., downward). This makes it easier for the user to visually recognize the correspondence between the instruction lines executed by the computer and the transition values of variables corresponding to the instruction lines.
[0073] Next, a third specific example of a trace table displayed on the display unit 23 will be described with reference to Fig. 8. Fig. 8 is a diagram showing a third specific example of a trace table displayed on the display unit 23. Note that the target program shown in Fig. 8 is different from the target programs shown in Figs. 4 and 7. The target program shown in Fig. 8 is a program that searches for and displays whether a specified variable contains a specific number (43 in the specific example shown in Fig. 8).
[0074] As shown in Fig. 8, the trace table is made up of a first area 31, a second area 32, a third area 33, and a fourth area 34. Note that the second area 32, the third area 33, and the fourth area 34 shown in Fig. 8 are the same as the second area 32, the third area 33, and the fourth area 34 shown in Fig. 4, and therefore a description thereof will be omitted.
[0075] The first area 31 shown in Fig. 8 differs from the first area 31 shown in Fig. 4 in that columns F to G are additionally displayed. Note that, like columns D to E, columns F to G display the values of the variables at the time of transition when each command line is executed by the computer, and the judgment results of the command line.
[0076] 8, the target program is executed after the variable a is set to one type of variable ([25, 33, 43, 51, 66, 71, 88]) in the row where column A indicates "18." That is, similar to the specific example shown in FIG. 7, trace data obtained by executing the instruction lines constituting the target program once by the computer is displayed. Specifically, in column D, the instruction lines from the row where column A indicates "18" to the row where column A indicates "19" are executed, and then in column E, the instruction lines from the row where column A indicates "2" to the row where column A indicates "7" and the instruction lines from the row where column A indicates "10" to the row where column A indicates "11" are executed (that is, the first search is executed). After the first search is executed in column E, the instruction lines from the row where column A indicates "5" to the row where column A indicates "7," the instruction line of the row where column A indicates "10," and the instruction lines from the row where column A indicates "12" to the row where column A indicates "13" are executed (that is, the second search is executed). After the second search is performed in column F, the instruction lines in column G from the row indicating "5" to the row indicating "9" in column A are executed (i.e., the third search is performed). In other words, the transition values of the variables corresponding to the repeatedly executed instruction lines are arranged in different columns of the trace table in one or more rows including the same row as the instruction line. This causes the variable values to transition and be arranged in the direction of increasing columns (i.e., to the right) rather than in the direction of increasing rows (i.e., downward), making it easier for the user to visually recognize the correspondence between the instruction lines executed by the computer, the transition values of the variables corresponding to the instruction lines, and the judgment results of the instruction lines.
[0077] [effect] As explained above, the trace table generation method according to this embodiment is a trace table generation method in which a computer generates a trace table consisting of instruction lines that constitute a target program and information indicating variable transitions when the instruction lines are executed by the computer, and includes an acquisition step (S2) of acquiring trace data indicating variable transitions, and a generation step (S3) of generating a trace table based on the trace data acquired in the acquisition step (S2). In the generation step (S3), the trace table is generated by arranging values at the transitions of variables included in the instruction lines in one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table as the values transition.
[0078] This trace table generation method generates a trace table in which values at the transition of variables included in an instruction line are arranged in one or more rows, including the same row as the corresponding instruction line, with the columns of the trace table increasing with the transition of the values. As a result, values are arranged in a direction in which the number of columns increases (i.e., to the right) rather than a direction in which the number of rows increases (i.e., downward) with the transition of the variable value, making it easier for programming students to visually recognize the correspondence between the instruction line executed by the computer and the values at the transition of variables corresponding to the instruction line. Therefore, the trace table generation method can generate a trace table that makes it easier for programming students to understand the program execution process.
[0079] Furthermore, in the trace table generation method according to this embodiment, in the acquisition step (S2), the judgment results of the instruction lines, which involve a judgment of true or false, are further acquired as trace data, and in the generation step (S3), the trace table is generated by arranging the judgment results of the instruction lines in a value column in the trace table in one or more rows, including the same row as the corresponding instruction line.
[0080] This type of trace table generation method generates a trace table in which the judgment results of an instruction line are arranged in a value column in one or more rows, including the same row as the corresponding instruction line, so that students of programming can easily visually recognize the correspondence between the instruction line executed by the computer and the judgment results of that instruction line.
[0081] In addition, in the trace table generating method according to this embodiment, in the generating step (S3), the trace table is generated by placing arrows at the values of the transitions of variables according to the order in which the instruction lines are executed.
[0082] This method of generating a trace table generates a trace table in which arrows are placed at the values of variable transitions according to the order in which lines of instructions are executed, making it easier for students of programming to visually recognize the order in which the target program was executed by the computer.
[0083] Moreover, the trace table generating method according to the present embodiment further includes an output step (S4) of outputting the trace table generated in the generating step (S3) to the external device 2.
[0084] In this trace table generation method, the trace table generated in the generation step (S3) is output to the external device 2, so that a programming student can check the trace table via the external device 2.
[0085] Furthermore, in the trace table generating method according to the present embodiment, the output step (S4) further outputs voice data that reads out the values of the variables included in the command lines at the transitions.
[0086] This type of trace table generation method outputs audio data that reads out the values of the variable transitions contained in the command lines, making it easier for programming students to recognize the correspondence between the command lines executed by the computer and the values of the variable transitions contained in those command lines.
[0087] In the trace table generating method according to the present embodiment, the output step (S4) updates the plurality of columns constituting the trace table to a trace table including only some of the plurality of columns and outputs the updated trace table.
[0088] This trace table generation method updates the multiple columns that make up the trace table to a trace table that includes only some of the multiple columns and outputs it, so that programming students can select and check the data they need from the trace table.
[0089] Furthermore, in the trace table generation method according to this embodiment, in the generation step (S3), the trace table is further generated as a structure of a moving image, and in the output step (S4), the moving image is further played in response to the user's operation of an operation button.
[0090] This method of generating a trace table plays back moving images in response to the user's operation of the operation buttons, making it easier for programming students to visually recognize the order in which the target program was executed by the computer.
[0091] Furthermore, the trace table generating device 1 according to this embodiment is a trace table generating device 1 that generates a trace table consisting of instruction lines that constitute a target program and information indicating variable transitions when the instruction lines are executed by a computer, and includes an acquisition unit 131 that acquires trace data indicating variable transitions, and a generation unit 132 that generates a trace table based on the trace data acquired by the acquisition unit 131, and the generation unit 132 generates the trace table by arranging values at the transitions of variables included in the instruction lines in one or more rows including the same row as the corresponding instruction line, while increasing the columns of the trace table as the values transition.
[0092] Such a trace table generation device 1 generates a trace table in which values at the transition of variables included in an instruction line are arranged in one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table as the value transitions. As a result, values are arranged in a direction in which the number of columns increases (i.e., to the right) rather than a direction in which the number of rows increases (i.e., downward) as the value of the variable transitions, making it easier for programming students to visually recognize the correspondence between the instruction line executed by the computer and the values at the transition of variables corresponding to the instruction line. Thus, the trace table generation device 1 can generate a trace table that makes it easier for programming students to understand the process of program execution.
[0093] The program according to the present embodiment causes a computer to execute the steps included in the trace table generating method according to the present embodiment.
[0094] Such a program provides the same effects as the trace table generating method according to the present embodiment.
[0095] The trace table according to this embodiment is a trace table generated by the trace table generation method according to this embodiment.
[0096] Such a trace table provides the same effects as the trace table generating method according to this embodiment.
[0097] [Variations] The trace data generation method and the like according to the present disclosure have been described above based on the above embodiment, but are not limited to the above embodiment. As long as they do not deviate from the spirit of the present disclosure, various modifications conceivable by those skilled in the art to the above embodiment, or forms constructed by combining components of different embodiments, may also be included within the scope of one or more aspects.
[0098] In the above embodiments, each component may be configured with dedicated hardware, or may be realized by executing a software program suitable for each component. Each component may be realized by a program execution unit such as a CPU or processor reading and executing a software program recorded on a recording medium such as a hard disk or semiconductor memory.
[0099] In the above-described embodiments, some or all of the functions of the components may be realized by a processor such as a CPU executing a program.
[0100] In the above-described embodiment, the processing performed by a specific processing unit may be performed by another processing unit. The order of multiple processing operations may be changed, or multiple processing operations may be performed in parallel.
[0101] Furthermore, some or all of the components constituting each of the above devices may be configured as an IC card or a standalone module that can be attached to or detached from each device. The above IC card or module is a computer system composed of a microprocessor, ROM, RAM, etc. The above IC card or module may include a super multi-function LSI. The above IC card or module achieves its functions when the microprocessor operates in accordance with a computer program. The IC card or module may be tamper-resistant.
[0102] [Note] The above description of the embodiments discloses the following techniques.
[0103] (Technology 1) A trace table generation method in which a computer generates a trace table consisting of instruction lines that make up a target program and information indicating variable transitions when the instruction lines are executed by a computer, the method comprising: an acquisition step of acquiring trace data that indicates the variable transitions; and a generation step of generating the trace table based on the trace data acquired in the acquisition step, wherein in the generation step, the trace table is generated by arranging values at the transitions of the variables included in the instruction lines into one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table in accordance with the transitions of the values.
[0104] (Technology 2) The trace table generation method according to Technology 1, wherein the acquisition step further acquires the judgment result of the instruction line, which involves a judgment of true or false, as the trace data, and the generation step generates the trace table by arranging the judgment result of the instruction line in one or more rows, including the same row as the corresponding instruction line, in the value column in the trace table.
[0105] (Technology 3) The trace table generation method according to Technology 1 or 2, wherein in the generation step, the trace table is generated by placing arrows on values in the transitions of the variables according to the order in which the lines of instructions are executed.
[0106] (Technology 4) The trace table generating method according to any one of Technologies 1 to 3, further comprising an output step of outputting the trace table generated in the generating step to an external device.
[0107] (Technology 5) The trace table generating method according to Technology 4, wherein the output step further outputs voice data that reads out the values of the variables included in the command line at the transitions.
[0108] (Technology 6) A trace table generation method according to Technology 4 or 5, wherein in the output step, the plurality of columns constituting the trace table are updated to a trace table including only some of the plurality of columns and output.
[0109] (Technology 7) A trace table generation method described in any one of Technologies 4 to 6, wherein the generation step further generates the trace table as a moving image structure, and the output step further plays the moving image in response to a user's operation of an operation button.
[0110] (Technology 8) A trace table generation device that generates a trace table consisting of instruction lines that constitute a target program and information indicating variable transitions when the instruction lines are executed by a computer, comprising: an acquisition unit that acquires trace data that indicates the variable transitions; and a generation unit that generates the trace table based on the trace data acquired by the acquisition unit, wherein the generation unit generates the trace table by arranging values at the transitions of the variables included in the instruction lines in one or more rows, including the same row as the corresponding instruction line, while increasing the number of columns in the trace table in accordance with the transition of the values.
[0111] (Technology 9) A program for causing a computer to execute the steps included in the trace table generation method according to any one of techniques 1 to 7.
[0112] (Technology 10) A trace table generated by the trace table generation method according to any one of techniques 1 to 7. [Industrial Applicability]
[0113] The trace table generation method according to the present disclosure can be used, for example, as a programming learning support tool. [Explanation of symbols]
[0114] 1. Trace table generator 11 Input section 12 Storage section 13, 22 Control section 131 Acquisition Department 132 Generation part 14 Output section 2 External device 21 Communications Department 23 Display section 31 First area 311 Scrollbar 32 Second area 33 Third area 34 4th area
Claims
1. 1. A trace table generation method in which a computer generates a trace table including lines of instructions constituting a target program and information indicating transitions of variables when the lines of instructions are executed by a computer, comprising: an acquisition step of acquiring trace data indicating transitions of the variables; a generating step of generating the trace table based on the trace data acquired in the acquiring step, In the generating step, the trace table is generated by arranging values of the transitions of the variables included in the instruction lines in one or more rows including the same row as the corresponding instruction line while increasing the number of columns in the trace table in accordance with the transitions of the values. Trace table generation method.
2. The acquiring step further includes acquiring a judgment result of the command line involving a judgment of whether it is true or false as the trace data; In the generating step, the trace table is generated by arranging the determination results of the instruction lines in one or more rows including the same row as the corresponding instruction line in a column of the value in the trace table. The method of generating a trace table according to claim 1 .
3. In the generating step, the trace table is generated by arranging arrows at values in transitions of the variables in accordance with the order in which the lines of instructions are executed. The method of generating a trace table according to claim 1 .
4. further comprising an output step of outputting the trace table generated in the generating step to an external device. The method of generating a trace table according to claim 1 .
5. The output step further includes outputting voice data for reading out the values of the variables included in the command line at the transitions.
5. The method for generating a trace table according to claim 4.
6. In the output step, the plurality of columns constituting the trace table are updated to a trace table including only some of the plurality of columns, and the updated trace table is output.
5. The method for generating a trace table according to claim 4.
7. The generating step further includes generating the trace table as a structure of a moving image; The output step further includes playing back the moving image in response to an operation of an operation button by a user.
5. The method for generating a trace table according to claim 4.
8. A trace table generating device that generates a trace table including lines of instructions that constitute a target program and information indicating transitions of variables when the lines of instructions are executed by a computer, comprising: an acquisition unit that acquires trace data indicating transitions of the variables; a generation unit that generates the trace table based on the trace data acquired by the acquisition unit, the generation unit generates the trace table by arranging values at transitions of the variables included in the instruction lines in one or more rows including the same row as the corresponding instruction line while increasing the number of columns in the trace table in accordance with the transition of the values. Trace table generator.
9. A program for causing a computer to execute the steps included in the trace table generating method according to any one of claims 1 to 7.
10. A trace table generated by the trace table generation method according to any one of claims 1 to 7.