CN115599418A - Method and system for upgrading VB.NET codes - Google Patents

Method and system for upgrading VB.NET codes Download PDF

Info

Publication number
CN115599418A
CN115599418A CN202211284620.3A CN202211284620A CN115599418A CN 115599418 A CN115599418 A CN 115599418A CN 202211284620 A CN202211284620 A CN 202211284620A CN 115599418 A CN115599418 A CN 115599418A
Authority
CN
China
Prior art keywords
code
modification
rules
analysis
execution
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202211284620.3A
Other languages
Chinese (zh)
Inventor
夏南珊
罗俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fangzhu Wuhan Technology Co ltd
Original Assignee
Fangzhu Wuhan Technology Co ltd
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 Fangzhu Wuhan Technology Co ltd filed Critical Fangzhu Wuhan Technology Co ltd
Priority to CN202211284620.3A priority Critical patent/CN115599418A/en
Publication of CN115599418A publication Critical patent/CN115599418A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/38Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method and a system for upgrading VB.NET codes, which comprises the following steps: s1, using VB.NET codes after VS upgrading as input data, and setting code modification rules and code analysis rules; s2, selecting a code execution item, selecting or screening a code position to be executed, and then selecting an execution code modification program or an execution code analysis program after backing up a source code so as to perform batch modification and batch analysis; s3, predicting the result according to the selected code execution item, and outputting a code execution report; and S4, outputting a final code and a final execution report after no error is confirmed. A large amount of repeated work is changed from manual work to machine work, so that the uniformity of a modification scheme can be ensured, the correction rate of modification is improved, the uniformity of code styles is promoted, personnel can be liberated from the repeated work, and the personnel can be put into more valuable problem investigation and experience iteration.

Description

Method and system for upgrading VB.NET codes
Technical Field
The invention relates to the technical field of computer software, in particular to a method and a system for upgrading VB.
Background
Net is usually upgraded for the first time using a VS of low version (VS 2008), and then the result of the first upgrade is upgraded for the second time using a VS of high version (VS 2019). The secondary upgrade results were then analyzed and labeled using Code Advisor. And finally, manually upgrading the processed code.
In the manual upgrade stage, there are still many errors that need to be corrected one by one, and there are many known and identical error codes that meet certain rules. In addition, in the manual operation process, the simple miss is easy to occur, or the problem is limited by the experience of a developer, so that the same problem is caused, and different modification schemes are generated. Repeated work and the waste of time and energy of developers, and different modifications of the same problem are not beneficial to batch correspondence which may exist in the later period of the project.
Disclosure of Invention
The invention provides a method and a system for upgrading VB.
The technical scheme for solving the technical problems is as follows: a method for upgrading VB.NET codes,
which comprises the following steps:
s1, using VB.NET codes after VS upgrading as input data, and setting code modification rules and code analysis rules;
s2, selecting a code execution item, selecting or screening a code position to be executed, and then selecting an execution code modification program or an execution code analysis program after backing up a source code so as to modify and analyze in batches;
s3, predicting the result according to the selected code execution item, and outputting a code execution report;
and S4, outputting a final code and a final execution report after no error is confirmed.
On the basis of the technical scheme, the invention can be improved as follows.
Optionally, in step S2, when the code position that needs to be executed is selected or screened, positioning determination is performed based on the keyword, classification retrieval is performed based on different positions and functions of the keyword in the code, and a screening result after classification is output based on the classification retrieval.
Optionally, the classified search includes performing combined search on keywords in different scenes or keywords located at different positions in the code, and performing synchronous search on multiple keywords.
Optionally, in step S2, the code modification procedure includes performing code modification using a known modification rule and performing code modification using a newly added modification rule; the code analysis program comprises code analysis by using a known analysis rule and code analysis by using a newly added analysis rule; and the code modifying program and code analyzing program are shown in a list or keyword for selection.
Optionally, the code modification program includes a regular expression and a replacement text.
Optionally, the code modification program and the code analysis program support online editing rules, modify the code according to the selected known modification rule or known analysis rule and then execute the code execution item, store the modified rule according to the selected known modification rule or known analysis rule as a new known modification rule or known analysis rule, and redefine the keyword for the next selection; or code to modify rules or analyze rules may be imported via the storage medium.
Optionally, the code execution report displays the modified and suggested contents in the corresponding file after the selected modification rule or analysis rule is executed, and marks the problematic code, the code path, the line number and the problem description.
According to a second aspect of the present invention there is provided a system for upgrading vb.net code using any of the methods for upgrading vb.net code described above.
The invention has the beneficial effects that: the method and the system for upgrading VB.NET codes have the advantages that the corresponding omission, the non-uniform corresponding scheme and even the error are easily caused based on the traditional upgrading mode, the codes of the files need to be manually modified one by one, the efficiency is low, the correctness and the consistency cannot be well guaranteed.
The technical scheme of the invention can iterate the development experience of VB6 upgrading to VB. NET project each time, changes a large amount of repeated work from manual work to machine work, can ensure the unification of the modification scheme, improve the correction rate of modification, promote the unification of the code style, and release personnel from repetitive work, thereby putting into more valuable problem investigation and experience iteration.
The saved time is used for investigating and summarizing new problems appearing in project upgrading, new rules can be arranged, so that virtuous circle is formed, the productivity improvement of projects of the type is greatly promoted, the quality of fruits is improved, the development experience is reused, and the load of manual operation is reduced as much as possible.
Drawings
Fig. 1 is a schematic diagram of steps of a method and a system for upgrading vb.
Fig. 2 is a schematic operation flow diagram of a method and a system for upgrading vb.
Detailed Description
The following detailed description of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "mounted," "connected," and "connected" are to be interpreted broadly, and may be, for example, a mechanical connection or an electrical connection, a communication between two elements, a direct connection, or an indirect connection through an intermediate medium, and those skilled in the art will understand the specific meaning of the terms as they are used in the specific case.
As shown in fig. 1 and fig. 2, the present embodiment discloses a method for upgrading vb.
S1, using VB.NET codes after VS upgrading as input data, and setting code modification rules and code analysis rules;
s2, selecting a code execution item, selecting or screening a code position to be executed, and then selecting an execution code modification program or an execution code analysis program after backing up a source code so as to perform batch modification and batch analysis;
s3, predicting the result according to the selected code execution item, and outputting a code execution report;
and S4, outputting a final code and a final execution report after no error is confirmed.
It can be understood that, the technical solution adopted in this embodiment is based on the situation that the traditional upgrade mode is easy to be missed, the corresponding solution is not uniform or even wrong, and the file needs to be modified manually one by one, so that the efficiency is not high, and the correctness and consistency cannot be well guaranteed.
The technical scheme of the invention can iterate the development experience of upgrading VB6 to VB.NET project each time, changes a large amount of repeated work from manual work to machine work, can ensure the uniformity of the modification scheme, improve the accuracy of modification, promote the uniformity of code styles, and release personnel from repeated work, thereby investing in more valuable problem investigation and experience iteration.
The saved time is used for investigating and summarizing new problems appearing in project upgrading, new rules can be arranged, so that virtuous circle is formed, the productivity improvement of projects of the type is greatly promoted, the quality of fruits is improved, the development experience is reused, and the load of manual operation is reduced as much as possible.
Specifically, in this embodiment, a vb.net code upgraded based on VS is used as input data to modify or analyze a code, and the code is modified or analyzed according to a set code modification rule and a set code analysis rule, provided that a code position to be checked is determined, and then the set code modification rule or the set code analysis rule is executed to find out a problem existing in the upgraded code, and a code execution report is output for a user to check and examine. If modification or analysis is needed, the corresponding procedure can be executed again until a final result is determined and a final execution report is output for archiving and post-analysis.
In an optional embodiment, in step S2, when the code position to be executed is selected or screened, positioning determination is performed based on the keyword, classification search is performed based on different positions and functions of the keyword in the code, and a sorted screening result is output based on the classification search.
It can be understood that, in this embodiment, the code to be executed is determined by screening based on a specific keyword, and the classified search is performed based on the position of the keyword in the code or the difference of the corresponding function, which can be understood as the difference of the corresponding scenes. The code modification and the code analysis have respective rules, and the purpose of the code modification is to perform directed code one-step replacement according to the rules, thereby eliminating the problems of BUG, irregular writing method and the like in the codes. The purpose of code analysis is to search keywords according to rules and extract files, lines and contents of codes related to the keywords. The method and the device can conveniently output the conclusion such as the number of the designated analysis points, the influence range and the like, and facilitate the judgment of the subsequent processing scheme by a user.
In an alternative embodiment, the classified search includes combined search of keywords in different scenes or keywords located at different positions in the code, and synchronous search of multiple keywords.
It will be appreciated that in this embodiment, the entry of rules provides additional conditions in addition to the keywords for use in combination, such as whether the keyword should appear at the head or end of a line, whether case-sensitive, the type of file in which it is defined, etc.
In an optional embodiment, in the step S2, the code modification procedure includes performing code modification by using a known modification rule and performing code modification by using a newly added modification rule; the code analysis program comprises code analysis by using a known analysis rule and code analysis by using a newly added analysis rule; and the code modifying program and the code analyzing program are shown in the form of a list or keywords for selection. The code modifying program comprises a regular expression and replacement text.
Whether the code modification function or the code analysis function is used, the rule screening is required, and a user can specify a specific rule to execute or add a custom rule to execute. And if the existing rule does not have a scheme meeting the requirement, entering the new rule through the rule adding interface.
Adding rules for code modification requires entering the key that was used to retrieve when executing the rules, and the scheme to be used for modification (i.e., replacement code). Regular expressions can be used, and text replacement can also be simply carried out. The input of the rule needs to consider various phenomena possibly existing in the replacement, and perfectly consider what kind of keywords are adopted to carry out the query of the modified object as much as possible.
When the rule of code analysis is added, the method is similar to the method of adding the rule of code modification, and the difference is that basic result classification and judgment basis needs to be additionally provided. The method is used for presetting the scene and the conclusion of the code where the keyword is located. For example, if a keyword is present in the annotation, the result classification is no influence, and the judgment basis is the line head and the beginning of the annotation symbol; if the keyword appears in the method name, the result classification is outside the confirmed object, and the start of the keyword defined by the method according to the line where the keyword is located is judged (Function, sub); and if the keywords appear in the statement of assignment, the result classification is the possibility of BUG, and the judgment basis is that the keywords are straight and then equal signs and the like. The output of the analysis report is classified and counted based on the scene preset by the user.
In an alternative embodiment, the code modifying program and the code analyzing program support online editing rules, modify and execute the code execution items according to the selected known modifying rules or the selected known analyzing rules, store the modified rules according to the selected known modifying rules or the selected known analyzing rules as new known modifying rules or known analyzing rules, and redefine keywords for the next selection; or code for modifying the rules or parsing the rules may be imported via the storage medium.
It will be appreciated that in this embodiment, whether the rules are analyzed or modified, in addition to simple rule setting via the rule entry interface, the rules may be extended by writing check code or replacement code themselves. The application scene is more flexible.
In an alternative embodiment mode, the content which is modified and needs to be modified in a corresponding file after the selected modification rule or analysis rule is executed is displayed in the code execution report, and the problematic code and the code path, the line number and the problem description are marked.
It will be appreciated that the final output report contains aggregated conclusions, as well as conclusions that correspond one-by-one to the rules selected by the user.
In another embodiment, a system for upgrading VB.
It can be understood that, in the system, based on the vb.net code upgraded by VS as input data, firstly selecting a function, correspondingly selecting whether to execute code modification or code analysis, if the code modification is executed, opening a code modification interface for rule screening, then selecting an existing rule or adding a rule, executing the selected rule and issuing an execution report, and finally outputting a code modification report; if the execution of code analysis is selected, opening a code analysis interface to perform rule screening, then selecting an existing rule or an addition rule, returning to the rule screening interface to perform rule selection again after logging in a new rule, if the rule needs to be added, setting a program to perform user identity verification, verifying whether the user has the authority of adding the rule, and then continuing to select the rule and then executing the selected rule; and finally outputting a code modification report or a code analysis report.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. NET code modification method, characterized by that, it includes the following steps:
s1, using VB.NET codes after VS upgrading as input data, and setting code modification rules and code analysis rules;
s2, selecting a code execution item, selecting or screening a code position to be executed, and then selecting an execution code modification program or an execution code analysis program after backing up a source code so as to modify and analyze in batches;
s3, predicting the result according to the selected code execution item, and outputting a code execution report;
and S4, outputting a final code and a final execution report after no error is confirmed.
2. NET code method according to claim 1, characterized in that in step S2, when selecting or screening the code location to be executed, the location determination is performed based on the keyword, and the classified search is performed based on the different locations and functions of the keyword in the code, and the classified screening result is output based on the classified search.
3. NET code method according to claim 2, characterized in that the classification search comprises combined search of keywords in different scenes or keywords located at different positions in the code and simultaneous search of multiple keywords.
4. A method for upgrading vb.net codes according to claim 3, wherein in the step S2, the code modification procedure includes code modification using known modification rules and code modification using new modification rules; the code analysis program comprises code analysis by using a known analysis rule and code analysis by using a newly added analysis rule; and the code modifying program and the code analyzing program are shown in the form of a list or keywords for selection.
5. NET code method according to claim 4, characterized in that the code modification program comprises regular expressions and replacement texts.
6. NET code method according to claim 5, characterized in that the code modification program and the code analysis program support on-line editing of rules, and execute code execution items after modification according to the selected known modification rules or known analysis rules, store the rules modified according to the selected known modification rules or known analysis rules as new known modification rules or known analysis rules, and redefine keywords for the next selection; or code for modifying the rules or parsing the rules may be imported via the storage medium.
7. NET code method according to claim 1, characterized in that the code execution report shows the modified and suggested content to be modified in the corresponding file after the selected modification rules or analysis rules are executed, and marks the code in question and the code path, line number and question description.
8. A system for upgrading vb.
CN202211284620.3A 2022-10-19 2022-10-19 Method and system for upgrading VB.NET codes Pending CN115599418A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211284620.3A CN115599418A (en) 2022-10-19 2022-10-19 Method and system for upgrading VB.NET codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211284620.3A CN115599418A (en) 2022-10-19 2022-10-19 Method and system for upgrading VB.NET codes

Publications (1)

Publication Number Publication Date
CN115599418A true CN115599418A (en) 2023-01-13

Family

ID=84848507

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211284620.3A Pending CN115599418A (en) 2022-10-19 2022-10-19 Method and system for upgrading VB.NET codes

Country Status (1)

Country Link
CN (1) CN115599418A (en)

Similar Documents

Publication Publication Date Title
US7299451B2 (en) Remotely driven system for multi-product and multi-platform testing
US8898635B2 (en) System and method for automatic impact variable analysis and field expansion in mainframe systems
US6430708B1 (en) Method and apparatus for testing job control language (JCL) members
US11651272B2 (en) Machine-learning-facilitated conversion of database systems
CN108763091B (en) Method, device and system for regression testing
WO2015157470A1 (en) Software test automation system and method
US20100218168A1 (en) System and Method for Generating a Test Environment Script File
US20120209557A1 (en) Methods, apparatus and articles of manufacture to test batch configurations
CN108710571B (en) Method and device for generating automatic test code
Xue Reengineering legacy software products into software product line based on automatic variability analysis
EP3428828B1 (en) System and method for locating and correcting vulnerabilites in a target computer system
US20070061641A1 (en) Apparatus and method for generating test driver
CN110990274A (en) Data processing method, device and system for generating test case
Kuschke et al. Pattern-based auto-completion of UML modeling activities
CN114610286A (en) Development document generation method and device, computer equipment and storage medium
CN110990282B (en) Automatic unit testing method
CN115757149A (en) Automatic testing method, system, electronic equipment and storage medium
CN114297961A (en) Chip test case processing method and related device
CN201548954U (en) Device for automatically testing Web page
US20220350730A1 (en) Test data generation apparatus, test data generation method and program
CN115599418A (en) Method and system for upgrading VB.NET codes
CN116225902A (en) Method, device and equipment for generating test cases
CN116069628A (en) Intelligent-treatment software automatic regression testing method, system and equipment
CN113051262B (en) Data quality inspection method, device, equipment and storage medium
EP3547144B1 (en) Structural tests generation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination