CN103365777A - Test case generation system and system - Google Patents

Test case generation system and system Download PDF

Info

Publication number
CN103365777A
CN103365777A CN2013102790151A CN201310279015A CN103365777A CN 103365777 A CN103365777 A CN 103365777A CN 2013102790151 A CN2013102790151 A CN 2013102790151A CN 201310279015 A CN201310279015 A CN 201310279015A CN 103365777 A CN103365777 A CN 103365777A
Authority
CN
China
Prior art keywords
data element
data
document
value
test
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.)
Granted
Application number
CN2013102790151A
Other languages
Chinese (zh)
Other versions
CN103365777B (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.)
CHENGDU GOLDISC UESTC MULTIMEDIA TECHNOLOGY Co Ltd
MINISTRY OF HEALTH STATISTICAL INFORMATION CENTER
University of Electronic Science and Technology of China
Original Assignee
CHENGDU GOLDISC UESTC MULTIMEDIA TECHNOLOGY Co Ltd
MINISTRY OF HEALTH STATISTICAL INFORMATION CENTER
University of Electronic Science and Technology of China
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 CHENGDU GOLDISC UESTC MULTIMEDIA TECHNOLOGY Co Ltd, MINISTRY OF HEALTH STATISTICAL INFORMATION CENTER, University of Electronic Science and Technology of China filed Critical CHENGDU GOLDISC UESTC MULTIMEDIA TECHNOLOGY Co Ltd
Priority to CN201310279015.1A priority Critical patent/CN103365777B/en
Publication of CN103365777A publication Critical patent/CN103365777A/en
Application granted granted Critical
Publication of CN103365777B publication Critical patent/CN103365777B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a test case generation method which is characterized by comprising the following steps: a1, building a document template base and a basis database; a2, selecting a use-case template and selecting a corresponding document template from the document template base according to the requirements of a tested system; a3, recognizing data elements in the document template; recognizing each corresponding data element in the selected document template according to the data elements of a data set corresponding to the document template; a4, acquiring document paths of the data elements; taking out the positions of the data elements in the template to obtain the document path of each data element according to XML document rules and X Path syntax; a5, acquiring the value of each data element; a6, generating a test case, and building a mapping relation between the taken out data elements and the data element document paths, and matching, so as to build the test case. The invention aims to provide the test case generation method based on an electronic healthy file standard conformance testing system; automatization of building the test case in the testing system is achieved, and the randomness of the integral value of the use case is ensured, and the testing process is enabled to be more intelligent and fairer.

Description

A kind of method for generating test case and system
Technical field
The present invention relates to test and technical field of data processing, specifically is a kind of automatic example generation method.
Background technology
Along with the develop rapidly of the correlation techniques such as robotization, the development and application of software program has obtained great development.After a software program is finished in exploitation, usually need to test it, can normally move and reach the designed execution result of program to confirm it, if program is when test, can not normally move, and this situation frequent occurrence, show that then there is defective in software.The example that moves in this test process or data etc. are test case.Test case is the scheme for test, comprise for whole execution in step of tested main body, and the execution result of expection.Test case obtains test result after being carried out by tested main body, and the execution result of test result and expection is compared, if test result meets the execution result of expection then tests and pass through, otherwise test is not passed through.
The Ministry of Public Health has promulgated a series of information standards and standard in recent years to the research of medical basic data and data set.The infosystem standardization effort of each medical institutions is carrying out like a raging fire also, and whether health information system or platform follow standard so, also needs further test.Under this background, we in conjunction with the concerned countries standard, study and have developed electronic health care archival standards compliance test system based on international CDA and HL7 V3 standard, and we have proposed a kind of method for generating test case in this test macro.
 
Summary of the invention
The object of the invention is to provides a kind of method for generating test case based on electronic health care archival standards compliance test system at this; Realize that test macro makes up the robotization of test case, can guarantee use-case value randomness on the whole, so that test process is more intelligent and fair.
 
