Commenced in January 2007
Frequency: Monthly
Edition: International
Paper Count: 31093
Unit Testing with Déjà-Vu Objects

Authors: Sharareh Afsharian, Andrea Bei, Marco Bianchi


In this paper we introduce a new unit test technique called déjà-vu object. Déjà-vu objects replace real objects used by classes under test, allowing the execution of isolated unit tests. A déjà-vu object is able to observe and record the behaviour of a real object during real sessions, and to replace it during unit tests, returning previously recorded results. Consequently déjà-vu object technique can be useful when a bottom-up development and testing strategy is adopted. In this case déjà-vu objects can increase test portability and test source code readability. At the same time they can reduce the time spent by programmers to develop test code and the risk of incompatibility during the switching between déjà-vu and production code.

Keywords: Bottom-up testing approach, integration test, testportability, unit test

Digital Object Identifier (DOI):

Procedia APA BibTeX Chicago EndNote Harvard JSON MLA RIS XML ISO 690 PDF Downloads 2296


[1] G.J.Myers. The Art of Software Testing (second edition), John Wiley & Sons, Inc. 2004.
[2] R.Binder. Testing object-oriented systems: models, patterns, and tools, Reading Mass.: Addison-Wesley, 1999.
[3] T.Mackinnon, S.Freeman, P.Craig. "Endo-Testing: Unit Testing with Mock Objects", in Proceedings of the International Conference on eXtreme Programming and Flexible Process in Software Engineering (XP2000), 2000.
[4] K.Beck. Test-Driven Develpment by example, Addison-Wesley, 2003.
[5] E.Gamma, R.Helm, R.Johnson, J.Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software, Addison Wesley, 1994.
[6] K.Beck. Extreme programming explained: embrace change, Addison- Wesley, 1999.
[7] Mock object Web site,
[8] M.A.Brown, E.Tapolcsanyi. "Mock object patters", in Proceedings of The 10th Conference on Pattern Languages of Programs (PLOP03), 2003.
[9] V.Massol JUnit in action, Manning, 2004.
[10] S.Freeman, N.Pryce, T.Mackinnon, J.Walnes "Mock roles, not objects", in Proceedings of the 19th Annual ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2004).
[11] The Free Dictionary, Farlex, Inc., 2006 http://computingdictionary.
[12] The WebMINDS Project Web site,
[13] Advanced Distributed Learning Web site,
[14] Wikipedia - The free encyclopedia 2006, PABX definition,
[15] Ecma International Web site,