Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Test code generation method and device based on fruit tree method

A technology for testing code and causal tree, applied in the direction of code compilation, program code conversion, software testing/debugging, etc., can solve problems such as error-prone, inconvenient management, poor readability, etc., to ensure quality, lower threshold, and reduce code coding amount of effect

Pending Publication Date: 2020-05-15
BANK OF CHINA
View PDF0 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] The embodiment of the present invention provides a test code generation method based on the causal tree method, which is used to solve the problem of poor readability, error-prone, inconvenient management, and low test efficiency of test cases in the form of code in the existing test-driven development. A technical problem, the method includes: obtaining attribute data of a business model, wherein the attribute data includes: the value range of one or more business attribute objects in the business model; generating a configurable mind map according to the attribute data; receiving the The configuration instructions of the mind map generate one or more causal trees. Each causal tree corresponds to the test case of each business attribute object in a business scenario. The test case of each business scenario includes: the constraint value relationship of each business attribute object, Observation items and expected values; according to the value range of each business attribute object in each causal tree, and the constraint value relationship, observation item and expected value corresponding to each causal tree corresponding to the test case, generate the test code corresponding to each test case
[0007] The embodiment of the present invention also provides a test code generation device based on the causal tree method, which is used to solve the problem of poor readability, error-prone, inconvenient management, and low test efficiency of test cases in the form of code in the existing test-driven development. technical problem, the device includes: a module analysis module, used to obtain attribute data of the business model, wherein the attribute data includes: the value range of one or more business attribute objects in the business model; a visual data display module, used to According to the attribute data, a configurable mind map is generated; the constraint value relationship analysis module is used to receive configuration instructions for the mind map, and generate one or more causal trees, each causal tree corresponds to each business attribute object in a business scenario The test cases of each business scenario include: the constraint value relationship of each business attribute object, observation items and expected values; the test code generation module is used to base on the value range of each business attribute object in each cause-and-effect tree, And each causal tree corresponds to the constraint value relationship, observation item and expected value corresponding to the test case, and generates the test code corresponding to each test case
[0008] The embodiment of the present invention also provides a computer device to solve the technical problems of poor readability, error-prone, inconvenient management, and low test efficiency of test cases in the form of code in the existing test-driven development. It includes a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the above-mentioned test code generation method based on the causal tree method is realized.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Test code generation method and device based on fruit tree method
  • Test code generation method and device based on fruit tree method
  • Test code generation method and device based on fruit tree method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0021] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments and descriptions of the present invention are used to explain the present invention, but not to limit the present invention.

[0022] In the description of this specification, the words "comprising", "comprising", "having", "containing" and so on are all open terms, meaning including but not limited to. A description referring to the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment or example is included in at least one of the present application. Examples or examples. In this specification, schematic representations of the above terms do not ne...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a test code generation method and device based on a fruit tree method, and the method comprises the steps: obtaining attribute data of a business model, wherein the attribute data comprises value ranges of one or more business attribute objects in a business model; generating a configurable mind map according to the attribute data; receiving a configuration instruction forthe mind map, generating one or more cause fruit trees, with each cause fruit tree corresponding to a test case of each business attribute object in one business scene, the test case of each businessscene comprising a constraint value relationship, an observation item and an expected value of each business attribute object; and generating a test code corresponding to each test case according to the value range of each business attribute object in each cause fruit tree, and the constraint value relationship, the observation item and the expected value corresponding to the test case corresponding to each cause fruit tree. Based on the mind map, the test code of the test case is generated in a visual mode, the code writing amount is reduced, and the test threshold is reduced.

Description

technical field [0001] The invention relates to the field of software development and testing, in particular to a method and device for generating test codes based on the causal tree method. Background technique [0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. The descriptions herein are not admitted to be prior art by inclusion in this section. [0003] The principle of Test-Driven Development (TDD) is to write unit test cases before developing functional codes, and the test codes determine what kind of business logic codes need to be written, that is, to drive the progress of the entire software development through tests. [0004] At present, in the existing test-driven development, the developer directly writes the code (for example, writes the junit test code) to realize the test case, that is, the test case exists in the form of code, and the test cases in this code form exist as follow...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/20G06F8/41G06F11/36
CPCG06F8/20G06F8/447G06F11/3684G06F11/3676
Inventor 杜天文王敏陈智胜
Owner BANK OF CHINA
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products