DOI QR코드

DOI QR Code

모형 객체 패턴을 이용한 Federation 통합시험 방법

A Method of Integration Testing for Federation using Mock Object Patterns

  • 심준용 (LIG넥스원(주) Maritime연구소) ;
  • 이용헌 (LIG넥스원(주) Maritime연구소) ;
  • 이승영 (LIG넥스원(주) Maritime연구소) ;
  • 김세환 (LIG넥스원(주) Maritime연구소)
  • 투고 : 2011.07.13
  • 심사 : 2011.11.08
  • 발행 : 2011.12.31

초록

개발 기능에 대한 단위시험 모듈을 구현할 경우 도메인 구현부와 시험 구현부의 종속성이 높기 때문에 단위시험 모듈의 재사용이 어렵다. 특히, 동일한 구조나 기반 프레임워크를 재사용하는 시스템의 경우 구성 소프트웨어의 내부 인터페이스를 위한 단위시험 모듈의 중복이 불가피하며, 통합 시험 코드는 해당 모듈 간 연동 인터페이스 구현에 종속되기 때문에 각 모듈의 개발 일정에 따라 단위시험 수행이 제한될 수 있다. 이러한 문제를 해결하기 위해서 TDD 기법 중 하나인 모형 객체(Mock Objects) 패턴을 이용한 단위시험 방법이 제안되었다. 이 방법은 도메인 모듈과 시험 모듈을 분리할 수 있도록 도메인 모듈을 대리하는 모형 객체를 생성하고, 해당 모형 객체를 시험 모듈과 통합함으로써 단위시험 모듈의 구현을 용이하게 한다. 본 논문은 HLA 시뮬레이션 시스템 개발에 참여하는 Federate의 Federation 통합 및 연동 시험을 용이하게 하기 위해서 모형 객체를 적용한 모형 Federate를 설계하고, 모형 Federate의 구성 모듈을 위한 테스트 프레임워크를 제안한다. 제안 프레임워크는 RTI 서비스를 위한 시험 함수를 제공하며, 해당 함수들은 xUnit 패턴에 의해 자동화 된다.

The act of writing a unit test is more an act of design than of verification. It is also more an act of documentation than of verification. The act of writing a unit test closes a remarkable number of feedback loops, the least of which is the one pertaining to verification of function. Unit testing is a fundamental practice in Extreme Programming, but most non-trivial code is difficult to test in isolation. Normal unit testing is hard because It is trying to test the code from outside. On the other hand, developing unit tests with Mock Objects leads to stronger tests and to better structure of both domain and test code. In this paper, I first describe how Mock Objects are used for unit testing of federation integration. Then I describe the benefits and costs of Mock Objects when writing unit tests and code. Finally I describe a design of Mock federate for using Mock objects.

키워드

참고문헌

  1. Patton, Ron, "Software Testing 2ND", Macmillan Computer Pub, 2005, ISBN-10 0672327988.
  2. Tim Machinnon, Steve Freeman, and Philip Craig. Endotesting: unit testing with mock objects. pages 287-301, 2001.
  3. Kent back, "Test-Driven Development: By Example", Addison Wesley, 2002, ISBN 0321146530.
  4. Elfriede Dustin, Thom Garrett, Bernie Gauf, "Implementing Automated Software Testing", Addison Wesley, 2009, ISBN-10 0321580516.
  5. Gerard Meszaros, "xUnit Test Patterns: Refactoring Test Code", Addison Wesley, 2007, ISBN 0-13-149505-4.
  6. IEEE, "IEEE Standard for Modeling and Simulation (M&S) High Level Architecture (HLA) - Framework and Rules" IEEE Std. No.: 1516 - 2000.
  7. IEEE, "IEEE Standard for Modeling and Simulation (M&S) High Level Architecture (HLA) - Federate Interface Specification." IEEE Std. No.: 1516.1 - 2000.
  8. IEEE, "IEEE Standard for Modeling and Simulation (M&S) High Level Architecture (HLA) - Object Model Template(OMT)." IEEE Standard No.: 1516.2-2000.
  9. IEEE, "IEEE Recommended Practice for High Level Architecture (HLA) Federation Development and Execution Process" IEEE Std. No.: 1516.3 - 2003.
  10. 심준용, 진정훈, 김세환, "M&S 프레임워크를 적용한 효율적인 분산객체 통신 모듈 설계", 한국소프트웨어공학회 학술대회 논문집 제10권 1호, 2008.