KR101291817B1 - Test case generating system and method based on requirements model - Google Patents

Test case generating system and method based on requirements model Download PDF

Info

Publication number
KR101291817B1
KR101291817B1 KR1020120044216A KR20120044216A KR101291817B1 KR 101291817 B1 KR101291817 B1 KR 101291817B1 KR 1020120044216 A KR1020120044216 A KR 1020120044216A KR 20120044216 A KR20120044216 A KR 20120044216A KR 101291817 B1 KR101291817 B1 KR 101291817B1
Authority
KR
South Korea
Prior art keywords
test case
model
coverage
input
state
Prior art date
Application number
KR1020120044216A
Other languages
Korean (ko)
Inventor
김장복
유기원
박현상
최경희
정기현
Original Assignee
비티에스테크놀로지스(주)
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 비티에스테크놀로지스(주) filed Critical 비티에스테크놀로지스(주)
Priority to KR1020120044216A priority Critical patent/KR101291817B1/en
Application granted granted Critical
Publication of KR101291817B1 publication Critical patent/KR101291817B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware
    • G06F11/3652Software debugging using additional hardware in-circuit-emulation [ICE] arrangements
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/317Testing of digital circuits
    • G01R31/3181Functional testing
    • G01R31/3183Generation of test inputs, e.g. test vectors, patterns or sequences
    • G01R31/318307Generation of test inputs, e.g. test vectors, patterns or sequences computer-aided, e.g. automatic test program generator [ATPG], program translations, test program debugging
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/317Testing of digital circuits
    • G01R31/3181Functional testing
    • G01R31/3183Generation of test inputs, e.g. test vectors, patterns or sequences
    • G01R31/318314Tools, e.g. program interfaces, test suite, test bench, simulation hardware, test compiler, test program languages
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/317Testing of digital circuits
    • G01R31/3181Functional testing
    • G01R31/3183Generation of test inputs, e.g. test vectors, patterns or sequences
    • G01R31/318342Generation of test inputs, e.g. test vectors, patterns or sequences by preliminary fault modelling, e.g. analysis, simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines

Abstract

PURPOSE: A requirement model based test case automatic generation system and a method thereof are provided to generate a test case from a standardized requirement model which describes a requirement of an embedded software in a standardized way. CONSTITUTION: A test case generation tool (110) generates a test case by using a coverage target manager (120), a model state tree manager (130), an input generator (140), and a model simulator (150) according to a test case generation algorithm. The coverage target manager generates a coverage target from a model according to a coverage reference which a user selects and confirms whether the coverage target is achieved or not in a test case generation process. The model state tree manager makes and manages a state tree in order to visit every corner of a requirement model. The input generator generates a value to be applied according to an end port of a necessary system when finding the coverage target in a test case generation algorithm. The model simulator simulates a model in order to use a dynamic data analysis technique. A test case DB (160) stores the generated test case. [Reference numerals] (110) Test case generation tool (test case generation main algorithm); (120) Coverage target manager; (130) Model state tree manager; (140) Input generator; (150) Model simulator; (160) Test case DB

Description

요구사항 모델 기반 테스트 케이스 자동 생성 시스템 및 방법{TEST CASE GENERATING SYSTEM AND METHOD BASED ON REQUIREMENTS MODEL}System and method for automatic generation of requirement model-based test cases {TEST CASE GENERATING SYSTEM AND METHOD BASED ON REQUIREMENTS MODEL}

본 발명은 임베디드 시스템의 자동 테스트 케이스 생성 기술에 관한 것으로, 더욱 상세하게는 임베디드 소프트웨어의 요구사항을 정형적(Formal)으로 기술한 정형 요구사항 모델로부터 테스트 케이스를 표준화된 방법으로 생성하기 위한 자동 테스트 케이스 생성 시스템 및 방법에 관한 것이다.
The present invention relates to an automatic test case generation technology of an embedded system, and more particularly, an automatic test for generating test cases in a standardized manner from a formal requirement model that describes the requirements of an embedded software formally. It relates to a case generation system and method.

일반적으로, 자동차, 중공업 장비, 가전제품 등과 같은 다양한 전장품(임베디드 시스템)을 개발하는 프로세스에서, 테스트 단계는 제품의 품질을 보장하기 위해서 필수적으로 요구되는 프로세스이다. 이러한 테스트 단계는 여러 단계를 걸쳐서 이루어지는데, 보통 4 단계 정도 걸쳐서 이루어진다. 먼저, 제 1 단계는 소프트웨어와 하드웨어 개발시 단위 테스트 등을 수행하는 것으로, 전장품의 특성상 하드웨어와 소프트웨어를 동시에 개발하며, 각 개발 부서에서 소프트웨어 자체 및 하드웨어 자체에 대한 테스트를 수행하는 것이다. 제 2 단계는 전장품 단위 테스트로서, 하드웨어에 소프트웨어를 설치하여, 전장 단위로 테스트를 수행한다. 이때 테스트를 위한 입/출력은 하드웨어 입/출력 포트를 이용한다. 제 3 단계는 통합 테스트로서 자동차나 중공업 장비 등은 여러 전장품과 기계장비가 개별적으로 개발되어, 조립되어 하나의 완성품이 만들어지므로, 이러한 여러 부품들을 조립하여 테스트하는 단계이다. 따라서 개발 전장품이 전체적으로 합쳐졌을 때 정상적인 기능을 수행하는지 테스트한다. 제 4 단계는 전수 테스트로서, 전수 테스트는 보통, 제품 생산 단계에서 수행하는 테스트로서, 아주 기본적인 기능들을 살펴봄으로써, 조립이나 컴포넌트 오류로 인한 품질 문제를 찾기 위해서 수행한다.In general, in the process of developing various electronic products (embedded systems) such as automobiles, heavy industry equipment, household appliances, etc., the testing step is an essential process to ensure the quality of the product. This test step is done in several stages, usually four stages. First, the first step is to perform unit tests during software and hardware development, and to develop hardware and software at the same time due to the characteristics of the electronic device, and to test the software itself and the hardware itself in each development department. The second stage is the electrical equipment unit test, in which software is installed on the hardware, and the electrical test is performed on the electrical unit. In this case, the input / output for the test uses a hardware input / output port. The third stage is the integrated test, in which automobiles and heavy equipment are developed and assembled separately, and a single finished product is produced. Therefore, these components are assembled and tested. Therefore, we test that the development electronics perform their normal functions when combined. The fourth step is the full test, which is usually performed during the production stage, to look at the very basic functions to look for quality problems due to assembly or component errors.

한편, 테스트를 수행하기 위해서는, 각 단계별 목적에 맞는 테스트 케이스를 생성하는 것이 중요하다. 특히, 총 4단계 중, 해당 기술과 가장 적합한 테스트 단계는 제 2 단계이며, 제 3 단계 역시 활용 가능하다. 전장품 단위 테스트에서는 반드시 해당 전장품이 처음 기획한 요구사항 대로 구현되었는지 확인하여야 한다.On the other hand, in order to perform the test, it is important to create a test case for each step purpose. In particular, of the four stages, the most suitable test stage with the technology is the second stage, and the third stage can also be utilized. The electronics unit test must ensure that the electronics are implemented as originally planned.

종래에 알려진 자동 테스트 케이스 생성 방법으로는 등록번호 제10-0709964호로 등록된 자동 테스트 케이스 생성 방법 및 시스템이 있는데, 종래의 자동 케이스 생성 시스템은 변환규칙에 따라 판독 가능한 데이터로 표준 SDL을 변환하는 SDL 변환모듈과, 변환된 SDL을 분석하고 검증하여 그 커버리지를 계산하는 커버리지 분석모듈과, 커버리지 분석모듈의 분석 및 검증결과에 따라 변환된 SDL에 대응하는 표 결합 표기법 형식의 테스트 케이스를 생성하는 테스트 케이스 생성모듈로 이루어져 통신시스템에 사용되는 테스트 케이스를 생성하였다.Conventionally known automatic test case generation methods include an automatic test case generation method and system registered under registration No. 10-0709964. The conventional automatic case generation system converts a standard SDL into readable data according to a conversion rule. A test case for generating a test module in a table combining notation format corresponding to the converted SDL according to the analysis module and the result of analysis and verification of the coverage module; It consists of a generation module to generate a test case used in the communication system.

