JUnit A Study on Applying JUnit Framework to Document Knowledge of Object-Oriented Software Systems Email: {hsieh, s1669021}@ntut.edu.tw JUnit SyncFree 92 [16] SyncFree 1.0 [17] bug fixmerge CVS SyncFree LightWeight CMMI [19] traceability traceability P. G. Armour [2] refactoring [7] Legacy System [4][6] automatic regression test grain size abstraction level architecture-centric design pattern[3][8][12] multiple aspects unit testing, MAUT Java MAUT JUnit [10][14]Mock Object [4][6] Refactoring [4][6] Java [4][6] MAUT SyncFree MAUT MAUT Proceedings of the Second Taiwan Conference on Software Engineering, Taipei, Taiwan, 2006 48
SyncFree 1 SyncFree layered architecture[3] [8]SyncFree [18] LightWeight CMMI SyncFree scenario unit testsut use case functional test design pattern unit test DPUT Strategy [8] participants architecture unit testaut business rule unit test BRUT 3.2 JUnit 1 SyncFree 3.1 MAUT logic unit test LUT stub mock object stub mock object integration unit testiut collaboration unit test intra-package integration unit test Intra UIT package inter-package integration unit testinter UIT package JUnitJUnit test suite JUnit Mock Object Mock Object mock object 3.3 (MAUT Framework) MAUT Framework MAUT MAUT MAUT Instance design patterns Design Pattern MAUT Framework design patterns Strategy pattern MAUT Strategy Context Concrete Strategies 2 artifact MAUT MAUT Instance JUnit MAUT Framework MAUT Instance Proceedings of the Second Taiwan Conference on Software Engineering, Taipei, Taiwan, 2006 49
MAUT Instance (binds) MAUT Instance MAUT Instance JUnit MAUT Instance 2 MAUT 3.3 Legacy System MAUT Instance iterative and incremental Legacy System [11][15] MAUT Instance MAUT Instance bug report bug fix document reading code reading stubs mock objects concept verification concept revision functional enhancement test first functional revision functional testing MAUT Instance use case MAUT Instance 4.1 SyncFree SyncFree HTTP URL (1) 3 (2) 4 (3) (2) (4) Proceedings of the Second Taiwan Conference on Software Engineering, Taipei, Taiwan, 2006 50
5 FTP stubs mock objects 7 (3) SyncFree use case controller pattern [1] 7 use case controllerobjsyncservice 3 4 5 FTP 6 System Sequence Diagram MAUT Instance IUT IUT LUT LUT mock object HTTP 4.2 SyncFree (1) System Sequence Diagram [12] 6 (2) 7 SUT 4.3 (1) Proceedings of the Second Taiwan Conference on Software Engineering, Taipei, Taiwan, 2006 51
Strategy (2) Design Pattern MAUT Framework DPUT 8 (3) JUnit MAUT Instance MAUT Instance MAUT Instance 2 8 DPUT 8 DPUT Strategy pattern 8 control.verify() Strategy pattern Concrete Strategy Strategy MAUT MAUT MAUT LUT IUT [6] MAUT SUT DPUD AUT MAUT MAUT Instance use case controller pattern SUT use case controller 9 1 design pattern SUT 1 2 SUT 3 SUT 9 SUT model-based MAUT NSC-94-2213-E-027-035 [1] A. Aguiar, A. Sousa, and A. Pinto, Use-Case Controller, published in the EuroPLop 2001, 2001. [2] P. G. Armour, Not-Defect: The Mature Discipline of Testing, Communications of the ACM, Vol. 47, No. 10, October 2004. [3] F. Buschmann, R. Meunier, H. Rohnert, P. Sommerlad, and M. Stal, Pattern-Oriented Software Architecture: A System of Patterns, Volume 1, Wiley, 1996. [4] S. Demeyer, S. Ducasse, O. Nierstrase, Object-Oriented Reengineering Patterns, Elsevier Science, 2003. Proceedings of the Second Taiwan Conference on Software Engineering, Taipei, Taiwan, 2006 52
[5] EasyMock, http://www.easymock.org/, accessed June 2004. [6] M. C. Feathers, Working Effectively with Legacy Code, Prentice Hall PRT, 2005. [7] M. Fowler, Refactoring: Improving the Design of Existing Code, Addison-Wesley, 1999. [8] E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, 1995. [9] jmock, http://www.jmock.org/, accessed Oct. 2004. [10] JUnit, http://www.junit.org/, accessed May 2003. [11] A. Lakhotia, Understanding Someone Else's Code: An Analysis of Experience, Journal of Systems and Software, 1993, pp. 269-275. [12] C. Larman, Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process. 2nd, Prentice Hall PRT, 2002. [13] A. von Mayrhauser and A. M. Vans, Identification of Dynamic Comprehension Processes During Large Scale Maintenance, IEEE Transaction on Software Engineering, Vol. 22, No. 6, June 1996. [14] V. Massol and T. Husted, JUnit in Action, Manning, 2003. [15] V. Rajlich and N. Wilde, The Role of Concepts in Program Comprehension, in Proceeding of the 10th International Workshop on Program Comprehension, IEEE, 2002. [16] SyncFree: Java, NSC92-2218-E-027-020. [17] SyncFree2 SyncFree, NSC93-2218-E-027-039. [18] "SyncFree " pp. 184-189, TANET-20042004 10. [19] http://credit.csie.ncku.edu.tw/opensource/index.h tm, accessed Oct. 2004. Proceedings of the Second Taiwan Conference on Software Engineering, Taipei, Taiwan, 2006 53