CN111367555B - Assertion method, assertion device, electronic equipment and computer readable medium - Google Patents

Assertion method, assertion device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN111367555B
CN111367555B CN202010209226.8A CN202010209226A CN111367555B CN 111367555 B CN111367555 B CN 111367555B CN 202010209226 A CN202010209226 A CN 202010209226A CN 111367555 B CN111367555 B CN 111367555B
Authority
CN
China
Prior art keywords
assertion
original assertion
original
information
attention
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.)
Active
Application number
CN202010209226.8A
Other languages
Chinese (zh)
Other versions
CN111367555A (en
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.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision 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 Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN202010209226.8A priority Critical patent/CN111367555B/en
Publication of CN111367555A publication Critical patent/CN111367555A/en
Application granted granted Critical
Publication of CN111367555B publication Critical patent/CN111367555B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/22Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

Embodiments of the present disclosure provide a method, apparatus, electronic device, and computer-readable medium for asserting, the method including: acquiring an original assertion; determining the context information of the original assertion according to the original assertion; determining the modification history of the original assertion according to the context information of the original assertion; determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion; and updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion. According to the method, the information of the first attention person corresponding to the original assertion is automatically determined, the labor cost is reduced, errors caused by manually increasing the information of the first attention person are reduced, the original assertion is quickly and automatically replaced by the updated assertion, and the labor cost is greatly reduced.

Description

Assertion method, assertion device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to a method, an apparatus, an electronic device, and a computer readable medium for assertion processing.
Background
In the prior art, an API (Application Programming Interface, application program interface) of the mobile operating system iOS provides an speaking tool, and when the asserted conditional expression value is YES, the program is normal, and the program continues to run; when the asserted conditional expression value is NO, the program is abnormal, and the program crashes; the assertion tool is turned on during the program development phase and disabled in the formal package. Artificially increasing the information of the attention of the assertion causes errors, the speed of updating the assertion is slow, and how to quickly update the assertion is a problem to be solved.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Only the independent scheme is described, and the slave scheme is not described.
The present disclosure addresses the shortcomings of existing approaches by proposing a method, apparatus, electronic device, and computer-readable medium for asserting to solve the problem of how to quickly update assertions.
In a first aspect, the present disclosure provides a method of asserting, comprising:
acquiring an original assertion;
determining the context information of the original assertion according to the original assertion;
determining the modification history of the original assertion according to the context information of the original assertion;
determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion;
and updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion.
In a second aspect, the present disclosure provides an apparatus for asserting, comprising:
the first processing module is used for acquiring original assertion;
the second processing module is used for determining the context information of the original assertion according to the original assertion;
a third processing module for determining a modification history of the original assertion based on the context information of the original assertion;
the fourth processing module is used for determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion;
and the fifth processing module is used for updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion.
In a third aspect, the present disclosure provides an electronic device comprising: a processor, a memory, and a bus;
a bus for connecting the processor and the memory;
a memory for storing operation instructions;
and a processor for executing the method of asserting the first aspect of the present disclosure by invoking the operation instruction.
In a fourth aspect, the present disclosure provides a computer readable medium storing a computer program for use in performing the method of asserting the first aspect of the present disclosure.
The technical scheme provided by the embodiment of the disclosure has at least the following beneficial effects:
acquiring an original assertion; determining the context information of the original assertion according to the original assertion; determining the modification history of the original assertion according to the context information of the original assertion; determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion; and updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion. Therefore, the information of the first attention person corresponding to the original assertion is automatically determined, the labor cost is reduced, errors caused by manually increasing the information of the first attention person are reduced, the original assertion is quickly and automatically replaced by the updated assertion, and the labor cost is greatly reduced.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings that are required to be used in the description of the embodiments of the present disclosure will be briefly introduced below.
FIG. 1 is a flow diagram of a method of asserting provided by an embodiment of the present disclosure;
FIG. 2 is a flow diagram of another method of asserting provided by an embodiment of the present disclosure;
FIG. 3 is a flow diagram of a method of yet another assertion provided by an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of an apparatus for asserting provided by an embodiment of the disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one device, module, or unit from another device, module, or unit, and are not intended to limit the order or interdependence of the functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Example 1
An embodiment of the present disclosure provides a method for asserting, where a flow chart of the method is shown in fig. 1, and the method includes:
s101, acquiring original assertion.
In the disclosed embodiments, assent assertions are some assumptions made by a concerned person when writing code, assertions are a high-level form of program exception handling, and assertions are expressed as boolean expressions.
In an embodiment of the present disclosure, obtaining an original assertion includes:
the source code is scanned through a hook comprised by the distributed version control system Git, and the original assertion comprised by the source code is obtained.
In the disclosed embodiment, git is an open-source distributed version control system for agilely and efficiently processing items. Hook is a custom script that is triggered when an action occurs.
S102, determining the context information of the original assertion according to the original assertion.
In an embodiment of the present disclosure, the context information of the original assertion includes at least one of:
the occurrence time of the original assertion trigger, the occurrence times of the original assertion trigger, the code line, the function name, the file position and the stack information.
It should be noted that, the stack is a data structure in which data items are arranged in sequence, and the data items are inserted or deleted at the top of the stack.
S103, according to the context information of the original assertion, determining the modification history of the original assertion.
S104, according to the modification history of the original assertion, determining information of a first attention person corresponding to the original assertion.
In an embodiment of the present disclosure, determining information of a first attention person corresponding to an original assertion includes:
information of a first watcher is determined by the distributed version control system Git, the information of the first watcher including author information of an original asserted initial version.
S105, updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion.
In the embodiment of the disclosure, an original assertion is obtained; determining the context information of the original assertion according to the original assertion; determining the modification history of the original assertion according to the context information of the original assertion; determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion; and updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion. Therefore, the information of the first attention person corresponding to the original assertion is automatically determined, the labor cost is reduced, errors caused by manually increasing the information of the first attention person are reduced, the original assertion is quickly and automatically replaced by the updated assertion, and the labor cost is greatly reduced.
In the embodiment of the disclosure, when it is determined that the original assertion does not have a modification history, designating a current author as a second attention person, wherein the current author comprises a user corresponding to a server for updating the original assertion;
and updating the original assertion according to the context information of the original assertion and the information of the second attention person to obtain the updated assertion.
Another method for asserting is provided in an embodiment of the present disclosure, a flow chart of which is shown in fig. 2, and the method includes:
s201, inquiring the original assertion.
In the disclosed embodiment, the original assertion is nsaser (); the NSAssert () is a macro and is used for debugging the defect Bug in the program in the development stage, whether the Bug belongs to the Bug is judged by transmitting a conditional expression for the NSAssert (), the condition is met, the true value is returned, the program continues to run, and if the false value is returned, the exception is thrown out.
S202, acquiring the context information of the original assertion.
S203, judging whether the original assertion has a modification history, and when the original assertion is determined to have the modification history, turning to step S204 for processing; when it is determined that the original assertion has not modified the history, the flow goes to the processing of step S206.
S204, according to the modification history of the original assertion, determining information of a first attention person corresponding to the original assertion.
In the disclosed embodiments, the first attention is the author of the original assertion's initial version.
S205, designate the first attention as the attention person.
S206, designating the second attention as the attention device.
In an embodiment of the present disclosure, the second attention is the current author.
S207, updating the original assertion to obtain the updated assertion.
In the embodiment of the disclosure, the original assertion is updated according to the context information of the original assertion and the information of the first attention person, and the updated assertion is obtained.
Yet another method for asserting is provided in an embodiment of the present disclosure, a flow diagram of which is shown in fig. 3, the method comprising:
s301, submitting program codes.
S302, obtaining the modified and newly added files.
S303, inquiring the code of the original assertion or the updated assertion which is currently used.
In the embodiment of the disclosure, the original assertion is updated to obtain the updated assertion.
S304, acquiring the context information of the original assertion.
S305, judging whether the currently used original assertion or updated assertion has a focus, and when the currently used original assertion or updated assertion is determined to have a focus, turning to step S306 for processing; when it is determined that the original assertion or the updated assertion currently used has no attention, the flow goes to the processing of step S307.
S306, continuing to submit the program codes, and after completing the program code submission, turning to step S313 for processing.
S307, judging whether the original assertion or the updated assertion used currently has a modification history, and when the original assertion or the updated assertion used currently is determined to have the modification history, turning to step S308 for processing; when it is determined that the original assertion or the updated assertion that is currently used has not modified the history, the flow goes to the processing of step S310.
S308, according to the modification history of the original assertion or the updated assertion, determining the information of the first attention person corresponding to the original assertion or the updated assertion.
S309, the first attention is designated as the attention, and the process proceeds to step S311.
S310, designating the second attention as the attention person.
In an embodiment of the present disclosure, the second attention is the current author.
S311, updating the original assertion or updated assertion used currently to the updated assertion carrying the attention person.
S312, submitting the updated asserted code carrying the attention person.
S313, ending the flow.
The application of the embodiment of the disclosure has at least the following beneficial effects:
the information of the first attention person corresponding to the original assertion is automatically determined, so that the labor cost is reduced, errors caused by manually increasing the information of the first attention person are reduced, the original assertion is quickly and automatically replaced by the updated assertion, and the labor cost is greatly reduced.
Example two
Based on the same inventive concept, the embodiment of the present disclosure further provides a device for asserting, where a schematic structural diagram of the device is shown in fig. 4, and the device 40 for asserting includes a first processing module 401, a second processing module 402, a third processing module 403, a fourth processing module 404, and a fifth processing module 405.
A first processing module 401, configured to obtain an original assertion;
a second processing module 402, configured to determine context information of the original assertion according to the original assertion;
a third processing module 403 for determining a modification history of the original assertion based on the context information of the original assertion;
a fourth processing module 404, configured to determine, according to the modification history of the original assertion, information of a first attention person corresponding to the original assertion;
and a fifth processing module 405, configured to update the original assertion according to the context information of the original assertion and the information of the first attention device, so as to obtain an updated assertion.
In an embodiment of the present disclosure, the context information of the original assertion includes at least one of:
the occurrence time of the original assertion trigger, the occurrence times of the original assertion trigger, the code line, the function name, the file position and the stack information.
In the embodiment of the disclosure, when it is determined that the original assertion does not have a modification history, designating a current author as a second attention person, wherein the current author comprises a user corresponding to a server for updating the original assertion;
and updating the original assertion according to the context information of the original assertion and the information of the second attention person to obtain the updated assertion.
In the embodiment of the present disclosure, the first processing module 401 is specifically configured to scan the source code through a hook included in the distributed version control system Git, and obtain an original assertion included in the source code.
In the embodiment of the present disclosure, the fourth processing module 404 is specifically configured to determine, by using the distributed version control system Git, information of a first attention person, where the information of the first attention person includes information of an author of an initial version of the original assertion.
The application of the embodiment of the disclosure has at least the following beneficial effects:
acquiring an original assertion; determining the context information of the original assertion according to the original assertion; determining the modification history of the original assertion according to the context information of the original assertion; determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion; and updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion. Therefore, the information of the first attention person corresponding to the original assertion is automatically determined, the labor cost is reduced, errors caused by manually increasing the information of the first attention person are reduced, the original assertion is quickly and automatically replaced by the updated assertion, and the labor cost is greatly reduced.
In the device for asserting the assertion provided in the embodiment of the present disclosure, which is not described in detail, reference may be made to the method for asserting the first embodiment, and the beneficial effects that the device for asserting the assertion provided in the embodiment of the present disclosure can achieve are the same as the method for asserting the first embodiment, which is not described in detail herein.
Example III
Referring now to fig. 5, a schematic diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
An electronic device includes: a memory and a processor, where the processor may be referred to as a processing device 801 described below, the memory may include at least one of a Read Only Memory (ROM) 802, a Random Access Memory (RAM) 803, and a storage device 808 described below, as shown in fig. 5 in particular:
the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with programs stored in a Read Only Memory (ROM) 802 or loaded from a storage 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
In general, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, etc.; storage 808 including, for example, magnetic tape, hard disk, etc.; communication means 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 5 shows an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 801.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: 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 the context of this disclosure, 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. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. 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: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring an original assertion; determining the context information of the original assertion according to the original assertion; determining the modification history of the original assertion according to the context information of the original assertion; determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion; and updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, 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).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Where the name of a module or unit does not in some cases constitute a limitation of the unit itself.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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 accordance with one or more embodiments of the present disclosure, embodiment one provides a method of asserting, comprising:
acquiring an original assertion;
determining the context information of the original assertion according to the original assertion;
determining the modification history of the original assertion according to the context information of the original assertion;
determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion;
and updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion.
In an embodiment of the present disclosure, the context information of the original assertion includes at least one of:
the occurrence time of the original assertion trigger, the occurrence times of the original assertion trigger, the code line, the function name, the file position and the stack information.
In the embodiment of the disclosure, when it is determined that the original assertion does not have a modification history, designating a current author as a second attention person, wherein the current author comprises a user corresponding to a server for updating the original assertion;
and updating the original assertion according to the context information of the original assertion and the information of the second attention person to obtain the updated assertion.
In an embodiment of the present disclosure, obtaining an original assertion includes:
the source code is scanned through a hook comprised by the distributed version control system Git, and the original assertion comprised by the source code is obtained.
In an embodiment of the present disclosure, determining information of a first attention person corresponding to an original assertion includes:
information of a first watcher is determined by the distributed version control system Git, the information of the first watcher including author information of an original asserted initial version.
In accordance with one or more embodiments of the present disclosure, embodiment two provides an apparatus for asserting, comprising:
the first processing module is used for acquiring original assertion;
the second processing module is used for determining the context information of the original assertion according to the original assertion;
a third processing module for determining a modification history of the original assertion based on the context information of the original assertion;
the fourth processing module is used for determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion;
and the fifth processing module is used for updating the original assertion according to the context information of the original assertion and the information of the first attention person to obtain the updated assertion.
In an embodiment of the present disclosure, the context information of the original assertion includes at least one of:
the occurrence time of the original assertion trigger, the occurrence times of the original assertion trigger, the code line, the function name, the file position and the stack information.
In the embodiment of the disclosure, when it is determined that the original assertion does not have a modification history, designating a current author as a second attention person, wherein the current author comprises a user corresponding to a server for updating the original assertion;
and updating the original assertion according to the context information of the original assertion and the information of the second attention person to obtain the updated assertion.
In the embodiment of the disclosure, the first processing module is specifically configured to scan the source code through a hook included in the distributed version control system Git, and obtain an original assertion included in the source code.
In an embodiment of the disclosure, the fourth processing module is specifically configured to determine, by using the distributed version control system Git, information of a first attention, where the information of the first attention includes author information of an initial version of the original assertion.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (9)

