Sign In to Follow Application
View All Documents & Correspondence

A Device And Method For Automatic Generation Of Test Case Specifications From Requirement Specifications

Abstract: A DEVICE AND METHOD FOR AUTOMATIC GENERATION OF TEST CASE SPECIFICATIONS FROM REQUIREMENT SPECIFICATION Abstract The present invention device 100 comprises a controller 102, characterized in that, the controller 102 is configured to receive requirement specifications 104, characterized in that, the controller 102 extract raw test intents 106 from the requirement specifications 104 using sentence processing modules 108. Using the reconstruction module 110, the original test intents 112 are reconstructed using a sentence similarity module 118 which is stored in repository 116. The reconstructed original test intents 112 are compared with raw test intents 106 using sentence similarity module 118 and generates a test case specification 120. The solution in the present invention uses rank-based retrieval based on semantic similarity score to arrive at correct test specifications unlike the usual query-based retrieval of information from Knowledge Graph (KG). The device 100 and method automates the process of generating test specifications 120 from requirements with multiple sources of domain knowledge. Figure 1

Get Free WhatsApp Updates!
Notices, Deadlines & Correspondence

Patent Information

Application #
Filing Date
28 June 2023
Publication Number
2/2025
Publication Type
INA
Invention Field
COMPUTER SCIENCE
Status
Email
Parent Application

Applicants

Bosch Global Software Technologies Private Limited
123, Industrial Layout, Hosur Road, Koramangala, Bangalore – 560095, Karnataka, India
Robert Bosch GmbH
Postfach 300220, 0-70442, Stuttgart, Germany

Inventors

1. Karthikeyan Ponnalagu
103, Vasudhaa Raja Gruha Apartments, 2nd main, 4th cross, HSR Layout 7th sector, Bangalore -560068, Karnataka, India
2. Atul Anil Gohad
# 217, Shilpitha Regalia, 5th Main Road, Malleshpalya, Bangalore 560075, Karnataka, India
3. Vidhya Murali
G008, Niranjan Central Apartment, No.11, Narayanappa Garden, New Gurupanapalya, Thaverekere, Bangalore 560029, Karnataka, India

Specification

Description:Complete Specification:
The following specification describes and ascertains the nature of this invention and the manner in which it is to be performed.

Field of the invention:
[0001] The present invention relates to a device and method for the automatic generation of test case specifications from requirement specifications.

Background of the invention:
[0002] In current practice, test cases are manually derived from requirements. Manually deriving test cases from requirements is costly and time-consuming. The generation of test specifications is more centered on knowledge graphs created from information sources such as function specification documents or designed models, etc. This technique follows a query-based retrieval mechanism and there is no retrieval mechanism based on the test specifications. The test case specifications 120 are generated randomly, and a lot of effort are required to rank them based on the relevancy of the requirement. Therefore, there is strong motivation to develop an approach for automated test case generation from requirements.

[0003] According to a prior art CN113900954, a method, and apparatus using a knowledge map for test recommendation. The invention relates to a test case recommendation method and device using a knowledge graph. The method comprises the steps: acquiring a target test demand; acquiring a target test item and a target test case corresponding to the target test demand according to a pre-established knowledge graph, wherein the knowledge graph is used for recording node relations among entity nodes, and the entity nodes comprise test requirements, test items, and test cases; and determining a recommendation result according to the target test item and the target test case. According to the method and the device, starting from the target test requirement, the target test item and the target test case which have the node relationship with the target test requirement can be obtained, so that the obtained recommendation result can have a relatively high matching degree with the target test requirement.

Brief description of the accompanying drawings:
[0004] An embodiment of the disclosure is described with reference to the following accompanying drawings,
[0005] Fig. 1 illustrates a block diagram of a device to automate the generation of test case specifications from a requirement specification, according to an embodiment of the present invention.
[0006] Fig. 2 illustrates a flow diagram of a method for automating the generation of test case specifications from a requirement specification, according to the present invention.

Detailed description of the embodiments:
[0007] Fig. 1 illustrates a block diagram of a device for automating the generation of test specification from requirement specification, according to an embodiment of the present invention. The device 100 comprises a controller 102 configured to receive requirement specifications 104, characterized in that, controller 102 is configured to extract raw test intents 106 from the requirement specifications 104 using sentence processing modules 108. By using the reconstruction module 110, controller 102 reconstructs the original test intent 112 using external/existing test specifications 114 stored in a repository 116. The controller 102 compares the reconstructed original test intent 112 with the raw test intent 106 using a sentence similarity module 118 and generates test case specification 120. The requirement specifications 104 is a set of requirements for multiple components or systems or sub-systems or functions of a vehicle or other machines. These are generally provided in a document for testing and verification. The generated test case specification is displayed as an output on a display screen of the device 100.

[0008] According to an embodiment of the present invention, for the reconstruction of the original test intent 112, the controller 102 is configured to access repository 116 and extract domain-specific test intents 122. After extracting domain-specific test intents 122, controller 102 creates a triplet 124 for each test intent. Each of the triplets 124 comprises of pre-condition, an action, and a post-condition. Once the triplet 124 is created, the controller 102 refines the triplet 124 using conversion rule 126 which is either stored in a memory element of the controller 102 or in the repository 116. Further, controller 102 generates a natural language description 128 for refined triplet using a signal sheet 130 which is available in the repository 116.

[0009] According to the present invention, the signal sheet 130 refers to a descriptive phrase or the natural language description 128 of the triplet 124. For example, the descriptive phrase for the triplet 124 FId_BkPrssEr is Function id to check communication for Brake Pressure Signal. In the conversion rule 126, triplet 124 created out of the test intents is refined. In the refinement, the unnecessary word or command from the triplet 124 is removed, for example, in this triplet 124 (FId_BkPrssEr.5 = 1), after the removal of the unnecessary command or word it becomes 'FId_BkPrssEr=1' so that it is easy to extract the phrase using signal sheet 130.

[0010] According to the present invention, test intent is reconstructed with a corresponding description from a refined triplet using the generated natural language description 128. The generated test intents are ranked using the sentence similarity module 118 and the ranked test intents are mapped with the raw test intents 106. The sentence similarity module 118 can be from a group of Kernel-based models, Latent semantic analysis, word attention models, transform-based models, feature-based models, and the like. The Kernel-based model finds patterns in text data, thus enabling the detecting of similarity between text snippets (suitable for most of the patterns of writing). The Latent Semantic Analysis leverages word co-occurrence matrixes, Singular Value Decomposition (SVD). The Word-Attention Model provides Attention Constituency Vector Tree leveraging the importance of key domain words. The Transformer Based Model captures the semantic properties of words in the embeddings. The Feature-Based Methods calculate similarity as a function of properties of the recognized entities, leveraging the underlying ontology.

[0011] According to the present invention, the controller 102 is provided with necessary signal detection, acquisition, and processing circuits. The controller 102 is a control unit that comprises memory elements such as Random Access Memory (RAM) and/or Read Only Memory (ROM), Analog-to-Digital Converter (ADC) and a Digital-to-Analog Converter (DAC), clocks, timers, counters and at least one processor (capable of implementing machine learning) connected with each other and to other components through communication bus channels. The memory element is pre-stored with logic or instructions or programs or applications or modules/models and/or threshold values, which is/are accessed by at least one processor as per the defined routines. The internal components of Controller 102 are not explained as being state of the art, and the same must not be understood in a limiting manner. The controller 102 may also comprise communication units to communicate with an external computing device such as the cloud, a remote server, etc., through wireless or wired means such as Global System for Mobile Communications (GSM), 3G, 4G, 5G, Wi-Fi, Bluetooth, Ethernet, serial networks, and the like. The computing module 110 is implementable in the form of a System-in-Package (SiP) or System-on-Chip (SOC) or any other known types.

[0012] According to the present invention, the working of device 100 is envisaged. Assume a requirement specification 104 is received in the form of PDF or other readable formats or documents from an Original Equipment Manufacturer (OEM). There are several requirements related to different components of vehicle mentioned in the requirement specification 104 such as pre-condition, action, post condition, etc. However, for explanation purpose, requirement specifications 104 related to brake pressure is considered for explanation. The raw requirement for the brake pressure is “If a function to check communication for brake pressure signal is 1 and brake pressure is greater than voltage threshold above which signal range check in the brake cylinder max error is reported for Com_BkPrO then FC_BkPrssoSM will be set to 1”. From the above requirement specifications 104, the raw intents 106 are extracted using sentence processing modules 108, for example, the test intent is 'Test Intents': [{'Component': 'Requirement_1.1', 'Value': 'If Fid to check communication for Brake Pressure Signal is 1 and Brake Pressure is greater than Voltage threshold above which Max error is reported for Com_ BkPrO then DFC_ BkPrssoSM will be set to 1.', 'Condition': 'IF-REQUIREMENT', 'NER-Labels': 'NA'},{'Component': 'Pre-condition_1', 'Value': Fid to check communication for Brake Pressure Signal is 1','Condition': 'IF-PRE-CONDITION', 'NER-Labels': "[('FId_BkPrssEr', 'signal'), ('is', 'othe'), ('1', 'value')]"},
{'Component': 'Pre-condition_2', 'Value': Brake Pressure is greater than Voltage threshold above which Max error is reported for Com_ BkPrO’, 'Condition': 'IF-PRE-CONDITION', 'NER-Labels': "[('Brake Pressure', 'Signal'), ('is', 'othe'), ('greater than', 'math'), ('BrkP_BkPrssoSM_C', 'signal')]"},{'Component': 'Post-condition_1', 'Value': 'DFC_BkPrssoSM will be set to 1', 'Condition': 'IF-POSTCONDITION', 'NER-Labels': "[('DFC_BkPrssoSM', 'signal'), ('will be set to', 'othe'), ('1', 'value')]"}]. Once the extraction is done, the original test intents 112 are reconstructed using existing test case specifications 114 stored in the repository 116. Reconstruction involves accessing the repository 116 and extract domain specific test intents 122 and creating the triplet 124 for each intent, triplet 124 comprises of pre-condition, an action, and a post- condition. Example for the triplet 124 is:
Statement Pre-condition Action Post condition
If Fid to check communication for Brake Pressure Signal is 1 and Brake Pressure is greater than Voltage threshold above which Max error is reported for Com_ BkPrO then DFC_BkPrssoSM will be set to 1. (FId_BkPrssEr5 = 1), ((VK_SC != 1) and (VP_SC != 0) ) (((Com_ BkPrO)) <= BrkP_ BkPrssoSM _C) , wait(@) , (((Com_ BkPrO)) > BrkP_ BkPrssoSM) , wait(debdef) DFC_BkPrssoSM.6 == 1

If Fid to check communication for Brake Pressure Signal is 1 and Brake Pressure is less than Voltage threshold below which Min error is reported for Com_ BkPrO then DFC_BkPrssoSM will be set to 1. (FId_BkPrssEr5= 1), ((VK_SC != 1) and (VP_SC != 0) (((Com_ BkPrO)) >= BrkP_BkPrssoSMI_C) , wait(@) , (((Com_BkPrO)) < BrkP_BkPrssoSMI_C) , wait(debdef) DFC_BkPrssoSMI.6 == 1

[0013] Once the triplet 124 is generated, it is refined using conversion rule 126. Upon refinement, unnecessary words, or commands from the triplet 124 get removed, for example after refinement the triplet becomes from FId_BkPrssEr.5 = 1 to FId_BkPrssEr=1. Once the refinement of the triplet 124 is done, natural language description 128 for the refined triplet is generated, for e.g., for triplet 124 FId_BkPrssEr.5 = 1, the natural language description 128 is Fid to check communication for Brake Pressure Signal. Finally, the test intent is reconstructed from the refined triplet, for e.g., “Brake Pressure (P1) is greater than Voltage threshold above which Max error is reported for Brake Pressure (P1 ) max error for brake pressure signal is set”. Once the reconstruction is done, using the sentence similarity module 118, generated test intent is ranked, and the generated test intent is mapped with the raw test intent 106 and the ranked generated test intent is displayed to the user on the display screen of the device 100. Alternatively, the ranked results are shown the user for selection.

[0014] According to an embodiment of the present invention, the device 100 is at least one chosen from a group of devices 100 comprising a smartphone, a computer and, a cloud. In an embodiment, the cloud receives the requirement specifications 104 document from the smartphone or the computer, processes internally and gives output back to the smartphone or the computer. Alternatively, the smartphone or the computer together with the cloud performs the processing and gives the output.

[0015] Fig. 2 illustrates a flow diagram of a method for automating the generation of test specifications from requirement specification, according to the present invention. The method comprises a plurality of steps of which step 202 comprises receiving requirement specifications 104 from a user either in the form of text or a document. The requirement specification 104 is received at a user interface in device 100. The method is characterized by step 204 which comprises extracting, by the controller 102, raw test intents 106 from the requirement specifications 104 using sentence processing modules 108 such as Natural Language Processing (NLP). A step 206 comprises reconstructing, by the controller 102, original test intent 112 by the reconstruction module 110 using existing test specifications 114 stored in repository 116. A step 208 comprises comparing, by the controller 102, the reconstructed test intents 112 with the raw test intent 106 using a sentence similarity module 118 and generating the test case specification 120. The method for automating the generation of test cases specification 120 is performed using device 100 having the controller 102.

[0016] According to the method, the step 206 further comprises multiple steps of which a step 210 comprises accessing, by the controller 102, the repository 116 and extracting domain specific test intents 122. Step 212 comprises creating, by the controller 102, triplet 124 for each test intent. The triplet 124 comprises a pre-condition, an action, and a post-condition. Step 214 comprises refining, by the controller 102, the triplet 124 using a conversion rule 126, and a step 216 comprises generating, by the controller 102, the natural language description 128 for the refined triplet using the signal sheet 130 available in the repository 116. A step 218 comprises reconstructing, by controller 102, test intent from the refined triplet with the corresponding description.

[0017] According to the method, the signal sheet 130 refers to descriptive phrase or the natural language description 128 of the triplet 124. For example, the descriptive phrase for the triplet FId_BkPrssEr is Fid to check communication for the Brake Pressure Signal. In the conversion rule 126, triplet 124 created out of the test intents is refined. In the refinement, the unnecessary word or command from the triplet 124 is removed, for example, in this triplet 124 (FId_BkPrssEr.5 = 1), ((VK_SC! = 1) and (VP_SC! = 0)), there are few words or commands which is required to be removed, so that it is easy to extract the phrase using signal sheet 130.

[0018] According to the method, the step 208 further comprises the ranking of the generated test intents, the generated test intents are ranked using the sentence similarity module 118 and the ranked test intents are mapped with the raw test intents 106. Finally, the generated test intents are formed to create the test case specifications 120. The sentence similarity modules 118 is at least one from a group of Kernel based models, Latent semantic analysis, word attention models, transform-based models, feature based models, and the like.

[0019] According to the present invention, the sentence similarity module 118 is selected from a group of kernel-based modules, latent semantic analysis, word attention model, transform based models, etc. The method for automating generation of test case specifications 120 is performed by using controller 102, controller 102 is at least one from a group of smartphones, computer, and the cloud.

[0020] According to the present invention, the method comprises exhaustive graph search-based generation of all logically valid test specifications from Individual Knowledge Graphs (KG), thus arriving at minimalistic search space/ correct sub-graph. The repository 116 is either a single database or collection or access to different/multiple corpus and/or databases. For example, domain knowledge is captured correctly in the graphs from multiple domain sources wherever possible (Text, ASCET, Code). Further, the test specifications (complete/partial based on source) from different KG sources are merged. The domain ontologies play a role here to combine the information from the individual KGs. The test specifications are validated either manually or based on rules, and it is ensured that the test specifications are logically correct and complete.

[0021] The method then comprises using semantic similarity scores and other information retrieval techniques, to identify the top ranked test intents for every incoming requirement/test intent. If the generated test specification is as expected the user can take it forward directly. If it is incomplete/in correct, the user can make the necessary corrections and include in the repository 116.

[0022] According to the present invention, a device 100 for graph traversal-based extraction/generation of test specifications from domain knowledge graphs for requirements mapping using a top-K ranking approach is provided. The device 100 method automates the process of generating test specifications from requirements with multiple sources of domain knowledge. The present invention provides a solution where a pool/repository 116 of test specifications is formed based on an exhaustive search from multiple knowledge graphs, and reconstruction of original test intents 112 are done from the same. The original test intents 112 reconstructed are subjected for similarity (ensemble models, Information Retrieval (IR) techniques) against raw intents from requirement specifications 104 and are given a ranked order to know the top matched correct test specification.

[0023] The device 100 method elevates the syntactic representations to schematic and semantic representations by encompassing the information from multiple sources of domain knowledge. This eliminates the dependency on the availability of complete information from a single source of domain corpus (text, source code) as a repository 116 of test specifications from all the available knowledge graphs is created and used. In addition, the solution in the present invention uses rank-based retrieval based on semantic similarity score to arrive at correct test specifications, unlike the usual query-based retrieval of information from Knowledge Graph (KG).

[0024] It should be understood that the embodiments explained in the description above are only illustrative and do not limit the scope of this invention. Many such embodiments and other modifications and changes in the embodiment explained in the description are envisaged. The scope of the invention is only limited by the scope of the claims.

, Claims:We claim:
1. A device (100) to automate generation of test case specifications 120 from a requirement specification, said device (100) comprises a controller (102), said controller (102) configured to:
a. receive requirement specifications (104), characterized in that
b. extract raw test intents (106) from said requirement specifications (104) using sentence processing modules (108);
c. reconstruct, by a reconstruction module (110), original test intents (112) using existing test specifications (114) stored in a repository (116), and
d. compare said reconstructed original test intents (112) with said raw test intents (106) using a sentence similarity module (118) and generate a test case specification (120).

2. The device (100) as claimed in claim 1, wherein for the reconstruction of said original test intent (112), said controller (102) configured to:
a) access said repository (116) and extract domain-specific test intents (122);
b) create a triplet (124) comprising a pre-condition, an action, and a post-condition for each of extracted domain-specific test intents;
c) refine said triplet (124) using a conversion rule (126) stored in a memory element of said controller (102);
d) generate a natural language description (128) for said refined triplet using a signal sheet (130) available in said memory element repository (116);
e) reconstruct test intent from said refined triplet with the corresponding description using said generated natural language description (128).

3. The device (100) as claimed in claim 1, wherein for generation of said new test specification, said controller (102) configured to:
a) rank said generated test intents based on an outcome of said sentence similarity module (118), and
b) map said generated test intent with said raw test intent 106 according to said ranks.

4. The device (100) as claimed in claim 1, wherein said sentence similarity module (118) comprises at least one from the group of Kernel-based models, Latent Semantic Analysis, Word Attention Models, transform-based models, Feature-based models, and the like.

5. The device (100) as claimed in claim 1is at least one chosen from a group of devices (100) comprising a smartphone, a computer, and a cloud.

6. A method for automating the generation of test case specifications 120 from a requirement specification, said method performed by a controller 102 and comprising the steps of:
a. receiving requirement specifications, characterized by,
b. extracting raw test intents 106 from said requirement specifications using sentence processing modules (108);
c. reconstructing original test intents (112) using existing test specifications (114) stored in a repository (116);
d. comparing said reconstructed original test intents (112) with said raw test intents 106 using a sentence similarity module (118) and generating a test case specification (120).

7. The method as claimed in claim 6, wherein said step of reconstructing original test intent (112) comprises:
a. accessing said repository and extracting domain specific test intents;
b. forming a triplet (124) comprising a pre-condition, an action, and a post condition for each of said domain specific test intent extracted from said repository.
c. refining said triplet (124) using a conversion rule (126) stored in a memory element of said controller (102).
d. generating a natural language description (128) for said refined triplet using a signal sheet (130) available in said repository (116), and
e. reconstructing test intent from said refined triplet with the corresponding description from said natural language description (128).

8. The method as claimed in claim 6, wherein said step of generating the test case specification 120 after comparison comprises:
a) ranking said generated test intent based on an outcome of said sentence similarity module 118, and
b) mapping said generated test intent with the raw test intent 106 based on the ranks and generating said test case specification 120.

9. The method as claimed in claim 6, wherein said sentence similarity module 118 is at least one selected from a group comprising Kernel-based models, Latent Semantic Analysis, Word Attention Models, transform-based models, Feature-based models, and the like.

10. The method as claimed in claim 6 is performed by using a controller 102, wherein said controller 102 is at least one from a group comprising a smartphone, a computer, and a cloud.

Documents

Application Documents

# Name Date
1 202341043210-POWER OF AUTHORITY [28-06-2023(online)].pdf 2023-06-28
2 202341043210-FORM 1 [28-06-2023(online)].pdf 2023-06-28
3 202341043210-DRAWINGS [28-06-2023(online)].pdf 2023-06-28
4 202341043210-DECLARATION OF INVENTORSHIP (FORM 5) [28-06-2023(online)].pdf 2023-06-28
5 202341043210-COMPLETE SPECIFICATION [28-06-2023(online)].pdf 2023-06-28