여기서, 테스트 케이스라는 것은 입력과 그에 상응하는 예상 출력을 시간 순서대로 나열한 것을 나타낸다. 따라서 테스트 케이스는 테이블 형태로 표현할 수 있다. 예를 들면, 다음 표1과 같이 세로축(열)은 시간을, 가로축(칼럼)은 입력 변수와 출력 변수로 표현하고, 그에 상응하는 값을 표현하는 식으로 나타난다. 전장품 단위 테스트는 보통 블랙박스 형태로 수행하므로 입력과 출력 변수는 실제 ECU의 입/출력에 대응되는 것으로서, 요구사항 모델에만 사용되는 내부 변수들은 사용할 수 없다.Here, a test case refers to a sequence of inputs and their corresponding expected outputs. Therefore, test cases can be represented in a table form. For example, as shown in Table 1, the vertical axis (column) represents time, the horizontal axis (column) represents input variables and output variables, and the corresponding values are represented. The electronic unit test is usually performed in the form of a black box, so the input and output variables correspond to the input and output of the actual ECU. Internal variables used only for the requirements model cannot be used.

Time(msec)Time (msec) I1 I 1 I2 I 2 I3 I 3 O1 O 1 00 00 00 00 00 100100 1One 00 00 11001100 1One 1One 00 20002000 1One 1One 00 1One 30003000 1One 1One 1One 1One 31003100 1One 1One 1One 00

따라서 전장품 단위 테스트에서 수행하여야 하는 테스트 케이스는 테스트 성공을 결정하는 주요한 요소이다. 따라서 테스트 케이스를 표준화된 방법으로 목적에 맞게 정교하게 만들 수 있어야만 한다. 특히 전장품 단위 테스트에서 사용되는 테스트 케이스는 다음의 항목을 만족해야 한다. 첫째, 전장품 단위 테스트에서는 기본적으로 요구사항에 기술되어 있는 항목들이 정확하게 구현되었는지를 모두 확인하여야 하기 때문에, 요구사항을 기초로 테스트 케이스를 생성해야 한다. 둘째, 테스트 케이스는 정형화되고, 표준화된 방법으로 만든 테스트 케이스 뿐만 아니라, 엔지니어의 경험에 의한 테스트 케이스가 동시에 필요하다. 셋째, 표준화된 방법으로 만든 테스트 케이스는 정량화가 가능하여야 테스트 결과의 신뢰성이 높아진다.As a result, the test cases that need to be performed in electronics unit tests are the key to determining test success. Therefore, test cases must be able to be elaborated for the purpose in a standardized way. In particular, test cases used in electronic unit tests must satisfy the following items: First, in the unit test of the electronics, the test case must be generated based on the requirements because basically all the items described in the requirements must be checked to ensure that they are correctly implemented. Second, test cases need not only test cases made by formalized and standardized methods, but also test cases with the experience of engineers. Third, test cases made by standardized methods need to be quantified to increase the reliability of test results.

본 발명은 개발된 임베디드 시스템에서 전장품 단위나 통합 테스트에 적용할 수 있는 블랙박스 테스트를 위하여 제안된 것으로, 본 발명의 목적은 일반적인 정형 요구사항 모델(특히 Matlab Simulink/Stateflow와 도형화된 시스템 요구사항)로부터 커버리지 기반으로 테스트 케이스를 자동으로 생성하기 위한 요구사항 모델 기반 테스트 케이스 자동 생성 시스템 및 방법을 제공하는 것이다.The present invention is proposed for a black box test that can be applied to the electronics unit or integrated test in the developed embedded system. The object of the present invention is to provide a general formal requirements model (especially Matlab Simulink / Stateflow and graphical system requirements). The present invention provides a system and method for automatically generating a requirement model based test case for automatically generating test cases based on coverage.

본 발명의 다른 목적은 Simulink/Stateflow나 도형화된 시스템 요구사항을 다른 형태로 변환하지 않고, 해당 요구사항의 내부 로직을 바로 분석하여 테스트해야 하는 항목들을 커버리지 기법을 이용하여 분석하고, 분석한 항목을 만족하기 위하여 인가하여야 하는 외부 입력을 시간 순서로 추출하고, 이때의 출력을 함께 추출하는 요구사항 모델 기반 테스트 케이스 자동 생성 시스템 및 방법을 제공하는 것이다.Another object of the present invention is to analyze and analyze the items that need to be tested by analyzing the internal logic of the requirements by using a coverage technique, without converting Simulink / Stateflow or graphical system requirements into other forms. The present invention provides a system and method for automatically generating a requirement model based test case for extracting an external input to be applied in order of time and extracting an output at this time.

이렇게 본 발명에 따라 생성된 테스트 케이스는 개발된 임베디드 시스템이 개발 초기에 구상한 요구사항대로 구현되었는지 확인하기 위하여, 블랙박스 형태로 테스트하는 용도로 사용된다. Thus, the test case generated according to the present invention is used for testing in the form of a black box in order to confirm whether the developed embedded system is implemented according to the requirements envisioned at the beginning of development.

상기와 같은 목적을 달성하기 위하여 본 발명의 시스템은, 사용자가 선택한 커버리지 기준에 따라 요구사항 모델로부터 커버리지 목표를 생성하고, 테스트 케이스 생성 과정에서 커버리지 목표 달성 여부를 확인하는 커버리지 목표 관리부; 요구사항 모델의 내부 상태 변수 및 내부 상태 값을 이용하여 상태를 정의하되, 요구사항 모델의 초기 상태로부터 입력값을 인가함에 따라 요구사항 모델의 상태를 하나의 노드로 정의하고, 생성된 노드들을 트리로 관리하는 모델 상태 트리 관리부; 테스트 케이스 생성 알고리즘에서 커버리지 목표를 찾아가려고 할 때 필요한 요구사항 모델의 말단 포트별로 인가해야 하는 값을 생성하는 입력 생성부; 정형 요구사항 모델을 변경하지 않고, 블랙박스 테스트용 테스트 케이스를 입력하기 위하여 다이나믹 데이터 분석 기법을 사용하여 요구사항 모델에서 찾아낸 테스트 케이스 입력을 인가하고, 인가한 입력에 의해 실제 커버리지 목표가 달성되었는지 확인하고 시스템 상태를 살펴보며 예상 출력 값을 얻어내기 위한 모델 시뮬레이터; 테스트 케이스 DB; 및 상기 커버리지 목표를 만족시키기 위한 테스트 케이스를 생성하여 생성된 테스트 케이스를 상기 테스트 케이스 DB에 저장하는 테스트 케이스 생성 도구를 구비하는 것을 특징으로 한다.In order to achieve the above object, the system of the present invention includes a coverage target management unit for generating a coverage target from a requirements model according to a coverage criterion selected by a user and checking whether the coverage target is achieved in a test case generation process; Define the state by using internal state variables and internal state values of the requirement model, but define the state of the requirement model as one node by applying inputs from the initial state of the requirement model, and create the tree A model state tree management unit managed by; An input generation unit for generating a value to be applied for each end port of a requirement model required to find a coverage target in a test case generation algorithm; To input test cases for black box tests without changing the formal requirements model, use dynamic data analysis techniques to authorize test case inputs found in the requirements model, to verify that the actual input targets have been met by the inputs. A model simulator for examining the system state and obtaining an expected output value; Test case DB; And a test case generation tool configured to generate a test case generated by satisfying the coverage target and store the test case generated in the test case DB.

상기 커버리지 목표 관리부는 요구사항을 분석하여 커버리지 목표를 생성하고, 테스트 케이스가 생성됨에 따라 달성한 커버리지 목표와 달성하지 못한 커버리지 목표를 분류하여 관리하고, 통계 자료를 보여주는 역할을 수행하며, 상기 모델 시뮬레이터로부터 시스템 모델의 상태를 얻어 와서 만족하지 못한 커버리지 목표들 중 새로이 달성한 커버리지 목표를 찾아내고,상기 모델 상태 트리 관리부는 상기 테스트 케이스 생성 도구가 확장을 위한 시작 노드를 선택하고자 할 때, 노드가 골고루 선택되어 균일한 분포로 확장하고 고갈이 발생하지 않게 하기 위하여 가중치를 이용하여 무작위로 노드를 선택한다.The coverage goal management unit analyzes requirements to generate coverage goals, classifies and manages coverage goals that have not been achieved and coverage goals that have not been achieved as test cases are generated, and displays statistics, and the model simulator. Obtains the state of the system model from the unsatisfied coverage targets, and the model state tree management unit evenly distributes the nodes when the test case generation tool attempts to select a starting node for expansion. Nodes are randomly selected using weights in order to extend to a uniform distribution and avoid exhaustion.

상기 입력 생성부는 원하는 내부 상태로 도달하기 위하여 입력과의 상관관계를 분석하여 그에 상응하는 입력을 넣는 방법과, 특정 선도에 따라 입력을 차례대로 생성하는 방법과, 수학적 통계 분포를 이용하는 방법과, 입력 값에 가중치를 두고 가중치에 따라 그 값을 생성하는 방법과, 무작위로 입력을 넣는 방법 중 어느 하나로 입력 변수에 넣어야 할 값을 결정한다. The input generation unit analyzes the correlation with the input to arrive at the desired internal state, and inputs the corresponding input, generates the input in sequence according to a specific diagram, uses a mathematical statistical distribution, and The value to be put in the input variable is determined by either weighting the value and generating the value according to the weight, or randomly inputting the value.