1. A method of asserting, comprising:
acquiring an original assertion;
determining context information of the original assertion according to the original assertion;
determining a modification history of the original assertion according to the context information of the original assertion;
determining information of a first attention person corresponding to the original assertion according to the modification history of the original assertion, wherein the first attention person comprises author information of an initial version of the original assertion;
updating the original assertion into an updated assertion carrying the first-attention-person information according to the context information of the original assertion and the information of the first-attention-person; the method comprises the steps of,
in response to determining that the original assertion does not have a modification history, designating a current author as a second attention, the current author including a user corresponding to a server that updated the original assertion;
and updating the original assertion according to the context information of the original assertion and the information of the second attention person to obtain the updated assertion.
2. The method of claim 1, wherein the context information of the original assertion comprises at least one of:
the occurrence time of the original assertion trigger, the occurrence times of the original assertion trigger, the code line, the function name, the file position and the stack information.
3. The method of claim 1, wherein the obtaining the original assertion comprises:
and scanning the source code through a hook included in the distributed version control system Git to acquire the original assertion included in the source code.
4. The method of claim 1, wherein the determining information of the first attention person to which the original assertion corresponds comprises:
information of a first watcher is determined by the distributed version control system Git, the information of the first watcher including author information of an initial version of the original assertion.
5. An apparatus for asserting, comprising:
the first processing module is used for acquiring original assertion;
the second processing module is used for determining the context information of the original assertion according to the original assertion;
a third processing module for determining a modification history of the original assertion based on the context information of the original assertion;
a fourth processing module, configured to determine, according to a modification history of the original assertion, information of a first attention person corresponding to the original assertion, where the first attention person includes author information of an initial version of the original assertion;
a fifth processing module, configured to update the original assertion to an updated assertion carrying the first attention information according to the context information of the original assertion and the information of the first attention; the method comprises the steps of,
in response to determining that the original assertion does not have a modification history, designating a current author as a second attention, the current author including a user corresponding to a server that updated the original assertion;
and updating the original assertion according to the context information of the original assertion and the information of the second attention person to obtain the updated assertion.
6. The apparatus according to claim 5, comprising:
the first processing module is specifically configured to scan the source code through a hook comprised by the distributed version control system Git, and obtain an original assertion comprised by the source code.
7. The apparatus according to claim 5, comprising:
the fourth processing module is specifically configured to determine, by using the distributed version control system Git, information of a first attention, where the information of the first attention includes author information of an initial version of the original assertion.
8. An electronic device, comprising: a processor, a memory;
the memory is used for storing a computer program;
the processor is configured to execute the method of asserting any of the claims 1-4 by invoking the computer program.
9. A computer readable medium, characterized in that a computer program is stored for implementing the method of asserting according to any of claims 1-4 when executed by a processor.
CN202010209226.8A 2020-03-23 2020-03-23 Assertion method, assertion device, electronic equipment and computer readable medium Active CN111367555B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010209226.8A CN111367555B (en) 2020-03-23 2020-03-23 Assertion method, assertion device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010209226.8A CN111367555B (en) 2020-03-23 2020-03-23 Assertion method, assertion device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN111367555A CN111367555A (en) 2020-07-03
CN111367555B true CN111367555B (en) 2023-08-08

