An extension method based on semi-structured natural language EARS requirement template

By extending EARS, forming an EARS_NFR requirement template and using Xtext to build a framework, it solves the problem of insufficient description of non-functional requirements and user interaction requirements in the existing technology, realizes a broader and detailed requirement expression, and improves the generalization of the system Sex and applicability.

CN114692588BActive Publication Date: 2024-12-13GUANGXI NORMAL UNIV +1

Patent Information

Application Number
CN202210289035.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2024-12-13
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

The EARS in the prior art mainly describes the functional requirements of the system itself, lacks expression of non-functional requirements, and lacks the method of describing requirements for interaction with users and the outside world.

Method used

By extending the semi-structured natural language EARS, named EARS_NFR, adding and subdividing the requirements content, using Xtext to build a semi-structured natural language EARS_NFR requirement template, supporting descriptions of ubiquitous, event-driven, unwanted behavior, state-driven, and ok Select features, complex and parallel event requirements to deal with more different types of requirements, especially non-functional requirements.

Benefits of technology

It realizes the processing of more types of requirements, especially the description of non-functional requirements, improves the versatility and scope of application, and can more comprehensively express the interactive requirements of the system's performance, speed and other aspects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114692588B_ABST
    Figure CN114692588B_ABST
Patent Text Reader

Abstract

The present invention provides an extension method based on a semi-structured natural language EARS requirement template, the method comprising: extending the semi-structured natural language EARS and naming it EARS_NFR to obtain a semi-structured natural language EARS_NFR requirement template; constructing a framework of the semi-structured natural language EARS_NFR requirement template; checking and modifying the natural language requirements input into the framework so that the natural language requirements conform to the semi-structured natural language EARS_NFR requirement template. The present invention can handle more different types of requirements, especially non-functional requirements, and has strong versatility and a wide range of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to an expansion method based on a semi-structured natural language EARS requirement template. Background Art

[0002] In software engineering, a software requirements specification (SRS) is a document that defines the software and its functions. SRS is usually written in natural language (NL). NL is the most common way to communicate and record system requirements, but some problems may occur in NL requirement documents: such as ambiguity, vagueness, complexity, duplication, inappropriate requirements, untestability, etc. The requirement template defines the structure that requirements written in NL should have, so the requirements described in semi-structured natural language have the advantages of NL and a well-defined structure. In order to reduce or even eliminate these problems and improve the quality of requirement description, the semi-structured natural language EARS (simple Requirements Syntax) was introduced. However, EARS is mainly for the system itself and lacks a method for describing requirements that interact with users and the outside world.

[0003] The prior art proposes an advanced version of EARS (Advanced EARS, abbreviated as Adv-EARS), a semi-structured natural language grammar to describe functional requirements, thereby supporting the derivation of use cases and participants in the use case model. However, Adv-EARS only focuses on functional requirements and lacks the expression of non-functional requirements. Summary of the invention

[0004] The purpose of the embodiment of the present application is to provide an expansion method based on a semi-structured natural language EARS requirement template to address the deficiencies of the prior art, which can handle more different types of requirements, especially non-functional requirements, and has strong versatility and a wide range of applications.

[0005] The embodiment of the present application provides the following technical solution: an expansion method based on a semi-structured natural language EARS requirement template, comprising the following steps:

[0006] The semi-structured natural language EARS is expanded and named EARS_NFR to obtain the semi-structured natural language EARS_NFR requirement template;

[0007] Constructing a framework of the semi-structured natural language EARS_NFR requirement template;

[0008] The natural language requirements input into the framework are checked and modified so that the natural language requirements conform to the semi-structured natural language EARS_NFR requirement template.

[0009] Furthermore, Xtext is used to construct the framework of the semi-structured natural language EARS_NFR requirement template.

[0010] Furthermore, the requirements described by the semi-structured natural language EARS_NFR requirement template include: ubiquitous requirements, event-driven requirements, unwanted behavior requirements, state-driven requirements, optional feature requirements, complex requirements and parallel event requirements.

[0011] Furthermore, the process of using Xtext to construct the framework of the semi-structured natural language EARS_NFR requirement template includes:

[0012] According to the semi-structured natural language EARS_NFR requirement template, the Xtext grammerlanguage is used to describe it in the Xtext tool to automatically generate the framework XtextArtifacts of the semi-structured natural language EARS_NFR requirement template.

[0013] Furthermore, the process of checking and modifying the input natural language requirement specifically includes:

[0014] Check whether the input natural language demand conforms to the semi-structured natural language EARS_NFR demand template. If not, mark the natural language demand that does not conform to the semi-structured natural language EARS_NFR demand template as an error. The user modifies the demand statement according to the error mark until the natural language demand conforms to the semi-structured natural language EARS_NFR demand template.

[0015] Furthermore, in the process of checking whether the input natural language requirements conform to the semi-structured natural language EARS_NFR requirement template, the syntax in the input natural language requirements is highlighted and the keywords of the requirements are marked with colors.

[0016] Compared with the prior art, the beneficial effects that can be achieved by at least one of the above-mentioned technical solutions adopted in the embodiment of the present invention include at least the following: the embodiment of the present invention can handle more different types of requirements, especially non-functional requirements, and has strong versatility and a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1is a schematic diagram of a method flow of an embodiment of the present invention;

[0019] Figure 2 It is a partial schematic diagram of describing the EARS_NFR syntax using the Xtext tool in an embodiment of the present invention;

[0020] Figure 3 Schematic diagram of an apparatus according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0022] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments, and the technical scheme of the present invention will be clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0023] like Figure 1 As shown, an embodiment of the present invention provides a method for identifying a vehicle identification code, which mainly expands the semi-structured natural language EARS and names it EARS_NFR to obtain a semi-structured natural language EARS_NFR requirement template; uses Xtext to build a framework of the semi-structured natural language EARS_NFR requirement template; checks and modifies the natural language requirements input into the framework to make the natural language requirements conform to the semi-structured natural language EARS_NFR requirement template.

[0024] EARS requirements are mainly for the description of the requirements of the system itself, which is relatively simple and easy to use, and is mainly used in aircraft engine requirement specification documents. However, some requirements require interaction between humans and machines, and have certain requirements on performance, speed, etc. Therefore, the semi-structured natural language EARS is expanded through the embodiment of the present invention and named EARS_NFR. On the basis of EARS, the requirements content is increased and subdivided to meet the general requirements.

[0025] Xtext is a framework for developing programming languages ​​and domain-specific languages ​​(DSL). The framework allows the definition of the grammar of the language. Xtext includes a language infrastructure, a parser, a compiler, and a complete Eclipse-based integrated development environment.

[0026] The embodiment of the present invention is based on the semi-structured natural language EARS and has made further expansions. In order to be able to handle more different types of requirements, that is, to describe both functional requirements and non-functional requirements, and to be more general, a semi-structured language model framework is constructed using Xtext.

[0027] The embodiment of the present invention specifically includes the following steps:

[0028] Step 101, expand the semi-structured natural language EARS and name it EARS_NFR to obtain the semi-structured natural language EARS_NFR requirement template;

[0029] The semi-structured natural language EARS_NFR describes seven types of requirements, namely: ubiquitous requirements, event-driven requirements, unwanted behavior requirements, state-driven requirements, optional feature requirements, complex requirements, and parallel event requirements;

[0030] The specific requirements include the following:

[0031] (1) The general form is: optional preconditions and triggers, system / entity name, followed by modal verbs, then the system response, and a detailed description of the system response. The template format is:

[0032] <optional preconditions><optional trigger> the<system / entity name> shall / can / must<system / entity response> <details for the response>;

[0033] (2) Ubiquitous requirements describe the functions of the system / entity response that are always active. The template format is:

[0034] The<system / entity name> shall / can / must<system / entity response><detailsfor the response> ;

[0035] (3) Event-driven requirements describe that the system / entity will respond only when a triggering event occurs. The template format is: When<optional preconditions> <trigger>the<system / entity name>shall / can / must<system / entity response> <details for the response>;

[0036] (4) Unwanted behavior requirements describe an unexpected behavior, that is, the system's response if an error, failure, or deviation from the expected user behavior occurs. The template format is: If<optional preconditions> <trigger>,thenthe<system / entity name>shall / can / must<system / entity response> <details for theresponse>;

[0037] (5) State-driven requirements: describe the response of a system / entity when it is in a defined state. The template format is: While<in a specific state> the<system / entity name> shall / can / must<system / entity response> <details for the response>;

[0038] (6) Optional feature requirements describe the system response to a certain feature only. The template format is: While<feature is included> the<system / entity name> shall / can / must <system entityresponse> <details for the response>;

[0039] (7) Complex requirements are the system responses under two or more preconditions:

[0040] a) In a certain state, if a failure, interference, deviation from expected user behavior, or any unexpected behavior of the interactive system occurs, the system / entity response is triggered, expressed as While...,if..., and the template form is:

[0041] <While in a specific state> ,<if preconditions> ,the<system / entity name> shall / can / must<system / entity response> <details for the response>;

[0042] For example: While the system is operated in the first six months, if the user has access to the client PC, the system shall be available in 99% of the time;

[0043] b) When a trigger event is met, if there is a failure, interference, deviation from expected user behavior, or any unexpected behavior of the interactive system, the system / entity response is triggered, expressed as When..., if..., <whenpreconditions>,<if preconditions>,the<system / entity name>shall / can / must<system / entity response> <details for the response>;

[0044] c) In a certain state, when an event is triggered, the system / entity responds, which is represented by While..., when... The template form is:

[0045] <While in a specific state> ,<when preconditions> ,the <system entityname>shall / can / must<system / entity response> <details for the response>;

[0046] (8) Parallel event requirements: Event responses are connected using and / or. The template format is: <optionalpreconditions><optional trigger>The<system / entity name> shall response1 and / orresponse2.<optional preconditions><optional trigger> The <system entityname>shall <functionalitys> : <functionality1>and <functionality2>,

[0047] For example: The DBMS shall be located with the product on the same machine or located on a different machine on the computer network.

[0048] The display shall have two regions: left 2 / 3 of the display is graphical and right 1 / 3 of the display is a data table;

[0049] The detailed description of the system response includes:

[0050] a) When describing non-functional requirements such as safety and feasibility, describe the range between the two. For example, if the time period for system response needs to be limited, it is usually expressed as between...and... For example: The system shall be available for use between the hours of 8am and 6pm;

[0051] b) When describing non-functional requirements such as performance requirements, the frequency is expressed as "every" followed by time, and the rate is expressed as "within" followed by time or "no more than", "at least", "at most" followed by time. For example: The system shall refresh the display every 60 seconds. The recycled parts audit report shall be returned to the user within 10 seconds.

[0052] c) When interacting with the external environment. Describes the response of the system through a certain method or path, or the response activity of the system / entity is performed by someone, indicated by the keyword by, for example: The final version of the Systemshall successfully pass independent audit performed by a certified auditor;

[0053] d) Describe the source of data or events by adding the specific source after "from". For example, "The system shall display data from the Sync Matrix 1.0 and Exercise Management Tool 1.0 applications"; there are also keywords "in", "under", and "on" to describe the interaction with external connections.

[0054] e) When describing the purpose, use to / in order to / so that, for example, Where beneficiary is asmoker, the Checking of Under writing shall invoke Error Handler to set a high value premium.

[0055] f) Describes the requirement that multiple behaviors of some systems or other entities be executed in sequence, that is, one event can only be executed after one event is completed. It is represented by the keywords before and after, for example: "All users shall receive training before the system is deployed.".

[0056] Step 102: Use Xtext to construct the framework of the semi-structured natural language EARS_NFR requirement template. Figure 2 As shown, the following process is included:

[0057] 1.1、Model is the root node of the DSL model and the starting point of the parser. It contains several statements ReqDes that describe requirements.

[0058] 1.2. The requirement statement ReqDes is a requirement statement without preconditions UnconRequirement and a requirement statement with preconditions ConRequirement;

[0059] 1.3. The template for the requirement statement UnconRequirement without preconditions includes:

[0060] 1.3.1. The requirement name requirementname and the requirement statement without preconditions are separated by ":";

[0061] 1.3.2. Requirement statement without preconditions Requirement statement structure: system or entity name SysOrEntity + modal verb ModalVP + system response Response + response details DetailsForresponse (optional);

[0062] 1.4. The template of the requirement statement ConRequirement with preconditions includes:

[0063] 1.4.1. The requirement name requirementname and the requirement statement with preconditions are separated by ":";

[0064] 1.4.2. Requirement statement with preconditions Requirement statement structure: Precondition Condition + system or entity name SysName + modal verb ModalVP + system response Response + response details DetailsForresponse (optional);

[0065] 1.5. ModalVP has three types: "shall", "can" and "must", and they are expressed as keywords;

[0066] 1.6. There are 4 types of preconditions: ConWhen, ConWhile, ConWhere and ConIf;

[0067] 1.7, ConWhen, which represents the event-driven precondition, is composed of "When / when" as the keyword, followed by optional conditions and the trigger PreTrigger that triggers the event;

[0068] 1.8, ConIf, which indicates the precondition for the occurrence of unwanted behavior, uses "If / if..., then" as keywords, with unexpected behavior in the middle, including failures, interference, deviations from expected user behavior, and any unexpected behavior of the interactive system, triggering the response of the PreTrigger system;

[0069] 1.9. ConWhile, which indicates the state-driven precondition, uses "While / while / During / during" as the keyword, followed by a certain state State;

[0070] 1.10, ConWhere, which indicates the state-driven precondition, uses "Where / where" as the keyword, followed by a specific feature Feature;

[0071] 1.11. Details of system response DetailsForresponse, including two types of parallelrequirements and Details. Parallelrequirements describes the parallel functions of the same system / entity name, connected by keywords and / or. Details refines the response of the system, with general prepositions followed by words describing time, people, and events.

[0072] 2. Right click and run to generate Xtext Artifacts.

[0073] Step 103: Check and modify the natural language requirements input into the framework to make the natural language requirements conform to the semi-structured natural language EARS_NFR requirement template.

[0074] Check whether the input natural language requirement conforms to the semi-structured natural language EARS_NFR requirement template, that is, highlight the syntax of the input requirement statement, color the requirement elements, such as marking keywords with special colors, and mark the requirement statement errors that do not conform to the semi-structured natural language EARS_NFR requirement template. Content assist function, check whether the input natural language requirement description conforms to the EARS_NFR template, specifically including the following processes:

[0075] (1) Check whether the input natural language requirement description conforms to the EARS_NFR template;

[0076] (2) The keywords of the requirements are marked with colors, and errors are given for requirements that do not conform to the EARS_NFR template. Users can modify the requirement statements according to the error prompts until the requirements conform to the EARS_NFR template.

[0077] The comparison of the requirements described by the semi-structured natural language EARS requirement template and the semi-structured natural language EARS_NFR requirement template is shown in Table 1.

[0078] Table 1:

[0079]

[0080] like Figure 3 As shown, the embodiment of the present invention also provides an expansion device 200 based on a semi-structured natural language EARS requirement template, including: a requirement template generation module 201, a framework construction module 202 and a judgment module 203. The requirement template generation module 201 is connected in communication with the framework construction module 202. The requirement template generation module 201 is used to expand the semi-structured natural language EARS and name it EARS_NFR to obtain a semi-structured natural language EARS_NFR requirement template; the framework construction module 202 is used to use Xtext to construct a framework of the semi-structured natural language EARS_NFR requirement template; the framework construction module 202 is connected in communication with the judgment module 203. The judgment module 203 is used to check and modify the natural language requirements input into the framework so that the natural language requirements conform to the semi-structured natural language EARS_NFR requirement template.

[0081] The expansion device 200 based on the semi-structured natural language EARS requirement template of the embodiment of the present invention is further expanded on the basis of the semi-structured natural language EARS. In order to be able to handle more different types of requirements, that is, to describe both functional requirements and non-functional requirements, and to be more general, a semi-structured language model framework is constructed using Xtext.

[0082] The embodiment of the present invention further provides an electronic device. The electronic device of this embodiment may be a server. The electronic device provided by the embodiment of the present invention may execute the processing flow of the expansion method based on the semi-structured natural language EARS requirement template.

[0083] In addition, an embodiment of the present invention also provides a machine-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to implement the expansion method based on the semi-structured natural language EARS requirement template described in the above embodiment.

[0084] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0085] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit module may be implemented in the form of hardware or in the form of hardware plus software functional unit module.

[0086] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0087] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0088] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims. < / functionalitys> < / system> < / optionalpreconditions> < / details> < / system> < / details> < / whenpreconditions> < / details> < / details> < / system> < / details> < / details> < / trigger> < / details> < / trigger> < / details>

Claims

1. An extension method based on a semi-structured natural language EARS requirement template, characterized in that: The steps include: The semi-structured natural language EARS is expanded and named EARS_NFR to obtain the semi-structured natural language EARS_NFR requirement template; Constructing a framework of the semi-structured natural language EARS_NFR requirement template; Checking and modifying the natural language requirements input into the framework to make the natural language requirements conform to the semi-structured natural language EARS_NFR requirement template; Wherein, Xtext is used to construct the framework of the semi-structured natural language EARS_NFR requirement template; The requirements described by the semi-structured natural language EARS_NFR requirement template include: ubiquitous requirements, event-driven requirements, unwanted behavior requirements, state-driven requirements, optional feature requirements, complex requirements, and parallel event requirements; The process of using Xtext to construct the framework of the semi-structured natural language EARS_NFR requirement template includes: According to the semi-structured natural language EARS_NFR requirement template, the Xtext grammer language is used to describe it in the Xtext tool, and the framework XtextArtifacts of the semi-structured natural language EARS_NFR requirement template is automatically generated; The process of checking and modifying the input natural language requirements specifically includes: Check whether the input natural language requirement conforms to the semi-structured natural language EARS_NFR requirement template. If not, mark the natural language requirement that does not conform to the semi-structured natural language EARS_NFR requirement template as an error, and the user modifies the requirement statement according to the error mark until the natural language requirement conforms to the semi-structured natural language EARS_NFR requirement template; In the process of checking whether the input natural language requirements conform to the semi-structured natural language EARS_NFR requirement template, the syntax in the input natural language requirements is highlighted and the keywords of the requirements are marked with colors.

Citation Information

Patent Citations

  • Safety requirement modeling method applicable for avionics system

    CN103853871A

  • Method for obtaining software security requirement by using module security analysis

    CN104899043A

Cited By

  • A Chinese Requirements Standardization Approach Based on Large Language Model and EARS Paradigm

    CN120704646B