Supercharge Your Innovation With Domain-Expert AI Agents!

SQL test script generation method

A technology of test scripts and test methods, which is applied in the database field, can solve the problems of difficult new use cases, cost, maintenance cost, low efficiency, and complex test codes, and achieve the effect of improving efficiency

Pending Publication Date: 2020-09-22
贵州易鲸捷信息技术有限公司
View PDF7 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Usually with this method, a test case may have to write dozens to hundreds of lines of code depending on the complexity of the use case. It is difficult to avoid cross-calling between codes. Most of the code has nothing to do with the test intent. There are more and more use cases. The test code will become more and more complex, more and more difficult to maintain, difficult to handover, difficult to add new use cases, and almost impossible to quickly migrate use cases to another language
At the same time, with the development of technology, a variety of programming languages ​​have flourished. Many languages ​​need to use databases. For database manufacturers, they need to provide connection support for multiple languages, and they need to pass tests to verify that they pass each language. Connectors can work normally when executing SQL, which requires a set of test codes for each language, and the cost of use case development, maintenance costs and efficiency are not high

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
  • SQL test script generation method
  • SQL test script generation method
  • SQL test script generation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0057] Embodiment 1 provides a test script use case writing language, which can express test cases with concise sentences. This method includes the following contents:

[0058] SQL Test Description: Configuration Description Use Case Description Group

[0059]The configuration description part and the use case description part, the configuration description is used to define the configuration of the use case when compiling and running, and the use case description group is used to define the specific test case.

[0060] The configuration described is specifically:

[0061] Config (configuration string)

[0062] Config is a syntax keyword, and the configuration string is placed between opening and closing parentheses.

[0063] The described use case description group is:

[0064] A use case description group is composed of one or more use case descriptions in sequence, and the method of a single use case is as follows:

[0065] TestCase use case name {execution statement gr...

Embodiment 2

[0104] Embodiment 2 provides a method for implementing a SQL test case writing language compiler, which can generate clear-structured target language use case codes, such as figure 1 As shown, the specific steps are:

[0105] S1, through lexical, grammatical and semantic analysis to get the intermediate data structure (i.e. execution tree).

[0106] S2, translate the intermediate data structure into the target language according to the compilation configuration.

[0107] Specifically:

[0108] S21, such as figure 2 As shown, the compiler provides basic execution environment implementations for different target languages, including virtual terminal implementations and basic implementations of test cases.

[0109] S211, such as image 3 As shown in , the virtual terminal enters the event loop after being started, receives and waits for user commands, executes the command and returns the corresponding execution result.

[0110] S212, the basic implementation of test cases i...

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 provides an SQL (Structured Query Language) test script generation method which comprises the following steps: S1, constructing a test script case writing language for a writer to writea use case conveniently; S2, analyzing the written use case by utilizing an editor, and translating the written use case into a required target language case code; and S3, if the target language generated in the S2 is a compiled language, compiling the use case code of the target language generated in the S2 to obtain a test program, executing the test program for testing, and if the target language generated in the S2 is an interpreted language, directly executing the use case code generated in the S2. According to the SQL test script generation method, a use case writer can express contentsexpressed by dozens of or even hundreds of lines of codes in a general programming language by using several lines of statements, and meanwhile, multiple target languages are written at one time for execution, so that the efficiency is greatly improved.

Description

technical field [0001] The invention belongs to the field of databases, in particular to a method for generating SQL test scripts. Background technique [0002] SQL testing is one of the core tests of database systems. There are many traditional SQL testing methods, but most of them choose a general-purpose programming language and use standard database connection interfaces such as JDBC and ODBC to access the database. Usually with this method, a test case may have to write dozens to hundreds of lines of code depending on the complexity of the use case. It is difficult to avoid cross-calling between codes. Most of the code has nothing to do with the test intent. There are more and more use cases. The test code will become more and more complex, more and more difficult to maintain, difficult to transfer, difficult to add new use cases, and it is almost impossible to quickly migrate use cases to another language. At the same time, with the development of technology, a variet...

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): G06F11/36G06F8/41G06F8/30
CPCG06F8/31G06F11/3684G06F8/41Y02D10/00
Inventor 苏锦佩周建国王效忠刘明何振兴冀贤亮
Owner 贵州易鲸捷信息技术有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More