Shadow pattern: A new design pattern for testing

Yong Zhong Tu, Chen Xi Shao, Wei Tek Tsai, Xiang Dong Hu

Research output: Contribution to journalArticle

Abstract

Introduced in this paper is a new design pattern: a shadow for testing object-oriented programs. This pattern creates a shadow object for each object using it. By using this pattern, no additional test driver or test stub is needed. Thus, the pattern allows test scripts to be embedded in the program seamlessly. During testing, the test case can either call the shadow object as test stub or call the actual application code. The test script can make its decision at runtime to select which one to use. These ideas are illustrated in module testing and integration testing.

Original languageEnglish (US)
Pages (from-to)34-40
Number of pages7
JournalJisuanji Yanjiu yu Fazhan/Computer Research and Development
Volume41
Issue number1
StatePublished - Jan 1 2004

    Fingerprint

Keywords

  • Design pattern
  • Object-oriented testing
  • Shadow pattern

ASJC Scopus subject areas

  • Software
  • Hardware and Architecture
  • Computer Networks and Communications

Cite this

Tu, Y. Z., Shao, C. X., Tsai, W. T., & Hu, X. D. (2004). Shadow pattern: A new design pattern for testing. Jisuanji Yanjiu yu Fazhan/Computer Research and Development, 41(1), 34-40.