상기 모델 시뮬레이터는 상기 테스트 케이스 생성도구에서 입력에 따라 모델을 시뮬레이션하여 출력 값을 검토하고, 입력에 따라 모델을 시뮬레이션하는 동안 내부 변수 값이나 상태가 변화하는 것을 확인한다. 이를 위하여 시간에 따라 변화하는 입력에 대응하는 출력의 변화값을 제공하거나 시간에 따라 변화하는 입력에 대응하는 내부 변수나 상태값을 제공한다. 그리고 시스템의 특정 상태로 이동하기 위하여 특정 시점의 상태를 저장하고, 저장된 시점으로 롤백하는 기능을 수행한다.The model simulator examines an output value by simulating a model according to an input in the test case generation tool, and confirms that an internal variable value or state changes while simulating a model according to the input. To this end, a change value of an output corresponding to an input that changes with time is provided, or an internal variable or state value corresponding to an input that changes with time is provided. In order to move to a specific state of the system, a function of storing a state of a specific time point and rolling back to the stored time point is performed.

상기와 같은 목적을 달성하기 위하여 본 발명의 방법은 커버리지 목표 관리부가 사용자 설정에 따른 커버리지 목표를 생성하는 제1단계; 모델 상태 트리 관리부가 트리 확장을 위한 상태 노드를 선택하는 제2단계; 입력 생성부가 새로운 커버리지 목표를 만족하기 위하여 입력을 생성하는 제3단계; 모델 시뮬레이터에 입력을 인가하여 시뮬레이션하는 제4단계; 커버리지 목표 관리부가 상기 모델 시뮬레이터를 이용하여 시뮬레이션하는 동안 커버리지 목표가 달성되는지를 확인하여 기록하는 제5단계; 시뮬레이션이 종료되고 새로 달성한 커버리지 목표가 존재한다면, 생성한 입력은 테스트 케이스로서 유효한 것이므로, 테스트 케이스 DB에 입력 순서 및 예상 출력이 포함된 테스트 케이스를 저장하는 제6단계; 및 커버리지 목표를 모두 만족하는지 검사하여 만약 커버리지 목표 관리부에 아직 만족하지 않은 커버리지 목표가 있다면, 다시 커버리지 목표를 찾기 위해서 트리 확장을 위한 노드를 선택하는 단계로 이동하며, 그렇지 않은 경우 테스트 케이스 생성을 종료하는 제7단계로 이루어지는 것을 특징으로 한다.In order to achieve the above object, the method of the present invention includes a first step in which a coverage target manager generates a coverage target according to a user setting; A second step of the model state tree manager selecting a state node for tree extension; A third step of generating, by the input generator, an input to satisfy the new coverage target; A fourth step of applying an input to the model simulator and simulating it; A fifth step of confirming and recording whether a coverage goal is achieved during the simulation by the coverage goal manager using the model simulator; If the simulation ends and the newly achieved coverage target exists, the generated input is valid as a test case, and thus storing the test case including the input order and the expected output in the test case DB; And if all of the coverage targets are satisfied, and if there is a coverage target that is not yet satisfied by the coverage target management unit, it moves back to selecting a node for the tree extension to find the coverage target, and otherwise ends the test case generation. Characterized in that the seventh step.

상기 트리 확장을 위한 상태 노드를 선택하는 제2단계는 가중치를 이용하여 가중치 기반 무작위 선택 기법으로 노드를 선택한다. 그리고 제 6단계가 종료된 후 새로운 커버리지 목표가 달성된 경우나 출력이 변화된 경우, 내부 상태 다이어그램의 상태가 변화한 경우, 그리고 엔지니어가 지정한 주요 변수 값이 변화한 경우에 새로운 노드를 만들고 제 2단계에서 선택한 노드로부터 트리를 확장한다.
In the second step of selecting a state node for the tree extension, the node is selected using a weight-based random selection scheme using weights. After the end of step 6, if a new coverage target is achieved, or if the output changes, if the state of the internal state diagram changes, or if the key variable value specified by the engineer changes, then a new node is created and Expand the tree from selected nodes.

본 발명에 따른 요구사항 모델 기반 테스트 케이스 자동 생성 시스템 및 방법은 블랙박스 테스팅에 걸 맞는 시간에 따른 외부 입력 시퀀스를 찾아낸다. 이때 테스트 케이스 생성을 위하여 원본 정형 요구사항을 다른 형태의 모델로 변경하지 않고 직접 분석하여 사용하며, 정적 분석뿐만 아니라, 동적 분석 방법을 이용하여 시스템의 상태를 추적해 나간다.The requirements model-based test case automatic generation system and method according to the present invention finds an external input sequence over time for black box testing. In order to generate test cases, the original formal requirements are directly analyzed without changing to other types of models, and the state of the system is tracked using dynamic analysis methods as well as static analysis.

그리고 본 발명은 동적 분석시 시스템의 상태를 추적하기 위하여 트리를 구성하여 시스템 상태를 추적하고, 모든 정형 요구사항을 사용할 수 있으나 바람직하게는 Matlab Simulink/Stateflow와 도형화된 시스템 요구사항으로부터 테스트 케이스를 생성할 수 있고, 테스트 케이스 생성기술은 정형 요구사항 내부 조건들의 특정한 커버리지를 만족하기 위한 입력 순서를 찾아내는 방식으로 처리할 수 있다.In addition, the present invention can construct a tree to track the state of the system in dynamic analysis and track the state of the system, and use all formal requirements, but preferably test cases from Matlab Simulink / Stateflow and graphical system requirements. The test case generation technique can be processed by finding an input sequence to satisfy specific coverage of the formal requirements internal conditions.

도 1은 본 발명에 따른 전장품 단위 테스트 절차를 나타낸 순서도,
도 2는 본 발명에 따라 정형적인 요구사항 모델로부터 테스트 케이스를 생성하는 것을 설명하기 위한 예,
도 3은 본 발명에 따른 요구사항 모델 기반 테스트 케이스 자동 생성 시스템을 도시한 구성 블럭도,
도 4는 본 발명에 따른 테스트 케이스 생성 시스템의 테스트 케이스 생성 절차를 도시한 순서도,
도 5는 본 발명에 따라 모델 상태 관리부가 관리하기 위한 모델 상태의 트리 예시이다.
1 is a flow chart showing the electrical equipment unit test procedure according to the present invention,
2 is an example for explaining generating a test case from a formal requirement model according to the present invention;
3 is a block diagram illustrating a system for automatically generating a requirement model based test case according to the present invention;
4 is a flowchart illustrating a test case generation procedure of the test case generation system according to the present invention;
5 is a tree example of a model state for management by the model state management unit according to the present invention.

본 발명과 본 발명의 실시에 의해 달성되는 기술적 과제는 다음에서 설명하는 본 발명의 바람직한 실시 예들에 의하여 보다 명확해질 것이다. 다음의 실시 예들은 단지 본 발명을 설명하기 위하여 예시된 것에 불과하며, 본 발명의 범위를 제한하기 위한 것은 아니다. BRIEF DESCRIPTION OF THE DRAWINGS The above and other objects, features, and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings. The following examples are merely illustrated to illustrate the present invention and are not intended to limit the scope of the present invention.

도 1은 본 발명에 따른 전장품 단위 테스트 절차를 도시한 도면으로서, 테스트 케이스 생성 도구가 정형적으로 표현된 요구사항 모델을 입력받아 전장품 테스트용 테스트 케이스 세트를 생성하고(S1~S3), 블랙박스 테스트 실행 도구가 전장품 테스트용 테스트 케이스 세트를 입력받아 테스트 대상 시스템을 블랙박스 테스팅한다(S4,S5).1 is a diagram illustrating an electronic device unit test procedure according to an embodiment of the present invention, in which a test case generation tool receives a requirement model that is formally represented to generate a test case set for an electronic device test (S1 to S3), and a black box The test execution tool receives a set of test cases for the test of the electronic device, and performs a black box testing of the system under test (S4 and S5).

도 1을 참조하면, 테스트 케이스 생성 도구(S2)는 정형적으로 표현된 요구사항 모델로부터 표준화된 방법으로 테스트 케이스를 생성하고, 생성된 테스트 케이스는 테스트 실행 도구(S4)를 이용하여 블랙박스 테스팅을 진행한다.Referring to FIG. 1, the test case generation tool S2 generates a test case from a standardized requirement model in a standardized manner, and the generated test case is black box tested using the test execution tool S4. Proceed.

