DOI QR코드

DOI QR Code

A Study on the Automatic Generation of Test Case Based on Source Code for Quality Improvement

소프트웨어 품질향상을 위한 소스코드 기반의 테스트 케이스 자동 생성에 관한 연구

  • Son, Ung-Jin (Department of Electronic Engineering, Hanbat National Univ.) ;
  • Lee, Seung-Ho (Department of Electronics&Control Engineering, Hanbat National University)
  • Received : 2015.05.11
  • Accepted : 2015.05.27
  • Published : 2015.06.30

Abstract

This paper proposes an automatic generation technology of test case based on API in source code for software's quality improvement. The proposed technology is comprised of four processes which are analyzing source code by using the Doxygen open source tool, defining API specification by using analyzed results, creating test design, generating a test case by adapting Pairwise test technology. Analyzing source code by using the Doxygen open source tool is the phase in which API information in source code such as the API name, input parameter and return parameter are extracted. Defined API specification by using analyzed results is the phase where API informations, which is needed to generate test case, are defined as a form of database by SQLite database on the basis of extracted API information. Creating test design is the phase in which the scenario is designed in order to be composed as database by defining threshold of input and return parameters and setting limitations based on the defined API. Generating a test case by adapting Pairwise test technique is the phase where real test cases are created and changed into database by adapting Pairwise technique on the base of test design information. To evaluate the efficiency of proposed technology, the research was conducted by begin compared to specification based test case creation. The result shows wider test coverage which means the more cases were created in the similar duration of time. The reduction of manpower and time for developing products is expected by changing the process of quality improving in software developing from man-powered handwork system into automatic test case generation based on API of source code.

본 논문에서는 소프트웨어 개발 과정에서 소프트웨어의 품질향상에 필요한 소스코드의 API를 기반으로 테스트 케이스를 자동으로 생성할 수 있는 기법을 제안한다. 제안된 기법은 Doxygen 오픈소스 툴을 이용한 소스코드 분석 과정, 분석된 결과를 이용한 API 사양 정의 과정, 테스트 디자인 생성 과정, Pairwise Test 기법을 적용한 테스트 케이스 생성 과정 등의 4가지 과정으로 구성된다. Doxygen 오픈소스 툴을 이용한 소스코드 분석 과정은 소스코드의 API 정보인 API 명, 입력 파라미터, 리턴 파라미터 정보 등을 추출하는 단계이다. 분석된 결과를 이용한 API 사양 정의 과정은 추출한 API 정보를 바탕으로 SQLite 데이터베이스를 이용하여 테스트 케이스 생성에 필요한 API 정보들을 데이터베이스화하여 정의하는 단계이다. 테스트 디자인 생성 과정은 정의된 API를 기반으로 입력 파라미터, 리턴 파라미터의 임계치 설정, 제약사항 설정 등을 통해 시나리오를 디자인하여 데이터베이스로 구성하는 단계이다. Pairwise Test 기법을 적용한 테스트 케이스 생성 과정은 테스트 디자인 정보를 바탕으로 Pairwise 조합 기법을 적용하여 실제 테스트 케이스를 생성하여 데이터베이스로 구성하는 단계이다. 제안된 기법의 효율성을 평가하기 위하여 기존의 명세서 기반의 테스트 케이스 생성 방법과 비교한 결과 비슷한 시간 내에 훨씬 더 많은 테스트 케이스가 생성되며, 명세 기반 기법으로는 불가능한 소스코드에 대한 기능 검증도 가능하여 소스코드내 결함 위치도 확인할 수 있다. 따라서 사람의 인력을 통한 수작업에 의존적으로 진행하였던 소프트웨어 개발 품질 향상 과정을 소스코드의 API를 기반으로 자동으로 테스트 케이스를 생성함으로써, 노동력 절감 및 제품 개발 시간 등을 단축 할 수 있으리라 기대된다.

Keywords

References

  1. Q. Xie and A.M. Memon, "Model-Based Testing of Community-Driven Open-Source GUI Applications," Software Maintenance, 2006. ICSM '06. 22nd IEEE International Conference on, pp. 145-154, Sep. 2006.
  2. J. H. Kim, "Android and Android Market", Journal of Contents Association, Vol.7, No.2, pp.29-36, 2009.
  3. Malte Lochau, Sebastian Oster, Ursula Goltz, Andy Schurr, "Model-based pairwise testing for feature interaction coverage in software product line engineering," Software Quality Journal Vol. 20, No. 3, pp.567-604, Sep. 2012. https://doi.org/10.1007/s11219-011-9165-4
  4. Amitava Mukherjee, "A Near-Nonparametric Partially Sequential Test for Monitoring Phase II Location Under Pairwise Dependence Between Two Phases," Sequential Analysis Vol. 30, No.2, pp.208-228, Feb. 2011. https://doi.org/10.1080/07474946.2011.563712
  5. James Bach, "Risk and Requirements-Based Testing," IEEE Computer, Vol.32, No.6, pp.113-114, June, 1999. https://doi.org/10.1109/2.751337
  6. Luc Duchateau, Paul Janssen, "Pairwise nonparametric non inferiority tests in $3{\times}3$ cross-over trials: should we adjust for period," Statistics in Medicine Vol. 24, No.10, pp.1525-1536, May. 2005. https://doi.org/10.1002/sim.2048