The present invention is achieved in that a kind of method for generating test case of structure, it is characterized in that: may further comprise the steps;
A1 makes up document template storehouse and basic database;
A2 selects the use-case masterplate: the demand according to system under test (SUT) is selected corresponding document template from the document template storehouse;
Data element in the a3 identification document template: according to the data element of document template corresponding data collection, identify each corresponding in selected document template data element;
A4 obtains the document path of data element: according to XML document rule and XPath grammer, take out the position of data element in masterplate, obtain the document path of each data element;
A5 obtains each data element value: each data element carried out index in data set data element storehouse, judges first the type of data set data element, if general data is first, and the default value in the collection data element storehouse of just fetching data; If the data element of codomain code or master data unit type, further index s Basic Date Element storehouse then, random value from the codomain code library of correspondence or master data unit value storehouse;
A6 generating test use case: mapping relations are made in data element value and the data element document path of taking out, mated, thereby make up test case.
According to a kind of method for generating test case of the present invention, it is characterized in that: the structure of four basic databases is as follows:
Test macro is divided into three major types with all s Basic Date Elements: the data element of codomain code table is arranged, without the data element of codomain code table and general data unit, make up data set data element storehouse, the s Basic Date Element storehouse, codomain code data unit value storehouse, safeguard basic data in four storehouses, master data unit value storehouse.
By above four basic databases, data set and s Basic Date Element and their value thereof are associated together, and maintenance function to data element and data element value is provided, realize the operations such as increasing, delete, change, look into to data element, data element value.
The classification of data element value type: test macro allows the tester to add the source data that the data element value makes up as use-case in master data unit value storehouse, and all data element values are divided into three classes: normal value, boundary value and super boundary value.The data element value of randomly drawing during generating test use case also will have just wrong, like this with regard to refinement the test granularity, also include the wrong processing mode of system under test (SUT) in test specification.
A kind of test macro of generating test use case is characterized in that: comprising:
The basic data management unit is used for the needed basic data of storage generating test use case;
The document template administrative unit is used for the needed document template of storage generating test use case;
Document path acquiring unit is used for according to document template, according to extracting rule, extracts the document path;
The condition judgment unit is for document template and data element and the data element value of selecting corresponding test item;
The test case generation unit is used for document path and the data element value obtained are mated, and is combined into the test case of corresponding test item.
The invention has the advantages that: the method for generating test case of native system is as prerequisite take Ministry of Public Health's relevant criterion, based on international CDA and HL7 V3 standard, by the test process of electronic health care archival standards compliance test project and the labor summary of demand are formed, realization is strong, can satisfy test fully to the requirement of use-case, the generation of test case is take robotization and randomness as principle, thereby effectively utilizes the advantage of software systems and guaranteed the strict and fair of test process.
 