Family

ID=71209006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010209226.8A Active CN111367555B (en) 2020-03-23 2020-03-23 Assertion method, assertion device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN111367555B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295280A (en) * 2008-06-18 2008-10-29 腾讯科技(深圳)有限公司 Automatic software debugging method and system
JP2013164673A (en) * 2012-02-09 2013-08-22 Toshiba Corp Software management system and management method thereof
CN103678110A (en) * 2012-09-26 2014-03-26 国际商业机器公司 Method and device for providing modification related information
US9547579B1 (en) * 2014-12-30 2017-01-17 Ca, Inc. Method and apparatus for automatically detecting defects
CN107329894A (en) * 2017-06-21 2017-11-07 广州华多网络科技有限公司 Application program system method of testing, device and electronic equipment
WO2018014778A1 (en) * 2016-07-18 2018-01-25 深圳创维数字技术有限公司 Automatic test repairing method and system thereof
CN107729235A (en) * 2017-09-29 2018-02-23 百度在线网络技术(北京)有限公司 Method, apparatus, equipment and the computer-readable medium of the location code defect producer
WO2018120965A1 (en) * 2016-12-30 2018-07-05 上海壹账通金融科技有限公司 Automatic test method and device, and computer-readable storage medium
CN109032687A (en) * 2018-06-11 2018-12-18 北京奇艺世纪科技有限公司 Shield the method and device that SDK danger is called
CN109314703A (en) * 2016-06-03 2019-02-05 格马尔托股份有限公司 Method for managing the state of connection equipment
CN110059001A (en) * 2019-03-15 2019-07-26 平安普惠企业管理有限公司 The automatic upgrade control method of program, device, computer equipment and storage medium
CN110427188A (en) * 2019-08-02 2019-11-08 深圳前海微众银行股份有限公司 It is single to survey configuration method, device, equipment and the storage medium for asserting program
CN110489164A (en) * 2019-07-09 2019-11-22 北京字节跳动网络技术有限公司 It is a kind of to hide acquisition methods, device, medium and the equipment for asserting information
CN110704306A (en) * 2019-09-09 2020-01-17 平安普惠企业管理有限公司 Assertion processing method, device, equipment and storage medium in test

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006134214A (en) * 2004-11-09 2006-05-25 Hitachi Ltd File version management method and computing system
US20100313186A1 (en) * 2009-06-04 2010-12-09 Microsoft Corporation Developer-managed debugger data records
US20140114980A1 (en) * 2012-10-19 2014-04-24 International Business Machines Corporation Mining Developer Directories from Project Change History
TWI528173B (en) * 2013-10-25 2016-04-01 緯創資通股份有限公司 Method, apparatus and computer program product for debugging and error prevention
US9823904B2 (en) * 2014-12-18 2017-11-21 International Business Machines Corporation Managed assertions in an integrated development environment
US9678855B2 (en) * 2014-12-30 2017-06-13 International Business Machines Corporation Managing assertions while compiling and debugging source code

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295280A (en) * 2008-06-18 2008-10-29 腾讯科技(深圳)有限公司 Automatic software debugging method and system
JP2013164673A (en) * 2012-02-09 2013-08-22 Toshiba Corp Software management system and management method thereof
CN103678110A (en) * 2012-09-26 2014-03-26 国际商业机器公司 Method and device for providing modification related information
US9547579B1 (en) * 2014-12-30 2017-01-17 Ca, Inc. Method and apparatus for automatically detecting defects
CN109314703A (en) * 2016-06-03 2019-02-05 格马尔托股份有限公司 Method for managing the state of connection equipment
WO2018014778A1 (en) * 2016-07-18 2018-01-25 深圳创维数字技术有限公司 Automatic test repairing method and system thereof
WO2018120965A1 (en) * 2016-12-30 2018-07-05 上海壹账通金融科技有限公司 Automatic test method and device, and computer-readable storage medium
CN107329894A (en) * 2017-06-21 2017-11-07 广州华多网络科技有限公司 Application program system method of testing, device and electronic equipment
CN107729235A (en) * 2017-09-29 2018-02-23 百度在线网络技术(北京)有限公司 Method, apparatus, equipment and the computer-readable medium of the location code defect producer
CN109032687A (en) * 2018-06-11 2018-12-18 北京奇艺世纪科技有限公司 Shield the method and device that SDK danger is called
CN110059001A (en) * 2019-03-15 2019-07-26 平安普惠企业管理有限公司 The automatic upgrade control method of program, device, computer equipment and storage medium
CN110489164A (en) * 2019-07-09 2019-11-22 北京字节跳动网络技术有限公司 It is a kind of to hide acquisition methods, device, medium and the equipment for asserting information
CN110427188A (en) * 2019-08-02 2019-11-08 深圳前海微众银行股份有限公司 It is single to survey configuration method, device, equipment and the storage medium for asserting program
CN110704306A (en) * 2019-09-09 2020-01-17 平安普惠企业管理有限公司 Assertion processing method, device, equipment and storage medium in test

