TWI751706B - Method and device for automatically generating development solution - Google Patents
Method and device for automatically generating development solution Download PDFInfo
- Publication number
- TWI751706B TWI751706B TW109131900A TW109131900A TWI751706B TW I751706 B TWI751706 B TW I751706B TW 109131900 A TW109131900 A TW 109131900A TW 109131900 A TW109131900 A TW 109131900A TW I751706 B TWI751706 B TW I751706B
- Authority
- TW
- Taiwan
- Prior art keywords
- specific output
- output message
- development
- command lines
- message
- Prior art date
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本發明是有關於一種輔助開發軟體的技術,且特別是有關於一種自動產生開發解決方案的方法及裝置。The present invention relates to a technology for assisting software development, and in particular, to a method and apparatus for automatically generating a development solution.
一般而言,在開發人員於開源(Open source)的開發環境中進行開發時,將經歷繁瑣冗長的開發歷程,而當遇到問題時,多半需要花費大量的時間尋求解決方法。Generally speaking, when developers develop in an open source (Open source) development environment, they will experience a tedious and lengthy development process, and when they encounter problems, most of them need to spend a lot of time finding solutions.
並且,經耗費許多時間找到的方法不見得為正確的解決方案,因此仍需要開發人員不斷地進行試誤(trial and error),且這些方法甚至可能產生不必要的副作用。Also, the time-consuming methods are not always the right solution, so developers still need constant trial and error, and these methods may even have unwanted side effects.
因此,對於本領域技術人員而言,若能設計一種能夠自動產生開發解決方案的技術,勢必能縮短相關的開發與除錯時間,並大幅降低開發的難度。Therefore, for those skilled in the art, if a technology that can automatically generate a development solution can be designed, the related development and debugging time will be shortened, and the development difficulty will be greatly reduced.
有鑑於此,本發明提供一種自動產生開發解決方案的方法及裝置,其可用於解決上述技術問題。In view of this, the present invention provides a method and apparatus for automatically generating a development solution, which can be used to solve the above-mentioned technical problems.
本發明提供一種自動產生開發解決方案的方法,包括:反應於判定在一開發環境中接收到一輸入按鍵的一觸發事件,取得開發環境因應於觸發事件而提供的一特定輸出訊息;取得多條第一指令行,其中所述多個第一指令行係於觸發事件與輸入按鍵的一先前觸發事件之間所接收;基於特定輸出訊息及所述多個第一指令行判斷特定輸出訊息是否屬於一錯誤訊息;反應於判定特定輸出訊息屬於錯誤訊息,取得於一先前錯誤訊息與特定輸出訊息之間的一時間區間內所接收的多條特定指令行;以及至少基於開發環境的開發環境資訊、特定輸出訊息及所述多個特定指令行提供對應於特定輸出訊息的一開發解決方案。The present invention provides a method for automatically generating a development solution, comprising: in response to determining that a trigger event of an input key is received in a development environment, obtaining a specific output message provided by the development environment in response to the trigger event; obtaining a plurality of a first command line, wherein the plurality of first command lines are received between a trigger event and a previous trigger event of the input key; determining whether the specific output message belongs to the specific output message and the plurality of first command lines an error message; in response to determining that the specific output message is an error message, a plurality of specific command lines received within a time interval between a previous error message and the specific output message are obtained; and at least the development environment information based on the development environment, The specific output message and the plurality of specific command lines provide a development solution corresponding to the specific output message.
本發明提供一種自動產生開發解決方案的裝置,包括儲存電路及處理器。儲存電路儲存多個模組。處理器耦接儲存電路,存取所述多個模組以執行下列步驟:反應於判定在一開發環境中接收到一輸入按鍵的一觸發事件,取得開發環境因應於觸發事件而提供的一特定輸出訊息;取得多條第一指令行,其中所述多個第一指令行係於觸發事件與輸入按鍵的一先前觸發事件之間所接收;基於特定輸出訊息及所述多個第一指令行判斷特定輸出訊息是否屬於一錯誤訊息;反應於判定特定輸出訊息屬於錯誤訊息,取得於一先前錯誤訊息與特定輸出訊息之間的一時間區間內所接收的多條特定指令行;以及至少基於開發環境的開發環境資訊、特定輸出訊息及所述多個特定指令行提供對應於特定輸出訊息的一開發解決方案。The present invention provides a device for automatically generating a development solution, including a storage circuit and a processor. The storage circuit stores a plurality of modules. The processor is coupled to the storage circuit, and accesses the plurality of modules to execute the following steps: in response to determining that a trigger event of an input key is received in a development environment, obtaining a specific information provided by the development environment in response to the trigger event output message; obtain a plurality of first command lines, wherein the plurality of first command lines are received between a trigger event and a previous trigger event of an input key; based on a specific output message and the plurality of first command lines determining whether the specific output message is an error message; in response to determining that the specific output message is an error message, obtaining a plurality of specific command lines received in a time interval between a previous error message and the specific output message; and at least based on the development The development environment information of the environment, the specific output message, and the plurality of specific command lines provide a development solution corresponding to the specific output message.
請參照圖1,其是依據本發明之一實施例繪示的自動產生開發解決方案的裝置示意圖。在不同的實施例中,裝置100例如是各式電腦裝置及/或智慧型裝置,但可不限於此。Please refer to FIG. 1 , which is a schematic diagram of an apparatus for automatically generating a development solution according to an embodiment of the present invention. In different embodiments, the
如圖1所示,裝置100包括儲存電路102及處理器104。儲存電路102例如是任意型式的固定式或可移動式隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read-Only Memory,ROM)、快閃記憶體(Flash memory)、硬碟或其他類似裝置或這些裝置的組合,而可用以記錄多個程式碼或模組。As shown in FIG. 1 , the
處理器104耦接於儲存電路102,並可為一般用途處理器、特殊用途處理器、傳統的處理器、數位訊號處理器、多個微處理器(microprocessor)、一個或多個結合數位訊號處理器核心的微處理器、控制器、微控制器、特殊應用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式閘陣列電路(Field Programmable Gate Array,FPGA)、任何其他種類的積體電路、狀態機、基於進階精簡指令集機器(Advanced RISC Machine,ARM)的處理器以及類似品。The
在本發明的實施例中,處理器104可存取儲存電路102中記錄的模組、程式碼來實現本發明提出的自動產生開發解決方案的方法,其細節詳述如下。In an embodiment of the present invention, the
請參照圖2,其是依據本發明之一實施例繪示的自動產生開發解決方案的方法流程圖。本實施例的方法可由圖1的裝置100執行,以下即搭配圖1所示的元件說明圖2各步驟的細節。Please refer to FIG. 2 , which is a flowchart of a method for automatically generating a development solution according to an embodiment of the present invention. The method of this embodiment can be executed by the
首先,在本發明的實施例中,處理器104可判斷是否在開發環境中接收到輸入按鍵的觸發事件。在一些實施例中,上述輸入按鍵例如是一般鍵盤上的Enter鍵,而其相關的觸發事件則例如是所述Enter鍵被按壓時所產生的按鍵事件,但可不限於此。此外,上述開發環境例如是各式程式、軟體、應用程式的開發環境,而其可運作於開發人員屬意的作業系統(例如Linux
TM、Windows
TM等)中,但可不限於此。
First, in the embodiment of the present invention, the
在步驟S210中,反應於判定在開發環境中接收到輸入按鍵的觸發事件,處理器104可取得開發環境因應於觸發事件而提供的特定輸出訊息。接著,在步驟S220中,處理器104可取得多條第一指令行,其中所述多個第一指令行係於上述觸發事件與輸入按鍵的一先前觸發事件之間所接收。In step S210, in response to determining that a trigger event of an input key is received in the development environment, the
詳細而言,一般的開發人員在所使用的開發環境中進行程式開發時,可能會在批次輸入多條指令行(command line)之後才按壓一次Enter鍵,而開發環境將相應地提供一輸出訊息。基此,在一實施例中,所述先前觸發事件例如是Enter鍵上一次被觸發時所形成的按鍵事件。換言之,步驟S220可理解為由處理器104將連續的兩次Enter鍵的觸發事件之間所接收到的指令行擷取作為所述多條第一指令行,但可不限於此。In detail, when developing programs in the development environment used by a general developer, they may press the Enter key only after batch inputting multiple command lines, and the development environment will provide an output accordingly. message. Based on this, in an embodiment, the previous trigger event is, for example, a key event formed when the Enter key was triggered last time. In other words, step S220 can be understood as the
之後,在步驟S230中,處理器104可基於特定輸出訊息及所述多個第一指令行判斷特定輸出訊息是否屬於錯誤訊息。在一實施例中,處理器104例如可將上述第一指令行及步驟S210所取得的特定輸出訊息輸入至經預訓練的第一長短期記憶(long short term memory,LSTM)模型,以由此第一LSTM模型基於上述第一指令行及特定輸出訊息判斷特定輸出訊息是否屬於錯誤訊息。Afterwards, in step S230, the
在一實施例中,為使第一LSTM模型具有判斷特定輸出訊息是否屬於錯誤訊息的能力,設計者可先將多個錯誤訊息以及其個別所對應的錯誤指令行儲存為對應的一文字檔以作為訓練資料,並用以訓練第一LSTM模型。具體而言,對於某第一錯誤訊息而言,設計者可收集導致此第一錯誤訊息的多條指令行作為其對應的錯誤指令行,並據以訓練第一LSTM。藉此,當第一LSTM日後接收到多條指令行及其對應的某輸出訊息時,第一LSTM即可據以辨識此輸出訊息是否屬於錯誤訊息,但可不限於此。In one embodiment, in order to enable the first LSTM model to have the ability to determine whether a specific output message is an error message, the designer can first store a plurality of error messages and their respective corresponding error command lines as a corresponding text file as training data, and used to train the first LSTM model. Specifically, for a certain first error message, the designer can collect multiple instruction lines that cause the first error message as its corresponding error instruction lines, and train the first LSTM accordingly. In this way, when the first LSTM receives a plurality of command lines and a corresponding output message in the future, the first LSTM can identify whether the output message is an error message, but it is not limited thereto.
在一實施例中,若特定輸出訊息不屬於錯誤訊息,則處理器104可允許開發人員進行後續指令行的輸入,但可不限於此。In one embodiment, if the specific output message is not an error message, the
另一方面,在步驟S240中,反應於判定特定輸出訊息屬於錯誤訊息,處理器104可取得於先前錯誤訊息與特定輸出訊息之間的時間區間內所接收的多條特定指令行。在一實施例中,所述先前錯誤訊息例如是前一個被判定屬於錯誤訊息的輸出訊息。換言之,步驟S240可理解為由處理器104將連續的兩個錯誤訊息之間所接收到的指令行擷取作為所述多條特定指令行,但可不限於此。On the other hand, in step S240, in response to determining that the specific output message is an error message, the
進一步而言,假設所述先前錯誤訊息具有一第一出現時間點,而特定輸出訊息具有一第二出現時間點,則所述時間區間例如可介於第一出現時間點及第二出現時間點之間,而處理器104例如可擷取於此時間區間內所接收的指令行作為上述特定指令行,但可不限於此。Further, if the previous error message has a first occurrence time point, and the specific output message has a second occurrence time point, the time interval may be between the first occurrence time point and the second occurrence time point, for example In between, the
之後,在步驟S250中,處理器104可至少基於開發環境的開發環境資訊、特定輸出訊息及所述多個特定指令行提供對應於特定輸出訊息的開發解決方案。在一實施例中,上述開發環境的開發環境資訊例如包括開發環境的作業系統名稱及作業系統版本,但可不限於此。Afterwards, in step S250, the
在一實施例中,處理器104例如可將開發環境的開發環境資訊、特定輸出訊息及上述特定指令行輸入至經預訓練的一第二LSTM模型,以由此第二LSTM模型提供對應於特定輸出訊息的開發解決方案。在本發明的實施例中,所述開發解決方案例如可包括多條候選指令行,以作為開發人員進行除錯的參考資訊。例如,開發人員可直接將所述多條候選指令行輸入至開發環境中,以試圖進行除錯,但可不限於此。In one embodiment, the
在一實施例中,為使第二LSTM模型具有提供對應於特定輸出訊息的開發解決方案的能力,設計者可先將多個錯誤訊息、其個別所對應的錯誤指令行、開發環境資訊及開發解決方案(其可由設計者自行於相關資料庫/網路查找而得)整理為一文字檔以作為訓練資料,並用以訓練第二LSTM模型。具體而言,對於某第一錯誤訊息而言,設計者可收集導致此第一錯誤訊息的多條指令行作為其對應的錯誤指令行,並輔以相關的開發環境資訊及開發解決方案而訓練第二LSTM。藉此,當第二LSTM日後接收到多條指令行、對應的錯誤訊息及開發環境資訊時,第二LSTM即可據以提供對應於特定輸出訊息的開發解決方案,但可不限於此。In one embodiment, in order to enable the second LSTM model to have the ability to provide a development solution corresponding to a specific output message, the designer can first combine a plurality of error messages, their respective corresponding error command lines, development environment information and development The solution (which can be found by the designer in the relevant database/network) is organized into a text file as training data, and used to train the second LSTM model. Specifically, for a first error message, the designer can collect multiple command lines that cause the first error message as their corresponding error command lines, and train them with relevant development environment information and development solutions. Second LSTM. In this way, when the second LSTM receives multiple command lines, corresponding error messages and development environment information in the future, the second LSTM can provide a development solution corresponding to the specific output message, but not limited to this.
在另一實施例中,處理器104例如可先取得特定輸出訊息的產生來源(例如是此特定輸出訊息對應的一開發中應用程式),再此產生來源、開發環境的開發環境資訊、特定輸出訊息及上述特定指令行輸入至經預訓練的第二LSTM模型,以由此第二LSTM模型提供對應於特定輸出訊息的開發解決方案,而第二LSTM的相關訓練機制可參照以上說明,於此不另贅述。In another embodiment, the
由上可知,對於開發人員而言,當其於開發環境中輸入多條指令行並按壓Enter鍵時,開發環境將相應地提供特定輸出訊息,而本案的裝置100可基於先前的教示而判斷此特定輸出訊息是否屬於錯誤訊息。若是,則裝置100可接著將上次出現錯誤訊息之後由開發人員輸入的指令行擷取作為特定指令行,並輔以開發環境資訊、特定輸出訊息(及特定輸出訊息的產生來源)等資訊自動地提供對應於特定輸出訊息的開發解決方案。藉此,開發人員即可較有效率地基於裝置100所提供的開發解決方案進行除錯,從而可節省搜尋相關解決方案所需耗費的時間,進而加速開發的進程。As can be seen from the above, for developers, when they input multiple command lines in the development environment and press the Enter key, the development environment will provide specific output messages accordingly, and the
在一實施例中,在提供包括多條候選指令行的開發解決方案之後,處理器104可更取得提供開發解決方案之後所接收的多條輸入指令行。亦即,處理器104可接續擷取開發人員在參考開發解決方案之後所輸入至開發環境中的指令行作為輸入指令行,但可不限於此。In one embodiment, after providing a development solution including multiple candidate instruction lines, the
之後,處理器104可判斷所取得的上述輸入指令行是否相同於開發解決方案中所提供的多條候選指令行。亦即,處理器104可判斷開發人員是否依開發解決方案的建議而進行除錯。Afterwards, the
在一實施例中,反應於判定上述輸入指令行不同於候選指令行,且不再出現屬於錯誤訊息的其他特定輸出訊息,此即代表開發人員已採用不同於開發解決方案提供的方式而成功地完成除錯。在此情況下,處理器104可基於特定輸出訊息及上述輸入指令更新第二LSTM模型。In one embodiment, in response to determining that the input command line is different from the candidate command line, and no other specific output messages belonging to the error message appear, it means that the developer has successfully adopted a method different from that provided by the development solution. Complete debugging. In this case, the
在一實施例中,處理器104可基於一強化學習機制更新第二LSTM模型。具體而言,處理器104可維護有一觀察程式(observation agent),而此觀察程式可用於判斷所取得的上述輸入指令行是否相同於開發解決方案中所提供的多條候選指令行,以及是否不再出現屬於錯誤訊息的其他特定輸出訊息。若判定上述輸入指令行不同於候選指令行,且不再出現屬於錯誤訊息的其他特定輸出訊息,則觀察程式可提供一懲罰(punishment)信號,以觸發處理器104基於特定輸出訊息及上述輸入指令對第二LSTM模型重新進行訓練。另一方面,若觀察程式判定上述輸入指令行不同於候選指令行,但另出現屬於錯誤訊息的其他特定輸出訊息,則觀察程式可提供一獎賞(reward)信號,以觸發處理器104維持第二LSTM模型,但可不限於此。In one embodiment, the
綜上所述,本發明的裝置可在開發環境因應於開發人員對輸入按鍵的觸發而提供特定輸出訊息時,判斷此特定輸出訊息是否屬於錯誤訊息。若是,則本發明的裝置可接著將上次出現錯誤訊息之後由開發人員輸入的指令行擷取作為特定指令行,並輔以開發環境資訊、特定輸出訊息(及特定輸出訊息的產生來源)等資訊自動地提供對應於特定輸出訊息的開發解決方案。藉此,開發人員即可較有效率地基於本發明的裝置所提供的開發解決方案進行除錯,從而可節省搜尋相關解決方案所需耗費的時間,進而加速開發的進程。To sum up, the device of the present invention can determine whether the specific output message is an error message when the development environment provides the specific output message in response to the developer triggering the input key. If so, the device of the present invention can then retrieve the command line input by the developer after the last error message occurred as a specific command line, supplemented by development environment information, specific output information (and the source of the specific output message), etc. Information automatically provides development solutions corresponding to specific output messages. In this way, developers can more efficiently debug based on the development solution provided by the device of the present invention, thereby saving time required for searching for relevant solutions, thereby speeding up the development process.
雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed above by the embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the technical field can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, The protection scope of the present invention shall be determined by the scope of the appended patent application.
100:自動產生開發解決方案的裝置 102:儲存電路 104:處理器 S210~S250:步驟 100: A device that automatically generates development solutions 102: Storage circuit 104: Processor S210~S250: Steps
圖1是依據本發明之一實施例繪示的自動產生開發解決方案的裝置示意圖。 圖2是依據本發明之一實施例繪示的自動產生開發解決方案的方法流程圖。 FIG. 1 is a schematic diagram of an apparatus for automatically generating a development solution according to an embodiment of the present invention. FIG. 2 is a flowchart of a method for automatically generating a development solution according to an embodiment of the present invention.
S210~S250:步驟 S210~S250: Steps
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109131900A TWI751706B (en) | 2020-09-16 | 2020-09-16 | Method and device for automatically generating development solution |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109131900A TWI751706B (en) | 2020-09-16 | 2020-09-16 | Method and device for automatically generating development solution |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI751706B true TWI751706B (en) | 2022-01-01 |
TW202213077A TW202213077A (en) | 2022-04-01 |
Family
ID=80809105
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW109131900A TWI751706B (en) | 2020-09-16 | 2020-09-16 | Method and device for automatically generating development solution |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI751706B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI241523B (en) * | 2002-05-27 | 2005-10-11 | Toshiba Corp | Debugging device and debugging method |
US20130275948A1 (en) * | 2012-04-17 | 2013-10-17 | International Business Machines Corporation | Compiling Source Code For Debugging With Expanded Snapshots |
TWI521432B (en) * | 2013-06-12 | 2016-02-11 | Mitsubishi Electric Corp | Development environment systems, development environment installations, development environment provision methods and program products |
TWI530783B (en) * | 2008-04-07 | 2016-04-21 | 萬國商業機器公司 | Debug tours for software debugging |
JP2016126700A (en) * | 2015-01-08 | 2016-07-11 | 富士通株式会社 | Program verification device, program verification method, and program verification program |
TWI660267B (en) * | 2018-03-28 | 2019-05-21 | 和碩聯合科技股份有限公司 | Boot testing apparatus, system and method thereof |
-
2020
- 2020-09-16 TW TW109131900A patent/TWI751706B/en active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI241523B (en) * | 2002-05-27 | 2005-10-11 | Toshiba Corp | Debugging device and debugging method |
TWI530783B (en) * | 2008-04-07 | 2016-04-21 | 萬國商業機器公司 | Debug tours for software debugging |
US20130275948A1 (en) * | 2012-04-17 | 2013-10-17 | International Business Machines Corporation | Compiling Source Code For Debugging With Expanded Snapshots |
TWI521432B (en) * | 2013-06-12 | 2016-02-11 | Mitsubishi Electric Corp | Development environment systems, development environment installations, development environment provision methods and program products |
JP2016126700A (en) * | 2015-01-08 | 2016-07-11 | 富士通株式会社 | Program verification device, program verification method, and program verification program |
TWI660267B (en) * | 2018-03-28 | 2019-05-21 | 和碩聯合科技股份有限公司 | Boot testing apparatus, system and method thereof |
Also Published As
Publication number | Publication date |
---|---|
TW202213077A (en) | 2022-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9588876B2 (en) | Estimating likelihood of code changes introducing defects | |
US11281708B2 (en) | Utilizing a machine learning model to predict metrics for an application development process | |
US10936807B1 (en) | Systems and methods for displaying effects of code changes | |
US10248537B2 (en) | Translation bug prediction classifier | |
US9740480B1 (en) | Apparatus and methodologies for code refactoring | |
US10175975B2 (en) | Self-mending software builder | |
US20150143327A1 (en) | Project management tool | |
CN110673936B (en) | Breakpoint continuous operation method and device for arrangement service, storage medium and electronic equipment | |
US20230325182A1 (en) | Methods and arrangements to process comments | |
WO2023029632A1 (en) | Model training method and system, and server and chip | |
WO2022217708A1 (en) | Artificial intelligence-based question and answer method and apparatus, server, and storage medium | |
Breck et al. | Data infrastructure for machine learning | |
US20240134687A1 (en) | Systems and methods for operating an autonomous system | |
TWI751706B (en) | Method and device for automatically generating development solution | |
US10901729B2 (en) | System and method for merging specification files for an application programming interface | |
US11556460B2 (en) | Test case generation for software development using machine learning | |
CN112765188B (en) | Configuration information processing method, configuration management system, electronic device and storage medium | |
CN109144524B (en) | Version release method of subject game on education platform and electronic equipment | |
US11750479B1 (en) | System and method for managing issues based on pain reduction efficiency | |
US11789842B2 (en) | System and method for advanced detection of potential system impairment | |
US11736580B1 (en) | Fixing microservices in distributed transactions | |
US11249883B2 (en) | Error repair tool using sentiment analysis | |
US8521502B2 (en) | Passing non-architected registers via a callback/advance mechanism in a simulator environment | |
US20220067619A1 (en) | System and method to provide prescriptive actions for winning a sales opportunity using deep reinforcement learning | |
JP2018036792A (en) | Data processing program and data processing method |