Description of drawings
Fig. 1 is use-case generating structure frame diagram;
Fig. 2 is that use-case generates implementing procedure figure;
Fig. 3 is the test system structure synoptic diagram.
Embodiment
The present invention is described in detail below in conjunction with accompanying drawing 1-3, and the technical scheme in the embodiment of the invention is clearly and completely described, and obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
As shown in Figure 2, Fig. 2 is that use-case of the present invention generates particular flow sheet, and a kind of method for generating test case comprises following implementation step;
A1 makes up document template storehouse and basic database;
A2 selects the use-case masterplate: the demand according to system under test (SUT) is selected corresponding document template from the document template storehouse;
Data element in the a3 identification document template: according to the data element of document template corresponding data collection, identify each corresponding in selected document template data element;
A4 obtains the document path of data element: according to XML document rule and XPath grammer, take out the position of data element in masterplate, obtain the document path of each data element;
A5 obtains each data element value: each data element carried out index in data set data element storehouse, judges first the type of data set data element, if general data is first, and the default value in the collection data element storehouse of just fetching data; If the data element of codomain code or master data unit type, further index s Basic Date Element storehouse then, random value from the codomain code library of correspondence or master data unit value storehouse;
A6 generating test use case: mapping relations are made in data element value and the data element document path of taking out, mated, thereby make up test case.
Among the present invention, the structure of four basic databases is as follows:
Test macro is divided into three major types with all s Basic Date Elements: the data element of codomain code table is arranged, without the data element of codomain code table and general data unit, make up data set data element storehouse, the s Basic Date Element storehouse, codomain code data unit value storehouse, safeguard basic data in four storehouses, master data unit value storehouse:
A) data set data element storehouse
Figure 2013102790151100002DEST_PATH_IMAGE001
B) s Basic Date Element storehouse
Figure 416546DEST_PATH_IMAGE002
C) codomain code data unit value storehouse
Figure 2013102790151100002DEST_PATH_IMAGE003
D) master data unit value storehouse
Figure 271370DEST_PATH_IMAGE004
By above four basic databases, data set and s Basic Date Element and their value thereof are associated together, and maintenance function to data element and data element value is provided, realize the operations such as increasing, delete, change, look into to data element, data element value.
A kind of test macro of generating test use case, as shown in Figure 3; Comprise:
Basic data management unit 101 is used for the needed basic data of storage generating test use case;
Document template administrative unit 102 is used for the needed document template of storage generating test use case;
Document path acquiring unit 103 is used for according to document template, according to extracting rule, extracts the document path;
Condition judgment unit 104 is for document template and data element and the data element value of selecting corresponding test item;
Test case generation unit 105 is used for document path and the data element value obtained are mated, and is combined into the test case of corresponding test item.
Among the present invention, the classification of data element value type:
Test macro allows the tester to add the source data that the data element value makes up as use-case in master data unit value storehouse, the data element value then follows three kinds of concrete grammars that provide in " use-case write method " to design (equivalence class partitioning, boundary value analysis method and the method for guessing wrong), all data element values are divided into three classes: normal value, boundary value and super boundary value, the data element value of randomly drawing during generating test use case also will have just wrong, like this with regard to refinement the test granularity, also include the wrong processing mode of system under test (SUT) in test specification.
The test case that test case of the present invention can be applicable to the compliance test of electronic health care archival standards generates, take Ministry of Public Health's relevant criterion as prerequisite, by the test process of electronic health care archival standards compliance test project and the labor summary of demand are formed.Use-case aspect the data standard test mainly uses the shared document standard as data standard test frame and data carrier; Use-case aspect platform service mainly is to adopt HL7 V3 message as service testing framework and data carrier.Use-case generates foundation: for document or Information frame, " health information shared document establishment standard ", " health account shared document standard 1-20 part " and HL7 V3.0 standard are followed in the generation of use-case; For concrete data element, " the basic public health service standard (version in 2011) of country ", " the health account basic WS365-2011 of urban and rural residents ", " WS 363-2011 health information data element catalogue 1-17 part ", " WS 364-2011 health information data element codomain code 1-17 part " are followed in the generation of use-case, have so just guaranteed the standardization of whole use-case from integral body to the details.
The use-case write method
Electronic health care archival standards compliance test process is Black-box Testing, and the use-case write method comprises equivalence class partitioning, boundary value analysis method and the method for guessing wrong.
1) equivalence class partitioning: it is on the basis of analyzing requirements specification that equivalence class is divided, and the input domain of program is divided into some parts, and then the favored area representative data forms test case in every part.
Step is as follows:
A) divide effective equivalence class: to specification be meaningful, reasonably input the set that data consist of;
B) divide invalid equivalence class: be the set of meaningless, irrational input data formation to specification;
C) be unique numbering of each DEFINED BY EQUIVALENT CLASS;
D) for each equivalence class designs one group of test case, guarantee to cover corresponding equivalence class.
2) boundary value analysis method: boundary value analysis is tested for boundary value.It is exactly the boundary value analysis method that use equals, is less than or greater than the method that the data of boundary value test program.
Step is as follows:
A) by analyzing specification, find out a plurality of possible boundary conditions;
B) to each boundary condition, provide the input data that satisfy and do not satisfy boundary value;
C) design corresponding test case.
3) method of guessing wrong: the method for guessing wrong refers to experienced tester, by listing the information slip of presumable mistake and fallibility, writes out the method for test case.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be apparent concerning those skilled in the art, and General Principle as defined herein can in the situation that does not break away from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (3)