Also Published As

Publication number Publication date
CN111367555A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN110851139B (en) Method and device for checking codes and electronic equipment
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN112214408A (en) Dependency conflict detection method and device, electronic equipment and computer readable medium
CN111274503B (en) Data processing method, device, electronic equipment and computer readable medium
CN113392018B (en) Traffic distribution method and device, storage medium and electronic equipment
CN111460432B (en) On-line document authority control method, device, equipment and computer readable medium
CN113220281A (en) Information generation method and device, terminal equipment and storage medium
CN111367555B (en) Assertion method, assertion device, electronic equipment and computer readable medium
CN111625326B (en) Task pipeline execution method and device and electronic equipment
CN111538717B (en) Data processing method, device, electronic equipment and computer readable medium
CN111680754B (en) Image classification method, device, electronic equipment and computer readable storage medium
CN114611483A (en) Method and device for automatically upgrading nuclear power DCS control logic diagram and function diagram association
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable medium
CN111310483B (en) Translation method, translation device, electronic equipment and storage medium
CN116521175A (en) Dependency introduction method, apparatus, medium and electronic device
CN116719619A (en) Power terminal request processing method, device, electronic equipment and computer medium
CN114168485A (en) Test method, device, equipment and medium
CN117472425A (en) Resource processing method and device, readable medium and electronic equipment
CN116701013A (en) Message consumption method, device, electronic equipment and computer readable medium
CN117093284A (en) Plug-in calling method, device, medium and electronic equipment
CN115242862A (en) Network request control method, device, medium and electronic equipment
CN116092092A (en) Matching method, device, medium and electronic equipment
CN117493217A (en) Test case generation method and device, readable medium and electronic equipment
CN117197565A (en) Content understanding model training, content understanding method, device, medium and equipment

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant