CN117667701A - Function debugging method, device, equipment and medium in application development environment - Google Patents
Function debugging method, device, equipment and medium in application development environment Download PDFInfo
- Publication number
- CN117667701A CN117667701A CN202311664264.2A CN202311664264A CN117667701A CN 117667701 A CN117667701 A CN 117667701A CN 202311664264 A CN202311664264 A CN 202311664264A CN 117667701 A CN117667701 A CN 117667701A
- Authority
- CN
- China
- Prior art keywords
- function
- script
- preset
- debugged
- environment
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 154
- 238000011161 development Methods 0.000 title claims abstract description 112
- 238000004088 simulation Methods 0.000 claims abstract description 71
- 230000008569 process Effects 0.000 claims abstract description 43
- 238000012360 testing method Methods 0.000 claims abstract description 38
- 230000006870 function Effects 0.000 claims description 254
- 230000003993 interaction Effects 0.000 claims description 8
- 230000001960 triggered effect Effects 0.000 claims description 6
- 238000001514 detection method Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 4
- 238000004519 manufacturing process Methods 0.000 description 11
- 230000003287 optical effect Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3664—Environments for testing or debugging software
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention discloses a function debugging method, a device, equipment and a medium in an application development environment, wherein the method comprises the following steps: detecting a current script running environment when the running of the script to be debugged is started; when the current script running environment is a front-end application development environment, loading a preset simulation method entry file; when the script to be debugged needs to be interacted with the back-end application running environment in the running process, calling a target function in an entry file of a preset simulation method through a preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged; the method comprises the steps that a preset simulation method entry file comprises a function set corresponding to an application function to be tested in a script to be debugged; the back-end application running environment is a running environment built based on a preset Native framework. The technical scheme of the embodiment of the invention can debug the function in the script to be debugged under the development environment of the front-end application, avoid repeated deployment test of codes and improve the development efficiency of the front-end application.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a function debugging method, device, equipment and medium in an application development environment.
Background
There are three types of applications: native applications, web applications, and hybrid applications. The hybrid application has the advantages of both the native application and the web application, and has become the main App application type in the industry.
However, hybrid applications still have some inconveniences during the development and debugging phase, especially where the test environment is different from the development environment. For example, the local browser development environment has no relevant JSAPI (Java Script Application Programming Interface, an interface provided for JS to call a native application), and a fault is reported and a white screen appears when the local browser development environment is called; the development environment needs to manually input links in the address bar to jump pages; the development environment is strongly dependent on the background data, and related pages and the like cannot be written when the background is not developed or the data is not tested.
Disclosure of Invention
The embodiment of the invention provides a function debugging method, device, equipment and medium in an application development environment, which can debug a function in a script to be debugged in the front-end application development environment, avoid repeated deployment test of codes and improve the development efficiency of the front-end application.
In a first aspect, an embodiment of the present invention provides a method for debugging a function in an application development environment, where the method includes:
detecting a current script running environment when the running of the script to be debugged is started;
when the current script running environment is a front-end application development environment, loading a preset simulation method entry file;
when the script to be debugged needs to be interacted with the back-end application running environment in the running process, calling a target function in the entry file of the preset simulation method through a preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged;
the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged;
the back-end application running environment is a running environment built based on a preset Native framework.
In a second aspect, an embodiment of the present invention provides a function debugging device in an application development environment, where the function debugging device includes:
the environment detection module is used for detecting the current script running environment when the script to be debugged is started;
the file loading module is used for loading a preset simulation method entry file when the current script running environment is a front-end application development environment;
the function debugging module is used for calling a target function in the entry file of the preset simulation method through a preset function connection function when interaction with the back-end application running environment is needed in the running process of the script to be debugged, so as to realize the debugging process of the corresponding function in the script to be debugged;
the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged;
the back-end application running environment is a running environment built based on a preset Native framework.
In a third aspect, an embodiment of the present invention further provides a computer apparatus, including:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of functional debugging in an application development environment as provided by any embodiment of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for debugging a function in an application development environment as provided by any embodiment of the present invention.
According to the embodiment of the invention, when the script to be debugged is started, the current script running environment is detected; when the current script running environment is a front-end application development environment, loading a preset simulation method entry file; when the script to be debugged needs to be interacted with the back-end application running environment in the running process, calling a target function in the entry file of the preset simulation method through a preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged; the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged; the back-end application running environment is a running environment built based on a preset Native framework. The technical scheme of the embodiment of the invention solves the problem that the test needs to be repeatedly deployed after the code is adjusted in the development process due to different application development and test environments, can simulate the test and production environment in the front-end application development environment, and can debug the function in the script to be debugged, thereby avoiding the repeated deployment test of the code and improving the development efficiency of the front-end application.
Drawings
FIG. 1 is a flowchart of a method for debugging functions in an application development environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for debugging functions in an application development environment according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for debugging functions in an application development environment according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a function debugging device in an application development environment according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Fig. 1 is a flowchart of a method for debugging a function in an application development environment according to an embodiment of the present invention, where the embodiment is applicable to a scenario of function debugging in an application development environment. The method can be executed by a function debugging device in an application development environment, and the device can be realized by software and/or hardware and is integrated in a computer device with an application development function.
As shown in fig. 1, the function debugging method in the application development environment of the present embodiment includes the steps of:
s110, detecting the current script running environment when the script to be debugged is started.
The script to be debugged may be, for example, a script to be debugged of an H5 (HTML 5, hypertext markup language 5) page under the mobile development platform, and may be part of code or all of code of the front-end application. Since the script to be debugged can be debugged in the front-end application development environment and also can be debugged in the front-end application test environment or the front-end application production environment, when the script is started, the current script running environment needs to be detected.
The front-end application development environment may correspond to a development stage of the front-end application, and the development is performed by using a local browser, and after the development is completed, the code of the front-end application is issued to the front-end application test environment.
The front-end application test environment may correspond to a test phase of the front-end application, and code of the front-end application published to the front-end application test environment may be tested on the real machine.
The front-end application production environment may correspond to the test environment on the user's real machine at the online stage of the front-end application.
Specifically, detection of the current script running environment can be achieved through an env configuration file of the Vue development framework.
Under the front-end application development environment, executing an npn run service method to start a web service in a local browser, wherein the configuration in an env.development file is acquired by the front-end application; and under the front-end application testing environment or the front-end application production environment, the npm run build method is executed to carry out packaging, and the configuration in the env.production file is obtained by the application. The current script running environment of the script to be debugged can be determined by defining a NODE_ENV variable in the env.development file and the env.production file, designating different values for the NODE_ENV variable, acquiring the variable value from the script to be debugged, and determining that the variable value is the same as one of the env.development file and the env.production file.
S120, when the current script running environment is the front-end application development environment, loading a preset simulation method entry file.
The preset simulation method entry file may be a file including some JS (JavaScript) functions, hereinafter JSAPI functions, provided for simulating the native client method for H5 page calls in hybrid applications.
S130, when interaction with the back-end application running environment is needed in the running process of the script to be debugged, calling the target function in the entry file of the preset simulation method through the preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged.
The preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged.
The back-end application running environment is a running environment constructed based on a preset Native framework, which is a framework under the front-end application development environment.
In the running process of the script to be debugged, the situation that interaction with the back-end application running environment is needed exists, for example, when back-end data needs to be acquired.
Specifically, the application functions to be tested can be divided into three categories, namely a hardware device category, a button navigation category and a data request category, and the corresponding function sets can be a hardware device function set, a button navigation function set and a data request function set.
The objective function may be a function for realizing a specific function, and the type of the objective function may be a JSAPI function. The target function is included in its corresponding set of function functions, e.g. the function of scanning is implemented by a scan function, which is included in the set of hardware device function functions. And calling the target function through the preset function connection function to realize the debugging of the corresponding function in the script to be debugged.
In an alternative embodiment, the predetermined function connection function is alitayjsbridge.
Specifically, unified call to the target function can be realized by assigning values to the AlipayJSbridge method of the window object. For example, the target function is called by window. Alipayjsbridge.call ("type"), the type represents the name of the target function, different assignment is made for the type to call different target function, for example, the name of the target function corresponding to the scan function is scan, and then the target function scan is called by window. Alipayjsbridge.call ("scan").
In an optional implementation manner, when any hardware device function needs to be called in the running process of the script to be debugged, a function corresponding to the hardware device function in an entry file of a preset simulation method is called through a preset function connection function; acquiring a function return value sent by a function corresponding to the function of hardware equipment; wherein the function return value is preconfigured according to the return value of the hardware device function in the test operation.
Specifically, when the function of any hardware device function set needs to be called, for example, the function may be to scan, acquire the user location and read-write internal storage, or may be other function functions related to the hardware device, which is not limited in this embodiment.
Taking the location of the target function for obtaining the user position as an example, it can be understood that, because the function in the script to be debugged is not required to be actually used in the development stage, whether the flow of the script to be debugged is smooth or not is determined, the method for obtaining the user position can be realized by recording the return value of the location function obtained in the real machine test, defining the json file related to the location function according to the return value, and calling the location function through the window. AlipayJSIDE. Call ("location") when the current script running environment is the front-end application development environment, and returning the json file related to the location function. Further, by changing the values of the location value related fields in the json file, any user location can be modeled. The target function in the function set of other hardware equipment can be simulated by the method.
According to the technical scheme, when the script to be debugged is started, the current script running environment is detected; when the current script running environment is a front-end application development environment, loading a preset simulation method entry file; when the script to be debugged needs to be interacted with the back-end application running environment in the running process, calling a target function in the entry file of the preset simulation method through a preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged; the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged; the back-end application running environment is a running environment built based on a preset Native framework. The technical scheme of the embodiment of the invention solves the problem that the test needs to be repeatedly deployed after the code is adjusted in the development process due to different application development and test environments, can simulate the test and production environment in the front-end application development environment, and can debug the function in the script to be debugged, thereby avoiding the repeated deployment test of the code and improving the development efficiency of the front-end application.
Fig. 2 is a flowchart of a method for debugging a function in an application development environment according to an embodiment of the present invention, where the method for debugging a function in an application development environment in the embodiment and the method for debugging a function in an application development environment in the embodiment belong to the same inventive concept. The method can be executed by a function debugging device in an application development environment, and the device can be realized by software and/or hardware and is integrated in a computer device with an application development function.
As shown in fig. 2, the function debugging method in the application development environment of the present embodiment includes the steps of:
s210, detecting the current script running environment when the script to be debugged is started.
S220, when the current script running environment is the front-end application development environment, loading a preset simulation method entry file.
S230, calling a preset navigation bar editing function in the preset simulation method entry file through a preset function connection function to generate a navigation bar.
The preset navigation bar editing function may be included in a button navigation function set. Specifically, when a code of a front-end application in a test environment is released, a navigation bar is generated by an H5 container at the top of a page when the code is accessed in an electronic device, one or more buttons are arranged on the navigation bar, clicking any button can trigger a corresponding event, for example, clicking a button on the left side of the navigation bar can trigger a return event, clicking a menu button on the right side can trigger a pop-up menu event, and clicking a title button in the middle of the navigation bar can trigger a title related event. In order to realize the function of clicking the button trigger event, the navigation bar is not existed in the application development environment, and the path corresponding to the button trigger event can only be manually input in the address bar of the local browser, which is very inconvenient.
Therefore, an interface element of a simulated navigation bar is generated through a preset navigation bar editing function, and the same event as the corresponding button in the navigation bar generated by the H5 container in the test environment is defined for the button in the generated simulated navigation bar.
S240, configuring the navigation bar at a preset position in an interface of the front-end application development environment.
The preset position may be the top, left, right or bottom of the body web page element in the interface.
Specifically, taking the top of a body webpage element as an example, when the current script running environment is a front-end application development environment, inserting the generated simulated navigation bar into the top of the body webpage element in the script to be debugged, so that the navigation bar can automatically appear when the script to be debugged is run under the front-end application development environment, and clicking each button on the simulated navigation bar can trigger the same event as the corresponding button on the navigation bar under the front-end application test environment. When the current script running environment is not the front-end application development environment, a simulation navigation bar is not inserted, and the repetition of the simulation navigation bar with the navigation bar of the H5 container is avoided.
In an alternative embodiment, when the control in the navigation bar is triggered, the control function associated with the triggered control in the preset simulation method entry file is called through the preset function connection function.
The controls in the navigation bar may be, for example, a back button, a menu button, and a title button. For example, the names of the navigation bar title and the menu may be set in the H5 container under the front-end application test environment, so that the names of the navigation bar title and the menu need to be simulated under the front-end application development environment, for example, a set title button may be associated with a setTitle function, the setTitle function is used for setting the navigation bar title, and the title of the simulated navigation bar may be set through window. For example, the setup menu button is associated with a setOptionMenu function, the setOptionMenu function is a name of a setup menu, and the menu name of the simulated navigation bar can be set through window.
According to the technical scheme, when the script to be debugged is started, a current script running environment is detected, when the current script running environment is a front-end application development environment, a preset simulation method entry file is loaded, a preset navigation bar editing function in the preset simulation method entry file is called through a preset function connection function to generate a navigation bar, the navigation bar is configured at a preset position in an interface of the front-end application development environment, wherein the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged, and the back-end application running environment is a running environment constructed based on a preset Native framework. The technical scheme of the embodiment of the invention solves the problem that the test needs to be repeatedly deployed after the code is adjusted in the development process due to different application development and test environments, can simulate the test and production environment in the front-end application development environment, and can debug the function in the script to be debugged, thereby avoiding the repeated deployment test of the code and improving the development efficiency of the front-end application.
Fig. 3 is a flowchart of a method for debugging a function in an application development environment according to an embodiment of the present invention, where the method belongs to the same concept as the method for debugging a function in an application development environment in the foregoing embodiment, and the method may be executed by a function debugging device in an application development environment, where the device may be implemented by software and/or hardware, and is integrated into a computer device having an application development function.
As shown in fig. 3, the function debugging method in the application development environment of the present embodiment includes the steps of:
and S310, detecting the current script running environment when the script to be debugged is started.
S320, loading a preset simulation method entry file when the current script running environment is a front-end application development environment.
S330, when the data in the back-end application running environment needs to be read in the running process of the script to be debugged, determining whether the called parameters have simulation data locally.
Reading data in the back-end application operating environment is achieved by presetting an objective function rpc (Remote Procedure Call Protocol, a remote procedure call protocol, herein denoted a remote procedure call function) in the simulation method entry file, and the objective function rpc may be included in the data request function set. In the front-end application development environment, when the type is equal to rpc, judging whether corresponding json simulation data exists in the local browser according to the called parameter, namely the params parameter.
S340, when the called parameter locally has analog data, the corresponding analog data is directly read and returned.
If the corresponding json simulation data exists, the json simulation data is read, and the script to be debugged is directly returned.
S350, when the called parameters have no simulation data locally, reading the data according to a preset database interface.
Specifically, axios requests a preset database interface to read data according to parameters of params, wherein the preset database interface can be a preset database interface at the back end, and axios is a promiscuous-based network request library.
According to the technical scheme, when the script to be debugged is started, a current script running environment is detected, when the current script running environment is a front-end application development environment, a preset simulation method entry file is loaded, when data in the back-end application running environment needs to be read in the script to be debugged running process, whether the called parameters locally exist simulation data is determined, when the called parameters locally exist simulation data, the corresponding simulation data are directly read to return, wherein the preset simulation method entry file contains a function set corresponding to an application function to be tested in the script to be debugged, and the back-end application running environment is a running environment constructed based on a preset Native framework. The technical scheme of the embodiment of the invention solves the problem that the test needs to be repeatedly deployed after the code is adjusted in the development process due to different application development and test environments, can simulate the test and production environment in the front-end application development environment, and can debug the function in the script to be debugged, thereby avoiding the repeated deployment test of the code and improving the development efficiency of the front-end application.
Fig. 4 is a schematic structural diagram of a function debugging device in an application development environment according to an embodiment of the present invention, where the embodiment is applicable to a scenario of function debugging in an application development environment, and the function debugging device in the application development environment may be implemented by software and/or hardware, and integrated into a computer terminal device having an application development function.
As shown in fig. 4, the function debugging device in the application development environment includes: an environment detection module 410, a file loading module 420, and a function debugging module 430.
The environment detection module 410 is configured to detect a current script running environment when the script to be debugged is started.
The file loading module 420 is configured to load a preset simulation method entry file when the current script running environment is a front-end application development environment.
The function debugging module 430 is configured to invoke, through a preset function connection function, a target function in the entry file of the preset simulation method when interaction with the back-end application running environment is required in the running process of the script to be debugged, so as to implement a debugging process of a corresponding function in the script to be debugged.
The preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged; the back-end application running environment is a running environment built based on a preset Native framework.
According to the technical scheme, when the script to be debugged is started, the current script running environment is detected; when the current script running environment is a front-end application development environment, loading a preset simulation method entry file; when the script to be debugged needs to be interacted with the back-end application running environment in the running process, calling a target function in the entry file of the preset simulation method through a preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged; the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged; the back-end application running environment is a running environment built based on a preset Native framework. The technical scheme of the embodiment of the invention solves the problem that the test needs to be repeatedly deployed after the code is adjusted in the development process due to different application development and test environments, can simulate the test and production environment in the front-end application development environment, and can debug the function in the script to be debugged, thereby avoiding the repeated and repeated deployment test of the code and improving the development efficiency of the front-end application
In an alternative embodiment, the function debug module 430 module further includes:
and the hardware equipment function calling unit is used for calling a function corresponding to the hardware equipment function in the preset simulation method entry file through the preset function connection function when any hardware equipment function needs to be called in the running process of the script to be debugged.
The function return value acquisition unit is used for acquiring a function return value sent by a function corresponding to the function of the hardware equipment; the function return value is preconfigured according to the return value of the hardware equipment function in test operation.
In an alternative embodiment, the function debug module 430 module further includes:
and the preset navigation bar editing function calling unit is used for calling the preset navigation bar editing function in the preset simulation method entry file through the preset function connection function to generate a navigation bar.
And the navigation bar configuration unit is used for configuring the navigation bar at a preset position in the interface of the front-end application development environment.
In an alternative embodiment, the function debug module 430 module further includes:
and the control function calling unit is used for calling the control function associated with the triggered control in the portal file of the preset simulation method through the preset function connection function when the control in the navigation bar is triggered.
In an alternative embodiment, the function debug module 430 module further includes:
and the simulation data determining unit is used for determining whether the called parameter has simulation data locally or not when the data in the back-end application running environment needs to be read in the running process of the script to be debugged.
And the first data reading unit is used for directly reading the corresponding analog data to return when the called parameter locally has the analog data.
In an alternative embodiment, the function debug module 430 module further includes:
and the second data reading unit is used for reading the data according to a preset database interface when the called parameter has no analog data locally.
In an alternative embodiment, the predetermined function connection function is alitayjsbridge.
The function debugging device in the application development environment provided by the embodiment of the invention can execute the function debugging method in the application development environment provided by any embodiment of the invention, and has the corresponding function modules and beneficial effects of the execution method.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention. Fig. 5 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in fig. 5 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention. The computer device 12 may be any terminal device with computing power, such as an intelligent controller, a server, a mobile phone, and the like.
As shown in FIG. 5, the computer device 12 is in the form of a general purpose computing device. Components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard disk drive"). Although not shown in fig. 5, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be appreciated that although not shown in fig. 5, other hardware and/or software modules may be used in connection with computer device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implements a function debugging method in an application development environment provided by the present embodiment, the method including:
detecting a current script running environment when the running of the script to be debugged is started;
when the current script running environment is a front-end application development environment, loading a preset simulation method entry file;
when the script to be debugged needs to be interacted with the back-end application running environment in the running process, calling a target function in the entry file of the preset simulation method through a preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged;
the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged;
the back-end application running environment is a running environment built based on a preset Native framework.
The embodiment of the present invention also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for debugging a function in an application development environment as provided in any embodiment of the present invention, the method comprising:
detecting a current script running environment when the running of the script to be debugged is started;
when the current script running environment is a front-end application development environment, loading a preset simulation method entry file;
when the script to be debugged needs to be interacted with the back-end application running environment in the running process, calling a target function in the entry file of the preset simulation method through a preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged;
the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged;
the back-end application running environment is a running environment built based on a preset Native framework.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
It will be appreciated by those of ordinary skill in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed over a network of computing devices, or they may alternatively be implemented in program code executable by a computer device, such that they are stored in a memory device and executed by the computing device, or they may be separately fabricated as individual integrated circuit modules, or multiple modules or steps within them may be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.
Claims (10)
1. The function debugging method in the application development environment is characterized by comprising the following steps:
detecting a current script running environment when the running of the script to be debugged is started;
when the current script running environment is a front-end application development environment, loading a preset simulation method entry file;
when the script to be debugged needs to be interacted with the back-end application running environment in the running process, calling a target function in the entry file of the preset simulation method through a preset function connection function, and realizing the debugging process of the corresponding function in the script to be debugged;
the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged;
the back-end application running environment is a running environment built based on a preset Native framework.
2. The method of claim 1, wherein when interaction with a back-end application running environment is required in the running process of the script to be debugged, invoking the target function in the entry file of the preset simulation method through the preset function connection function, and implementing the debugging process of the corresponding function in the script to be debugged, including:
when any hardware device function needs to be called in the running process of the script to be debugged, calling a function corresponding to the hardware device function in the entry file of the preset simulation method through the preset function connection function;
acquiring a function return value sent by a function corresponding to the function of the hardware equipment;
the function return value is preconfigured according to the return value of the hardware equipment function in test operation.
3. The method of claim 1, wherein when interaction with a back-end application running environment is required in the running process of the script to be debugged, invoking the target function in the entry file of the preset simulation method through the preset function connection function, and implementing the debugging process of the corresponding function in the script to be debugged, including:
calling a preset navigation bar editing function in the preset simulation method entry file through a preset function connection function to generate a navigation bar;
and configuring the navigation bar at a preset position in an interface of the front-end application development environment.
4. A method according to claim 3, characterized in that the method further comprises:
when the control in the navigation bar is triggered, calling a control function associated with the triggered control in the portal file of the preset simulation method through a preset function connection function.
5. The method of claim 1, wherein when interaction with a back-end application running environment is required in the running process of the script to be debugged, invoking the target function in the entry file of the preset simulation method through the preset function connection function, and implementing the debugging process of the corresponding function in the script to be debugged, including:
when the data in the back-end application running environment needs to be read in the running process of the script to be debugged, determining whether the called parameters locally have simulation data;
and when the called parameter locally has analog data, directly reading the corresponding analog data to return.
6. The method of claim 5, wherein the method further comprises:
and when the called parameters have no simulation data locally, reading the data according to a preset database interface.
7. The method according to any one of claims 1-6, wherein the predetermined function connection function is alitayjsbridge.
8. A function debugging device in an application development environment, comprising:
the environment detection module is used for detecting the current script running environment when the script to be debugged is started;
the file loading module is used for loading a preset simulation method entry file when the current script running environment is a front-end application development environment;
the function debugging module is used for calling a target function in the entry file of the preset simulation method through a preset function connection function when interaction with the back-end application running environment is needed in the running process of the script to be debugged, so as to realize the debugging process of the corresponding function in the script to be debugged;
the preset simulation method entry file comprises a function set corresponding to an application function to be tested in the script to be debugged;
the back-end application running environment is a running environment built based on a preset Native framework.
9. A computer device, the computer device comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, causes the one or more processors to implement the method of functional debugging in an application development environment as recited in any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements a method for functional debugging in an application development environment as claimed in any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311664264.2A CN117667701A (en) | 2023-12-06 | 2023-12-06 | Function debugging method, device, equipment and medium in application development environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311664264.2A CN117667701A (en) | 2023-12-06 | 2023-12-06 | Function debugging method, device, equipment and medium in application development environment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117667701A true CN117667701A (en) | 2024-03-08 |
Family
ID=90078438
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311664264.2A Pending CN117667701A (en) | 2023-12-06 | 2023-12-06 | Function debugging method, device, equipment and medium in application development environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117667701A (en) |
-
2023
- 2023-12-06 CN CN202311664264.2A patent/CN117667701A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107577607B (en) | User interface automatic testing method and device, electronic equipment and storage medium | |
US9342237B2 (en) | Automated testing of gesture-based applications | |
CN107506300B (en) | User interface testing method, device, server and storage medium | |
CN110134386B (en) | Program editing method and device | |
CN111221572B (en) | Method, device, medium and equipment for automatically adapting to running environment | |
CN105975393B (en) | Page display detection method and system | |
CN111597110B (en) | Page test method and device, electronic equipment and storage medium | |
CN110320378B (en) | Method, apparatus, device and computer readable storage medium for applying for a quality control test | |
CN112231213A (en) | Web automatic testing method, system, storage medium and terminal equipment | |
CN110825370A (en) | Mobile terminal application development method, device and system | |
CN111694550A (en) | Page display control method, device and system | |
CN111767229A (en) | Performance test method, device and equipment | |
CN114217789A (en) | Function component expansion method, device, equipment, storage medium and program product | |
CN112988588B (en) | Client software debugging method and device, storage medium and electronic equipment | |
CN114218072A (en) | Test script generation method and device, storage medium and computer equipment | |
CN112416747A (en) | Test case execution method, device, equipment and medium | |
CN108536607B (en) | UI test method, device and readable storage medium | |
CN115617671A (en) | Automatic generation method and device of test script, computer equipment and storage medium | |
CN117667701A (en) | Function debugging method, device, equipment and medium in application development environment | |
CN115269331A (en) | Service topology monitoring method facing micro service group and related equipment | |
CN113254355B (en) | GRPC interface testing method and device, electronic equipment and readable storage medium | |
CN115509913A (en) | Software automation test method, device, machine readable medium and equipment | |
CN117270838B (en) | Method, device, equipment and medium for generating universal formula script | |
CN112597026B (en) | Test case generation method and device | |
CN115484200B (en) | Buried point testing method, buried point testing device, server, storage medium and buried point testing system |
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 |