1. a method for generating test case is characterized in that: may further comprise the steps;
A1 makes up document template storehouse and basic database;
A2 selects the use-case masterplate: the demand according to system under test (SUT) is selected corresponding document template from the document template storehouse;
Data element in the a3 identification document template: according to the data element of document template corresponding data collection, identify each corresponding in selected document template data element;
A4 obtains the document path of data element: according to XML document rule and XPath grammer, take out the position of data element in masterplate, obtain the document path of each data element;
A5 obtains each data element value: each data element carried out index in data set data element storehouse, judges first the type of data set data element,
If general data is first, the default value in the collection data element storehouse of just fetching data;
If the data element of codomain code or master data unit type, further index s Basic Date Element storehouse then, random value from the codomain code library of correspondence or master data unit value storehouse;
A6 generating test use case: mapping relations are made in data element value and the data element document path of taking out, mated, thereby make up test case.
2. a kind of method for generating test case according to claim 1, it is characterized in that: the structure of four basic databases is as follows:
Test macro is divided into three major types with all s Basic Date Elements: the data element of codomain code table is arranged, without the data element of codomain code table and general data unit, make up data set data element storehouse, the s Basic Date Element storehouse, codomain code data unit value storehouse, safeguard basic data in four storehouses, master data unit value storehouse;
By above four basic databases, data set and s Basic Date Element and their value thereof are associated together, and maintenance function to data element and data element value is provided, realize the operations such as increasing, delete, change, look into to data element, data element value.
3. the test macro of a generating test use case is characterized in that: comprising:
The basic data management unit is used for the needed basic data of storage generating test use case;
The document template administrative unit is used for the needed document template of storage generating test use case;
Document path acquiring unit is used for according to document template, according to extracting rule, extracts the document path;
The condition judgment unit is for document template and data element and the data element value of selecting corresponding test item;
The test case generation unit is used for document path and the data element value obtained are mated, and is combined into the test case of corresponding test item.
CN201310279015.1A 2013-07-04 2013-07-04 A kind of method for generating test case and system Active CN103365777B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310279015.1A CN103365777B (en) 2013-07-04 2013-07-04 A kind of method for generating test case and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310279015.1A CN103365777B (en) 2013-07-04 2013-07-04 A kind of method for generating test case and system

Publications (2)

Publication Number Publication Date
CN103365777A true CN103365777A (en) 2013-10-23
CN103365777B CN103365777B (en) 2015-12-02

Family

ID=49367182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310279015.1A Active CN103365777B (en) 2013-07-04 2013-07-04 A kind of method for generating test case and system

Country Status (1)

Country Link
CN (1) CN103365777B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461907A (en) * 2014-12-30 2015-03-25 成都金盘电子科大多媒体技术有限公司 Health information data set standard conformance automated testing method and system
CN105808437A (en) * 2016-03-09 2016-07-27 广州彩瞳网络技术有限公司 Automation testing method and system based on test case data table
CN107133521A (en) * 2017-05-12 2017-09-05 天津大学 Demand for security template construction method based on demand for security meta-model
CN108304329A (en) * 2018-02-13 2018-07-20 论客科技(广州)有限公司 A kind of testing example design method, apparatus, terminal and readable storage medium storing program for executing
CN113342692A (en) * 2021-07-05 2021-09-03 卫宁健康科技集团股份有限公司 Test case automatic generation method and device, electronic equipment and storage medium
CN113419964A (en) * 2021-07-14 2021-09-21 上海浦东发展银行股份有限公司 Test case generation method and device, computer equipment and storage medium
CN114388142A (en) * 2022-03-23 2022-04-22 成都瑞华康源科技有限公司 Value domain code mapping rapid processing method
CN113342692B (en) * 2021-07-05 2024-05-03 卫宁健康科技集团股份有限公司 Automatic test case generation method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221530A (en) * 2008-01-22 2008-07-16 中兴通讯股份有限公司 Method for automatically leading in test cases
CN101673236A (en) * 2009-10-13 2010-03-17 中国人民解放军国防科学技术大学 Full-covered automatic generating method of test case package of microprocessor
CN101976220A (en) * 2010-09-27 2011-02-16 北京神州泰岳软件股份有限公司 Unit test system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221530A (en) * 2008-01-22 2008-07-16 中兴通讯股份有限公司 Method for automatically leading in test cases
CN101673236A (en) * 2009-10-13 2010-03-17 中国人民解放军国防科学技术大学 Full-covered automatic generating method of test case package of microprocessor
CN101976220A (en) * 2010-09-27 2011-02-16 北京神州泰岳软件股份有限公司 Unit test system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
沈丽宁等: "电子健康档案符合性测试的提出与设计", 《中国医院管理》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461907A (en) * 2014-12-30 2015-03-25 成都金盘电子科大多媒体技术有限公司 Health information data set standard conformance automated testing method and system
CN105808437A (en) * 2016-03-09 2016-07-27 广州彩瞳网络技术有限公司 Automation testing method and system based on test case data table
CN107133521A (en) * 2017-05-12 2017-09-05 天津大学 Demand for security template construction method based on demand for security meta-model
CN108304329A (en) * 2018-02-13 2018-07-20 论客科技(广州)有限公司 A kind of testing example design method, apparatus, terminal and readable storage medium storing program for executing
CN108304329B (en) * 2018-02-13 2020-12-15 论客科技(广州)有限公司 Test case design method and device, terminal and readable storage medium
CN113342692A (en) * 2021-07-05 2021-09-03 卫宁健康科技集团股份有限公司 Test case automatic generation method and device, electronic equipment and storage medium
CN113342692B (en) * 2021-07-05 2024-05-03 卫宁健康科技集团股份有限公司 Automatic test case generation method and device, electronic equipment and storage medium
CN113419964A (en) * 2021-07-14 2021-09-21 上海浦东发展银行股份有限公司 Test case generation method and device, computer equipment and storage medium
CN114388142A (en) * 2022-03-23 2022-04-22 成都瑞华康源科技有限公司 Value domain code mapping rapid processing method

Also Published As

Publication number Publication date
CN103365777B (en) 2015-12-02

Similar Documents

Publication Publication Date Title
CN105528294B (en) The method and system that a kind of interface testing use-case automatically generates
CN105677563B (en) A kind of integration testing sequence generating method based on SysML module maps
CN103365777A (en) Test case generation system and system
CN103699689B (en) Method and device for establishing event repository
CN103336760B (en) A kind of method and device based on reverse-engineering automatic generating software document
CN111460045A (en) Modeling method, model, computer device and storage medium for data warehouse construction
CN109344262A (en) Architectonic method for building up, device and storage medium
US20150039984A1 (en) Table format multi-dimensional data translation method and device
CN103914379B (en) Fault is automatically injected the method with fault detect and system thereof
CN103853843B (en) A method of based on across the security domain data concentration of master data Mapping implementation
Li et al. Assembly processes of waterbird communities across subsidence wetlands in China: A functional and phylogenetic approach
KR20170025454A (en) System and method for space-time analysis of social media data
CN103778239A (en) Multi-database data management method and system
JP6419667B2 (en) Test DB data generation method and apparatus
CN108520065A (en) Name construction method, system, equipment and the storage medium of Entity recognition corpus
CN109740947A (en) Expert's method for digging, system, storage medium and electric terminal based on patent data
CN103593182A (en) Method for reconfiguring software by using clustering mode
CN103810408B (en) Method and device for generating permission object
CN105573984B (en) The recognition methods of socio-economic indicator and device
CN103164532A (en) Classification and partitioning extract method of power grid model data and system
CN113157847B (en) Method and device for rapidly checking forest plant survey data
JP2010072876A (en) Rule creation program, rule creation method, and rule creation device
CN101527001A (en) Secret information detecting system based on expert system method
CN111667547B (en) GAN network training method, garment picture generation method and device and electronic equipment
CN103488693A (en) Data processing device and data processing method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB03 Change of inventor or designer information

Inventor after: Meng Qun

Inventor after: Hu Jianping

Inventor after: Qu Jianming

Inventor before: Qu Jianming

COR Change of bibliographic data

Free format text: CORRECT: INVENTOR; FROM: QU JIANMING TO: MENG QUN HU JIANPING QU JIANMING

C14 Grant of patent or utility model
GR01 Patent grant