이와 같이 본 발명에 따라 요구사항 기반으로 테스트 케이스를 정량화할 수 있는 표준화된 테스트 케이스 생성 방법은 커버리지 기준을 이용한 테스트 케이스 생성 방법을 사용하는데, 널리 사용되어지는 커버리지 기준들은 다음과 같다.As described above, the standardized test case generation method capable of quantifying the test case based on the requirements according to the present invention uses a test case generation method using coverage criteria, and the coverage criteria widely used are as follows.

문장 커버리지(Statement Coverage)는 요구사항의 조건이나 행동이 문장으로 표현된다고 할 때, 문장을 한번씩 검사하거나 행해보아야 한다는 조건이다.Statement coverage is a condition that a sentence must be examined or performed once, if the condition or action of the requirement is expressed in a sentence.

조건 커버리지(Condition Coverage)는 생성한 테스트 케이스가 모든 조건들을 검사해보았을 때, 해당 테스트 케이스는 조건 커버리지(Condition Coverage)를 만족하는 테스트 케이스 세트라고 부른다. 여기서, 조건이라는 것은 조건 문장에서 사용되어지는 논리적인 최소 입력 변수를 일컫는다. 예를 들어, "C1C2"문장이 있을 때, 해당 문장에는 총 2개의 조건이 C1과 C2가 존재한다. 따라서, 테스트 케이스는 반드시 각 컨디션의 모든 값을 검사해보아야 한다. 즉, C1이 'True'일때와 'False'일 때, C2가 'True' 일 때와 'False'일 때를 확인할 수 있는 테스트 케이스가 필요하다.Condition coverage is called a set of test cases that satisfy condition coverage when the generated test case examines all conditions. Here, the condition refers to the logical minimum input variable used in the conditional sentence. For example, when the sentence "C 1 C 2 " is present, a total of two conditions C 1 and C 2 exist in the sentence. Therefore, the test case must examine every value of each condition. In other words, we need a test case to check when C 1 is 'True' and 'False', when C 2 is 'True' and 'False'.

결정 커버리지(Decision Coverage)는 생성된 테스트 케이스가 모든 결정을 검사해보았을 때, 해당 테스트 케이스 세트는 결정 커버리지(Decision Coverage)를 만족하였다고 말한다. 여기서, 결정이라는 것은 조건 문장에서의 결과 값이다. 예를 들어, "D=C1C2" 문장이 있을 때, D값이 'True'이고 'False'인 것을 확인해보아야 한다는 것이다.Decision Coverage says that when the generated test case examined all the decisions, the set of test cases met Decision Coverage. Here, the decision is the result value in the conditional sentence. For example, if you have a "D = C 1 C 2 " statement, you should check that the D value is 'True' and 'False'.

변형된 조건 및 결정 커버리지(Modified Condition and Decision Coverage (MC/DC))는 모든 테스트 케이스가 결정 커버리지와 조건 커버리지를 만족하고, 추가적으로 다른 조건의 값이 고정된 상태에서 하나의 조건의 변화로 결정이 변화하는 것을 보아야 한다는 제한 사항이 추가된 것이다. 예를 들어, "D=C1C2" 문장이 있을 때 MC/DC는 다음 표2의 진리표(Truth Table)를 만족하여야 한다.Modified Condition and Decision Coverage (MC / DC) means that all test cases meet decision coverage and condition coverage, and in addition, the decision is made by changing one condition with a fixed value of another condition. The addition of a restriction to see changes. For example, when there is a sentence "D = C 1 C 2 ", the MC / DC must satisfy the Truth Table in Table 2 below.

No.No. C1 C 1 C2 C 2 D=C1 ∧C2 D = C 1 ∧C 2 1One TT TT TT 22 TT FF FF 33 FF TT FF

위 테이블에서 볼 수 있듯이, C1이 고정되었을 때, C2의 변화에 따라 결정(Decision)값이 변화하고 있으며, C2가 고정되었을 때, C1의 변화에 따라 결정(Decision)값이 변화하고 있음을 알 수 있다.When, as shown in the above table, when C 1 is fixed, and to determine (Decision) value is changed in accordance with the change of the C 2, when C 2 is fixed, the crystal (Decision) value is changed in accordance with the change of the C 1 It can be seen that.

상태 커버리지(State Coverage)는 상태 다이어그램에서 상태를 모두 한 번씩 방문해보아야 하는 것을 말한다. 상태 전이 커버리지(Transition Coverage)는 상태 다이어그램에서 상태와 상태 사이의 모든 전이를 한 번씩은 방문해보아야 한다는 것을 말한다.State coverage refers to the need to visit a state once in a state diagram. Transition Coverage means that you must visit every transition between states in a state diagram once.

정형적(Formal)으로 기술된 요구사항 모델, 특히 Matlab Simulink/Stateflow 또는 도형화된 시스템 요구사항 표현 기법으로 작성된 정형 요구사항으로부터, 여러 커버리지 기준에 따라 블랙박스 테스팅을 위한 테스트 케이스를 쉽게 생성할 수 없는 이유는 다음과 같다. 첫째, 정형 요구사항 모델에 사용된 내부 변수들이나 데이터 항목들이 실제 전장품 개발시에 그대로 반영되어 지지 않는다. 실제 전장품과 동일한 데이터 항목 또는 변수는 입/출력뿐이다. 둘째, 커버리지 기준은 요구사항 모델 내부 로직들로부터 만들어진다. 그리고 그러한 로직들은 수많은 모델에서 임시로 사용하는 내부 변수 등으로 구성되어져 있다. 따라서 테스트 커버리지 항목을 뽑아낸다고 해서, 그것을 바로 개발된 전장품에 입력으로서 인가하거나 데이터 값을 볼 수 있는 것을 불가능하다. 뿐만 아니라 테스트하고자 하는 대상 전장품은 보통 외부 입/출력만을 제어하여 테스트하길 선호하고, 내부 변수를 제어하기 위한 인터페이스가 나와 있더라고 모든 항목들을 적용할 수 없다.Easily create test cases for blackbox testing according to different coverage criteria, from formal requirements written models, especially from formal requirements created with Matlab Simulink / Stateflow or graphical system requirements representation techniques. The reason for this is as follows. First, internal variables or data items used in the formal requirements model are not reflected in the development of the actual electronics. The same data item or variable as the actual electronics is the input / output. Second, coverage criteria are created from the logic inside the requirement model. And such logic consists of internal variables that are temporarily used by many models. Therefore, extracting a test coverage item does not make it possible to apply it as an input to a developed electronic device or to view data values. In addition, the target electrical equipment to be tested usually prefers to test by controlling only external input / output, and even if an interface for controlling internal variables is provided, all items cannot be applied.

도 2는 정형적인 요구사항 모델로부터 테스트 케이스를 생성하는 것을 나타내기 위한 예제이다. 도 2에서, 요구사항은 n개의 입력이 I1, I2, .... In -1, In 정의되어 있으며, m개의 출력 O1, O2,.... Om-1, Om이 정의된다. 이러한 입/출력에 따라 요구사항 로직을 상태 다이어그램이나 기타 다른 방법을 이용하여 표현할 수 있다. 이때, 내부 상태를 표현하기 위한 내부 변수 "From"과 "To"라는 변수를 이용한다. 그리고 테스트 커버리지는 이러한 내부 변수를 이용하여 표현된다. 예를 들어, "To==T&&From==F"라는 전이 조건을 위해서는 다음의 조건이 만족하면 MC/DC가 만족한다.2 is an example to illustrate generating a test case from a formal requirement model. In FIG. 2, the requirement is that n inputs are defined as I 1 , I 2 , .... I n -1 , I n , with m outputs O 1 , O 2 , .... O m-1 , O m is defined. Depending on these inputs and outputs, the requirements logic can be represented using state diagrams or other means. At this time, internal variables "From" and "To" are used to express the internal state. Test coverage is then expressed using these internal variables. For example, for the transition condition "To == T && From == F", the MC / DC is satisfied if the following condition is satisfied.

To==TTo == T From==FFrom == F To==T&&From==FTo == T && From == F TT TT TT TT FF FF FF TT FF

그러나 실제 구현된 전장품(ECU)에서는 To라는 변수와 From이라는 변수를 직접적으로 제어할 수 없기 때문에, 전장품의 입력 I1,....In을 시간순서에 따라 적절하게 변화시켜서 "From"과 "To" 값을 만들어 내야 한다.However, since the actual implementation of the electronics (ECU) cannot directly control the variable To and the variable From, the inputs I 1 , .... I n of the electronics are changed according to the time order so that "From" and It should produce a "To" value.

도 3은 본 발명에 따른 요구사항 모델 기반 테스트 케이스 자동 생성 시스템을 도시한 구성 블럭도이다.3 is a block diagram illustrating a system for automatically generating a requirement model-based test case according to the present invention.

본 발명에 따른 테스트 케이스 자동 생성시스템(100)은 도 3에 도시된 바와 같이 테스트 케이스 생성도구(110), 커버리지 목표 관리부(120), 모델상태 트리 관리부(130), 입력 생성부(140), 모델 시뮬레이터(150), 데스트 케이스 데이터베이스(160)로 구성되어 정형적 요구사항으로부터 커버리지 기준을 적용하여 자동으로 입력 순서를 시간 순으로 생성하고, 해당 입력 순서에 따라 예상되는 출력 값을 생성한다.Test case automatic generation system 100 according to the present invention is a test case generation tool 110, coverage target management unit 120, model state tree management unit 130, input generation unit 140, as shown in FIG. The model simulator 150 and the test case database 160 may be configured to automatically generate an input sequence in chronological order by applying coverage criteria from formal requirements, and generate an expected output value according to the corresponding input sequence.

도 3을 참조하면, 테스트 케이스 생성도구(110)는 후술하는 바와 같이 테스트 케이스 생성 알고리즘에 따라 커버리지 목표 관리부(120), 모델 상태 트리 관리부(130), 입력 생성부(140), 모델 시뮬레이터(150)를 이용하여 테스트 케이스를 생성한다.Referring to FIG. 3, the test case generation tool 110 may include a coverage target manager 120, a model state tree manager 130, an input generator 140, and a model simulator 150 according to a test case generation algorithm as described below. To create a test case.

커버리지 목표 관리부(120)는 사용자가 선택한 커버리지 기준에 따라, 모델로부터 커버리지 목표를 생성하고, 테스트 케이스 생성 과정에서 커버리지 목표 달성 여부를 확인하는 역할을 수행한다. 커버리지 목표(Coverage Target)라 함은, 커버리지 기준에 따라서, 만족해야만 하는 항목을 커버리지 목표라고 한다. 테스트 케이스 생성 도구(110)는 이러한 커버리지 목표를 만족시키기 위한 테스트 케이스, 즉 시간에 따른 입력 인가 순서를 생성한다.The coverage target manager 120 generates a coverage target from a model according to a coverage criterion selected by a user, and checks whether the coverage target is achieved in a test case generation process. The coverage target is referred to as a coverage target as an item that must be satisfied according to the coverage criteria. The test case generation tool 110 generates a test case, that is, an input application sequence over time, for satisfying this coverage goal.

모델 상태 트리 관리부(130)는 요구사항 모델의 구석구석을 방문하기 위하여 상태 트리를 만들고 관리하는 역할을 수행한다. 높은 커버리지를 만족하는 테스트 케이스를 생성하기 위해서는 요구사항의 많은 조건들을 확인하여야 한다. 따라서 요구사항 모델의 구석구석을 뒤져야 하는데, 이를 위하여 먼저 요구사항 모델의 내부 상태 변수 및 내부 상태 값을 이용하여 상태를 정의한다. 모델은 시스템(요구사항 모델)의 초기 상태로부터 입력 값을 인가함에 따라 시스템(요구사항 모델)의 상태가 계속해서 새로이 정의된다. 이러한 상태를 하나의 노드로 정의하고, 이러한 노드들을 도 5에서와 같이 트리로 관리한다.The model state tree manager 130 creates and manages a state tree in order to visit every corner of the requirement model. In order to create a test case that satisfies high coverage, many conditions of the requirement must be identified. Therefore, every corner of the requirements model needs to be reviewed. To do this, first, state is defined using internal state variables and internal state values of the requirements model. As the model accepts input values from the initial state of the system (requirement model), the state of the system (requirement model) continues to be newly defined. This state is defined as a node, and these nodes are managed as a tree as shown in FIG.

입력 생성부(140)는 테스트 케이스 생성 알고리즘에서, 커버리지 목표를 찾아가려고 할 때 필요한, 시스템의 말단 포트별로 인가해야 하는 값을 생성하는 역할을 수행한다. 입력 생성부(140)는 모델을 정적분석하여 값을 생성하거나, 때에 따라 무작위로 생성하거나, 특정 선도에 따라 생성하거나, 통계적인 분포에 따라 값을 생성한다.In the test case generation algorithm, the input generator 140 generates a value to be applied for each terminal port of the system, which is required when trying to find a coverage target. The input generator 140 generates a value by statically analyzing the model, generates a random value at any time, generates a specific line, or generates a value according to a statistical distribution.

모델 시뮬레이터(150)는 다이나믹 데이터 분석 기법을 사용하기 위하여 모델을 시뮬레이션 한다. 정형 요구사항 모델을 변경하지 않고, 블랙박스 테스트용 테스트 케이스를 입력하기 위하여 정적 분석 기법뿐만 아니라, 다이나믹 데이터 분석 기법을 사용한다. 모델 시뮬레이터(150)를 이용하여 모델에 찾아낸 테스트 케이스 입력을 인가하고, 인가한 입력에 의해 실제 커버리지 목표가 달성되었는지 확인하거나 시스템 상태를 살펴보거나 예상 출력값을 얻어내기 위한 목적으로 사용된다.The model simulator 150 simulates a model to use a dynamic data analysis technique. Dynamic data analysis is used as well as static analysis to enter test cases for black box tests without changing the formal requirements model. The model simulator 150 is used to apply a test case input found to the model and to check whether the actual coverage target is achieved by the input, or to check the system state or to obtain an expected output value.

테스트 케이스 DB(160)는 생성된 테스트 케이스를 저장하기 위한 저장 장소이다.The test case DB 160 is a storage place for storing the generated test cases.

도 4는 본 발명에 따른 테스트 케이스 생성 시스템의 테스트 케이스 생성 절차를 도시한 순서도이다.4 is a flowchart illustrating a test case generation procedure of the test case generation system according to the present invention.

도 4를 참조하면, 제1 단계(S101)는 사용자 설정에 따른 커버리지 목표를 생성하는 단계이다. 커버리지 목표는 커버리지 목표 관리부(120)에서 담당하며, 해당 모듈에서 목표를 생성한다.Referring to FIG. 4, a first step S101 is a step of generating a coverage target according to a user setting. The coverage goal is in charge of the coverage goal manager 120, and generates a goal in the corresponding module.

제2 단계(S102)는 트리 확장을 위한 상태 노드를 선택하는 단계로서, 특정 노드에서 시간이나 입력 값의 변화에 따라 새로운 노드가 생성된다. 트리가 확장을 시작하는 노드를 모델 상태 트리 관리부(130)를 이용하여 선택한다.The second step (S102) is a step of selecting a state node for tree expansion, and a new node is generated according to a change in time or an input value at a specific node. The node from which the tree starts to expand is selected using the model state tree manager 130.

제3 단계(S103)는 입력 생성단계로서, 새로운 커버리지 목표를 만족하기 위하여 입력을 생성하는 단계이다. 해당 단계는 입력 생성부(140)에서 담당한다.The third step S103 is an input generation step, in which an input is generated to satisfy a new coverage target. The corresponding step is in charge of the input generator 140.

제4 단계(S104)는 모델 시뮬레이터(150)에 입력을 인가하여 시뮬레이션 하는 단계로서, 생성한 입력을 시뮬레이션 한다. The fourth step S104 is a step of applying an input to the model simulator 150 and simulating the generated input.

제5 단계(S105)는 새로 달성한 커버리지 목표를 검색하는 단계로서, 모델 시뮬레이터(150)를 이용하여 시뮬레이션 하는 동안 커버리지 목표가 달성되는지를 커버리지 목표 관리부(120)를 이용하여 확인하고 기록한다.The fifth step S105 is a step of searching for a newly achieved coverage target, and confirming and recording the coverage target management unit 120 using the model simulator 150 to determine whether the coverage target is achieved during the simulation.

제6 단계(S106)는 입력 순서 및 예상 출력이 포함된 테스트 케이스 등록 단계로서, 시뮬레이션이 종료되고, 새로 달성한 커버리지 목표가 존재한다면, 생성한 입력은 테스트 케이스로서 유효한 것이므로, 테스트 케이스 DB(160)에 테스트 케이스를 저장한다.The sixth step S106 is a test case registration step including an input order and an expected output. If the simulation is terminated and a newly achieved coverage target exists, the generated input is valid as a test case, so that the test case DB 160 Save the test case in

제7 단계(S107)는 커버리지 목표를 모두 만족하는지 검사하는 단계로서, 만약 커버리지 목표 관리부(120)에 아직 만족하지 않은 커버리지 목표가 있다면, 다시 커버리지 목표를 찾기 위해서 입력 생성 파트로 이동하며, 그렇지 않은 경우 테스트 케이스 생성을 종료한다.The seventh step S107 is a step of checking whether all of the coverage targets are satisfied. If there is a coverage target that is not yet satisfied in the coverage target management unit 120, the mobile terminal moves to the input generation part again to find the coverage target. End the test case generation.

다시 도 3을 참조하면, 커버리지 목표 관리부(120)는 다음의 기능을 담당한다. 사용자가 지정한 커버리지 기준에 요구사항 모델을 분석하여 커버리지 목표를 생성한다. 본 발명의 실시 예에서는 다음 표 4와 같은 커버리지 기준을 지원한다.Referring back to FIG. 3, the coverage target manager 120 is responsible for the following functions. Create a coverage goal by analyzing requirements models against user-specified coverage criteria. The embodiment of the present invention supports the coverage criteria shown in Table 4 below.

Statement Coverage Criteria
Condition Coverage Criteria
Decision Coverage Criteria
Modified Condition and Decision Coverage(MC/DC) Criteria
State Coverage Criteria
Transition Coverage Criteria
Boundary Coverage Criteria
Statement Coverage Criteria
Condition Coverage Criteria
Decision Coverage Criteria
Modified Condition and Decision Coverage (MC / DC) Criteria
State Coverage Criteria
Transition Coverage Criteria
Boundary Coverage Criteria

또한 커버리지 목표 관리부(120)는 전체 커버리지 목표를 관리하고, 테스트 케이스가 생성됨에 따라 달성한 커버리지 목표와 달성하지 못한 커버리지 목표를 분류하여 관리하며, 통계 자료를 보여주는 역할을 수행하고, 모델 시뮬레이터(150)로부터 시스템 모델의 상태를 얻어 와서, 만족하지 못한 커버리지 목표들 중 새로이 달성한 커버리지 목표를 찾아내는 기능을 수행한다. 커버리지 목표는 정형 요구사항의 내부 데이터 변수들의 조건 수식으로 표현된다. 예를 들어, 상태 커버리지(State Coverage)의 경우에 상태(State)를 표현하는 변수 v_state라는 변수가 존재한다고 가정할 때, v_state=="state_off"와 같은 형태로 표현한다. In addition, the coverage target manager 120 manages the entire coverage target, classifies and manages the coverage targets that have not been achieved and the coverage targets that have not been achieved as test cases are generated, serves to show statistical data, and the model simulator 150. Gets the state of the system model from) and finds the newly achieved coverage target among the unsatisfactory coverage targets. The coverage goal is expressed as a conditional expression of internal data variables of the formal requirements. For example, in the case of state coverage, assuming that a variable called v_state representing a state exists, it is expressed in the form of v_state == "state_off".

그러나 실제 도구를 구현하는데 있어서는 위의 포멧이 Post-fix형 수식으로 표현되어져, 다이나믹 요구사항 모델로부터 커버리지 목표 달성을 검사할 때 빠르게 검사가 가능하도록 한다.However, in the actual implementation of the tool, the above format is expressed as a post-fix formula so that it can be quickly checked when checking the coverage target from the dynamic requirements model.

모델 상태 관리부(130)는 요구사항 모델의 내부 상태 변수 및 상태 다이어그램의 상태 값을 이용하여 모델 상태를 정의한다. 즉, 내부 변수와 상태 다이어그램의 상태 값을 이용하여 모델의 상태를 다음 수학식1과 같이 고유하게(Unique) 정의할 수 있게 된다. The model state manager 130 defines the model state by using internal state variables of the requirement model and state values of the state diagram. That is, the state of the model can be uniquely defined using Equation 1 using internal variables and state values of the state diagram.

Figure 112012033663514-pat00001
Figure 112012033663514-pat00001

여기서, ValueOf(Vk)은 내부 변수 또는 상태 변수 Vk의 값을 의미한다.Here, ValueOf (V k ) means the value of the internal variable or state variable V k .

그리고 이러한 모델 상태를 트리로 관리하기 위하여 하나의 모델 상태를 트리의 노드로 정의한다. 그리고 시간별 입력 변수 값 세트인 Sm(I)에 의해서 트리 노드가 도 5와 같이 확장된다. 이러한 입력 변수 값 세트 Sm(I)를 생성하는 모듈이 입력 생성부(140)이다.And to manage these model states as a tree, we define a model state as a node of the tree. The tree node is expanded as shown in FIG. 5 by S m (I), which is a set of time-dependent input variable values. The module generating the input variable value set S m (I) is the input generator 140.

도 5를 참조하면, 초기화 상태 S0에서 입력값에 따라서 트리를 확장하고 있는 모습을 보여주고 있다. 따라서 모델 상태 관리부(130)는 요구사항 모델의 상태를 도 5와 같은 트리로 관리하는 역할을 수행한다.Referring to FIG. 5, the tree is expanded in accordance with the input value in the initialization state S 0 . Accordingly, the model state manager 130 manages the state of the requirement model in a tree as shown in FIG. 5.

노드는 내부 상태가 변화하면 어떠한 입력에 의해서 도 4의 제 5단계(S105)에서 확장이 진행된다. 그러나 이렇게 무한으로 노드를 확장하게 되면, 상태가 폭발할 수 있기 때문에, 다음 표 5와 같은 경우에만 입력에 따라 노드를 확장시킨다.When the internal state changes, the node expands in the fifth step S105 of FIG. 4 by any input. However, if the node is expanded indefinitely, the state may explode. Therefore, the node is expanded according to the input only in the following table.

새로운 커버리지 목표가 달성된 경우
출력이 변화된 경우
내부 상태다이어그램의 상태가 변화한 경우
엔지니어가 지정한 주요 변수값이 변화한 경우
When new coverage goals are achieved
If the output has changed
When the state of the internal state diagram changes
When the value of the key variable specified by the engineer has changed

또한 해당 노드를 새로이 확장할 때, 커버리지 목표 관리부(120)를 이용하여 해당 노드 확장 시 달성한 커버리지를 기록한다. 해당 정보를 이용하면, 테스트 케이스 생성이 끝나고, 새로운 커버리지를 달성한 노드를 방문하기 위한 입력 세트인 Sm(I)들을 이어 붙이면, 최종 테스트 케이스가 생성된다. 예를 들어, 도 5에서 S6가 커버리지 목표를 달성한 노드이면, 해당 커버리지 목표에 대해서 다음 수학식2의 입력 시퀀스가 테스트 케이스가 된다.In addition, when the node is newly expanded, the coverage target management unit 120 is used to record the coverage achieved when the node is expanded. Using this information, the test case generation is finished, and the final test case is generated by concatenating S m (I), which is an input set for visiting a node that has achieved new coverage. For example, in FIG. 5, when S 6 achieves a coverage goal, an input sequence of the following Equation 2 is a test case for the coverage goal.

Figure 112012033663514-pat00002
Figure 112012033663514-pat00002

마지막으로 모델 상태 트리 관리부(130)는 테스트 케이스 생성 메인 알고리즘에서 다음 확장을 위한 시작 노드를 선택하고자 할 때, 노드를 선택하여 메인 알고리즘에 전달해주는 역할을 수행한다. 트리를 확장할 때 확장하고자 하는 노드를 어떻게 선택하느냐가 중요하다. 이를 위하여 본 발명에서는 노드가 골고루 선택되어 균일한 분포로 확장하고 고갈(Starvation)이 발생하지 않게 하기 위하여 가중치를 이용하여 가중치 기반 무작위 선택 기법을 사용한다. 가중치 기반 무작위 선택 기법은 다음과 같다. 즉, 노드 선택은 무작위로 선택하되, 가중치를 둔다. 노드의 가중치 기본값은 10으로 하되, 노드가 선택되면 1씩 감소한다. 노드의 가중치가 0이 되면, 노드의 가중치는 10으로 초기화 된다. 이때 가중치의 기본 값은 엔지니어가 지정하여 튜닝을 할 수 있기 때문에 해당 부분을 제약하지는 않는다. Finally, the model state tree manager 130 selects a node and delivers it to the main algorithm when the start node for the next extension is selected in the test case generation main algorithm. When you expand a tree, how you choose which nodes you want to expand is important. To this end, the present invention uses a weight-based random selection technique using weights so that nodes are evenly selected to expand to a uniform distribution and starvation does not occur. The weight-based random selection technique is as follows. That is, node selection is randomly selected but weighted. The default weight of the node is 10, but decrements by 1 when the node is selected. When the weight of the node becomes zero, the weight of the node is initialized to ten. At this time, the default value of weight can be tuned by the engineer so it does not restrict the relevant part.

입력 생성부(140)는 시스템의 말단 입력 변수에 어떠한 값을 넣어야 할지를 결정하는 모듈이다. 해당 모듈에서는 새로운 커버리지 목표를 달성하기 위하여 입력을 다음의 방식으로 생성한다. 먼저, 원하는 내부 상태로 도달하기 위하여 입력과의 상관관계를 분석하여 그에 상응하는 입력을 넣는 방법과, 특정 선도에 따라 입력을 차례대로 생성하는 방법(이때 특정 선도라 함은 사용자가 그린 선도, 수식에 의한 선도 등을 포함한다)과, 수학적 통계 분포(Poisson Distribution, Exponential Distribution)를 이용하는 방법과, 입력 값에 가중치를 두고, 가중치에 따라 그 값을 생성하는 방법과, 무작위로 입력을 넣는 방법이 있다.The input generator 140 is a module that determines what value to put in the terminal input variable of the system. The module generates inputs in the following ways to achieve new coverage goals. First, in order to reach the desired internal state, the correlation with the input is analyzed and the corresponding input is input, and the input is generated in order according to a specific diagram. And the method of using mathematical statistical distribution (Poisson Distribution, Exponential Distribution), weighting the input value, generating the value according to the weight, and randomly inputting the method. have.

모델 시뮬레이터(150)는 입력에 따라 모델의 행동을 시뮬레이션 하는 역할을 담당한다. 모델 시뮬레이터(150)는 테스트 케이스 생성기에서 입력에 따라 모델을 시뮬레이션 하여 출력 값을 검토하기 위한 목적과, 입력에 따라 내부 변수 값이나 상태가 변화하는 것을 확인하기 위한 목적으로 사용된다. 이는 내부 변수 값이나 상태 변화를 확인하여야만 테스트 커버리지 목표가 달성되었는지 달성되지 않았는지 확인할 수 있기 때문이다.The model simulator 150 is responsible for simulating the behavior of the model according to the input. The model simulator 150 is used to examine an output value by simulating a model according to an input in a test case generator, and to determine whether an internal variable value or state changes according to the input. This is because checking the internal variable values or state changes can only confirm whether the test coverage targets have been met.

이러한 모델 시뮬레이터(150)는 테스트 케이스 생성도구(110)에 다음의 기능을 제공한다. 즉, 시간에 따라 변화하는 입력에 대응하는 출력의 변화를 얻어올 수 있고, 시간에 따라 변화하는 입력에 대응하는 내부 변수나 상태 값을 얻어 올 수 있으며, 시뮬레이터의 상태를 저장하는 'Snapshot'기능과, 복구(Restore) 기능을 제공한다.The model simulator 150 provides the following functions to the test case generation tool 110. In other words, the 'Snapshot' function can obtain the change of output corresponding to the input that changes with time, the internal variable or the state value corresponding to the input that changes with time, and save the state of the simulator. And, restore function is provided.

테스트 케이스 DB(160)는 테스트 커버리지 목표를 만족하는 입력 시퀀스를 저장하고 있다. 이때 저장되는 테스트 케이스는 시간에 따른 입력 시퀀스 뿐만 아니라 그에 상응하는 예상 출력 값도 모델로부터 얻어와 기록한다. 또한 해당 테스트 케이스가 달성한 테스트 커버리지 정보도 같이 저장한다.
The test case DB 160 stores an input sequence that satisfies the test coverage target. The stored test case obtains and records not only the input sequence over time but also the corresponding expected output value from the model. It also stores the test coverage information achieved by the test case.

이상에서 본 발명은 도면에 도시된 일부 실시 예를 참고로 설명되었으나, 본 기술 분야의 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. Although the present invention has been described with reference to some embodiments shown in the drawings, those skilled in the art will understand that various modifications and equivalent other embodiments are possible therefrom.

100: 테스트 케이스 생성 시스템 110: 테스트 케이스 생성도구
120: 커버리지 목표 관리부 130: 모델 상태 트리 관리부
140: 입력 생성부 150: 모델 시뮬레이터
160: 테스트 케이스 DB
100: test case generation system 110: test case generation tool
120: coverage target management unit 130: model state tree management unit
140: input generator 150: model simulator
160: test case DB

Claims (8)

사용자가 선택한 커버리지 기준에 따라 요구사항 모델로부터 커버리지 목표를 생성하고, 테스트 케이스 생성 과정에서 커버리지 목표 달성 여부를 확인하는 커버리지 목표 관리부;
요구사항 모델의 내부 상태 변수 및 내부 상태 값을 이용하여 상태를 정의하되, 요구사항 모델의 초기 상태로부터 입력 값을 인가함에 따라 요구사항 모델의 상태를 하나의 노드로 정의하고, 생성된 노드들을 트리로 관리하는 모델 상태 트리 관리부;
테스트 케이스 생성 알고리즘에서 커버리지 목표를 찾아가려고 할 때 필요한 요구사항 모델의 말단 포트별로 인가해야 하는 값을 생성하는 입력 생성부;
정형 요구사항 모델을 변경하지 않고, 블랙박스 테스트용 테스트 케이스를 입력하기 위하여 다이나믹 데이터 분석 기법을 사용하여 요구사항 모델에서 찾아낸 테스트 케이스 입력을 인가하고, 인가한 입력에 의해 실제 커버리지 목표가 달성되었는지 확인하거나 시스템 상태를 살펴보거나 예상 출력 값을 얻어내기 위한 모델 시뮬레이터;
테스트 케이스 DB; 및
상기 커버리지 목표를 만족시키기 위한 테스트 케이스를 생성하여 생성된 테스트 케이스를 상기 테스트 케이스 DB에 저장하는 테스트 케이스 생성 도구를 구비하는 요구사항 모델 기반 테스트 케이스 자동 생성 시스템.
A coverage target manager configured to generate a coverage target from a requirement model according to a coverage criterion selected by the user, and confirm whether the coverage target is achieved in a test case generation process;
Define the state by using internal state variables and internal state values of the requirement model, but define the state of the requirement model as one node by applying input values from the initial state of the requirement model, and create the nodes A model state tree management unit managed by;
An input generation unit for generating a value to be applied for each end port of a requirement model required to find a coverage target in a test case generation algorithm;
To input test cases for black box testing without changing the formal requirements model, use dynamic data analysis techniques to authorize test case inputs found in the requirements model, to verify that the actual input targets have been met by the authorized inputs, or A model simulator for viewing system status or obtaining expected output values;
Test case DB; And
And a test case generation tool for generating a test case for satisfying the coverage target and storing the generated test case in the test case DB.
제1항에 있어서, 상기 커버리지 목표 관리부는
테스트 케이스가 생성됨에 따라 달성한 커버리지 목표와 달성하지 못한 커버리지 목표를 분류하여 관리하고, 통계 자료를 보여주는 역할을 수행하며, 상기 모델 시뮬레이터로부터 시스템 모델의 상태를 얻어와서 만족하지 못한 커버리지 목표들 중 새로이 달성한 커버리지 목표를 찾아내는 것을 특징으로 하는 요구사항 모델 기반 테스트 케이스 자동 생성 시스템.
The method of claim 1, wherein the coverage target management unit
As test cases are generated, it manages and manages the coverage goals that have not been achieved and the coverage goals that have not been achieved, displays statistics, and obtains the status of the system model from the model simulator. A requirement model based test case automatic generation system characterized by finding the coverage targets achieved.
제1항에 있어서, 상기 모델 상태 트리 관리부는
상기 테스트 케이스 생성 도구가 확장을 위한 시작 노드를 선택하고자 할 때, 노드가 골고루 선택되어 균일한 분포로 확장하고 고갈이 발생하지 않게 하기 위하여 가중치를 이용하여 무작위로 노드를 선택하는 것을 특징으로 하는 요구사항 모델 기반 테스트 케이스 자동 생성 시스템.
The method of claim 1, wherein the model state tree management unit
When the test case generation tool wants to select a start node for expansion, the node is selected evenly by using a weight so that the nodes are evenly selected to expand to a uniform distribution and depletion does not occur. Model-based test case automatic generation system.
제1항에 있어서, 상기 입력 생성부는
원하는 내부 상태로 도달하기 위하여 입력과의 상관관계를 분석하여 그에 상응하는 입력을 넣는 방법과, 특정 선도에 따라 입력을 차례대로 생성하는 방법과, 수학적 통계 분포를 이용하는 방법과, 입력 값에 가중치를 두고 가중치에 따라 그 값을 생성하는 방법과, 무작위로 입력을 넣는 방법 중 어느 하나로 입력 변수에 넣어야 할 값을 결정하는 것을 특징으로 하는 요구사항 모델 기반 테스트 케이스 자동 생성 시스템.
The method of claim 1, wherein the input generating unit
In order to reach the desired internal state, we analyze the correlation with the input and insert the corresponding input, generate the inputs according to a specific line in turn, use the mathematical statistical distribution, and weight the input values. And a method model-based test case automatic generation system comprising determining a value to be put in an input variable by one of a method of generating a value according to a weight and a method of randomly inputting a value.
제1항에 있어서, 상기 모델 시뮬레이터는
상기 테스트 케이스 생성도구에서 입력에 따라 모델을 시뮬레이션 하여 출력 값을 검토하기 위한 목적이나 입력에 따라 모델을 시뮬레이션하면 내부 변수 값이나 상태가 변화하는 것을 확인하기 위한 목적으로, 시간에 따라 변화하는 입력에 대응하는 출력의 변화 값을 제공하거나 시간에 따라 변화하는 입력에 대응하는 내부 변수나 상태 값을 제공하거나 시뮬레이터의 상태를 저장하고 롤백(Rollback)하는 것을 특징으로 하는 요구사항 모델 기반 테스트 케이스 자동 생성 시스템.
The method of claim 1, wherein the model simulator
For the purpose of reviewing the output value by simulating the model according to the input in the test case generation tool, or for the purpose of confirming that the internal variable value or state changes when the model is simulated according to the input, Requirement model-based test case automatic generation system which provides change value of corresponding output, internal variable or state value corresponding to input that changes over time, and save and roll back the state of simulator .
커버리지 목표 관리부가 사용자 설정에 따른 커버리지 목표를 생성하는 제1단계;
모델 상태 트리 관리부가 트리 확장을 위한 상태 노드를 선택하는 제2단계;
입력 생성부가 새로운 커버리지 목표를 만족하기 위하여 입력을 생성하는 제3단계;
모델 시뮬레이터에 입력을 인가하여 시뮬레이션하는 제4단계;
커버리지 목표 관리부가 상기 모델 시뮬레이터를 이용하여 시뮬레이션하는 동안 커버리지 목표가 달성되는지를 확인하여 기록하고 노드를 확장하는 제5단계;
시뮬레이션이 종료되고 새로 달성한 커버리지 목표가 존재한다면, 생성한 입력은 테스트 케이스로서 유효한 것이므로, 테스트 케이스 DB에 입력 순서 및 예상 출력이 포함된 테스트 케이스를 저장하는 제6단계; 및
커버리지 목표를 모두 만족하는지 검사하여 만약 커버리지 목표 관리부에 아직 만족하지 않은 커버리지 목표가 있다면, 다시 커버리지 목표를 찾기 위해서 입력 생성 파트로 이동하며, 그렇지 않은 경우 테스트 케이스 생성을 종료하는 제7단계로 이루어지는 요구사항 모델 기반 테스트 케이스 자동 생성 방법.
A first step of the coverage target manager generating a coverage target according to a user setting;
A second step of the model state tree manager selecting a state node for tree extension;
A third step of generating, by the input generator, an input to satisfy the new coverage target;
A fourth step of applying an input to the model simulator and simulating it;
A fifth step of confirming and recording whether a coverage goal is achieved during the simulation by the coverage goal manager by using the model simulator, and expanding the node;
If the simulation ends and the newly achieved coverage target exists, the generated input is valid as a test case, and thus storing the test case including the input order and the expected output in the test case DB; And
Check if all coverage goals are met and if there is a coverage goal that is not yet satisfied by the coverage goal management unit, go back to the input generation part to find the coverage goal, otherwise the requirement consists of the seventh step of ending test case generation. How to automatically generate model-based test cases.
제6항에 있어서, 상기 트리 확장을 위하여, 트리 확장을 시작하는 노드를 선택하는 제 2단계는
가중치를 이용하여 가중치 기반 무작위 선택 기법으로 노드를 선택하는 것을 특징으로 하는 요구사항 모델 기반 테스트 케이스 자동 생성 방법.
7. The method of claim 6, wherein the second step of selecting a node to start tree expansion for the tree expansion
A method for automatically generating a requirement model based test case, wherein nodes are selected using a weight based random selection technique using weights.
제6항에 있어서, 상기 트리 확장을 수행하는 제5단계는
새로운 커버리지 목표가 달성된 경우나 출력이 변화된 경우나 내부 상태 다이어그램의 상태가 변화한 경우나 엔지니어가 지정한 주요 변수값이 변화한 경우에만 노드를 확장하는 것을 특징으로 하는 요구사항 모델 기반 테스트 케이스 자동 생성 방법.
The method of claim 6, wherein the fifth step of performing the tree expansion
Automated generation of requirement model-based test cases, characterized in that nodes are expanded only when a new coverage target is achieved, when the output changes, when the state of the internal state diagram changes, or when the key variable specified by the engineer changes. .
KR1020120044216A 2012-04-26 2012-04-26 Test case generating system and method based on requirements model KR101291817B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020120044216A KR101291817B1 (en) 2012-04-26 2012-04-26 Test case generating system and method based on requirements model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020120044216A KR101291817B1 (en) 2012-04-26 2012-04-26 Test case generating system and method based on requirements model

Publications (1)

Publication Number Publication Date
KR101291817B1 true KR101291817B1 (en) 2013-07-31

Family

ID=48998354

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020120044216A KR101291817B1 (en) 2012-04-26 2012-04-26 Test case generating system and method based on requirements model

Country Status (1)

Country Link
KR (1) KR101291817B1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101773708B1 (en) 2016-04-27 2017-08-31 엘에스산전 주식회사 Automatic test method of inverter
KR20230028846A (en) 2021-08-23 2023-03-03 에이존테크 주식회사 Black box test apparatus and method
US11599453B2 (en) 2019-07-05 2023-03-07 Hyundai Motor Company Vehicle function test apparatus and method of controlling the same
KR102558933B1 (en) 2022-08-19 2023-07-25 델타인덱스주식회사 Method and device for systematic test case creation for Korean requirements including time conditions

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008519248A (en) 2004-05-22 2008-06-05 株式会社アドバンテスト Method and system for controlling replaceable components in a modular test system
KR20110115626A (en) * 2009-01-12 2011-10-24 시놉시스, 인크. Natural language assertion processor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008519248A (en) 2004-05-22 2008-06-05 株式会社アドバンテスト Method and system for controlling replaceable components in a modular test system
KR20110115626A (en) * 2009-01-12 2011-10-24 시놉시스, 인크. Natural language assertion processor

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101773708B1 (en) 2016-04-27 2017-08-31 엘에스산전 주식회사 Automatic test method of inverter
US11599453B2 (en) 2019-07-05 2023-03-07 Hyundai Motor Company Vehicle function test apparatus and method of controlling the same
KR20230028846A (en) 2021-08-23 2023-03-03 에이존테크 주식회사 Black box test apparatus and method
KR102558933B1 (en) 2022-08-19 2023-07-25 델타인덱스주식회사 Method and device for systematic test case creation for Korean requirements including time conditions

Similar Documents

Publication Publication Date Title
US7475370B2 (en) System for verification using reachability overapproximation
JP6723989B2 (en) Data driven inspection framework
KR102365150B1 (en) Condition monitoring data generating apparatus and method using generative adversarial network
US8689069B2 (en) Multi-targeting boolean satisfiability-based test pattern generation
CN109522228B (en) Interface automation test data construction method, device, platform and storage medium
KR101291817B1 (en) Test case generating system and method based on requirements model
US8037447B2 (en) Identifying semiconductor system specification violations
US20160170868A1 (en) Method and apparatus for the automated testing of a subsystem of a safety critical system
KR101334806B1 (en) Method of proudcing input sets of test case in test case generating system
JP4648386B2 (en) Design support device, design support method, design support program
CN109669436B (en) Test case generation method and device based on functional requirements of electric automobile
CN111475402A (en) Program function testing method and related device
US11409928B2 (en) Configurable digital twin
CN110069414A (en) Regression testing method and system
CN115248783B (en) Software testing method, system, readable storage medium and computer equipment
Allende et al. Statistical test coverage for Linux-based next-generation autonomous safety-related systems
Geng et al. Model-based diagnosis of incomplete discrete-event system with rough set theory
KR101330141B1 (en) Method of selecting nodes in test case generating system
US7231619B1 (en) Extended model checking hardware verification
CN112949061B (en) Village and town development model construction method and system based on reusable operator
US7962796B2 (en) State testing device and methods thereof
CN110928761B (en) Demand chain and system and method for application thereof
US20100191710A1 (en) Network Meta-Data Libraries And Related Methods
Lokan et al. Using chronological splitting to compare cross-and single-company effort models: further investigation
US20030229488A1 (en) Algorithms for determining path coverages and activity

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20160629

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20170719

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20180806

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20190627

Year of fee payment: 7