کاهش زمان آزمون بازگشت در روش تولید آزمونرانه
محورهای موضوعی : فناوری اطلاعات و ارتباطاتزهره مافی 1 , سیدحسن میریان حسین آبادی 2
1 - پژوهشگاه ارتباطات و فناوری اطلاعات
2 -
کلید واژه: آزمون نرمافزار, تولید آزمونرانه, آزمون بازگشت, اختلاف دو برنامه, بخشبندی, کنترل نسخه,
چکیده مقاله :
تولید آزمونرانه یکی از شیوههای تولید نرمافزار اول آزمون است که در آن تولید هر جزء از کد با نوشتن آزمون شروع میگردد. این شیوه به دلیل مزایای فراوان ازجمله تولید کد خوانا، منظم، کوتاه و همچنین افزایش کیفیت، بهرهوری و قابلیت اطمینان موردتوجه قرار گرفته است. تعداد زیاد موارد آزمون تولیدشده در این روش به عنوان نقطه قوتی جهت افزایش قابلیت اطمینان مطرح است با این حال اجرای مکرر موارد آزمون، موجب افزایش زمان آزمون بازگشت است. هدف این مقاله ارائه روش انتخاب موارد آزمون جهت کاهش زمان آزمون بازگشت در شیوه تولید آزمونرانه است. تاکنون ایدههای مختلفی برای انتخاب موارد آزمون مطرح شده است. اغلب این ایدهها مبتنی بر زبان برنامهنویسی و شیوه تولید نرمافزار است. ایده ارائه شده در این مقاله مبتنی بر روش اختلاف برنامه و ماهیت شیوه تولید آزمونرانه اتخاذ گردیده است و ابزاری به صورت یک پلاگین در محیط Eclipse برای برنامههای زبان جاوا نوشته شده است. ابزار ارائه شده از پنج مولفه اصلی 1) مدیریت نسخههای برنامه، 2) بلاکبندی کد تولید شده، 3) تشخیص بلاکهای تغییریافته در هر نسخه نسبت به نسخه قبل، 4) ایجاد ارتباط معنایی بین آزمونهای واحد و بلاکهای کد و 5) انتخاب موارد آزمون تشکیل شده است.
Test-Driven Development (TDD) is one of the test-first software production methods in which the production of each component of the code begins with writing the test case. This method has been noticed due to many advantages, including the readable, regular, and short code, as well as increasing quality, productivity, and reliability. The large number of unit test cases produced in this method is considered as an advantage (increases the reliability of the code), however, the repeated execution of test cases increases the regression test time. The purpose of this article is to present an algorithm for selecting test cases to reduce the time of the regression test in the TDD method. So far, various ideas have been proposed to select test cases. Most of these ideas are based on programming language and software production methods. The idea presented in this article is based on the program difference method and the nature of the TDD method, also a tool is written as a plugin in Java Eclipse. The provided tool consists of five main components: 1) Version Manager, 2) Code Segmentation, 3) Code Change Detection (in each version compared to the previous version), 4) Semantic Connection Creation (between unit tests and code blocks), and finally 5) Test Cases Selection.
[1] K. Beck, Test Driven Development: By Example, Addison-Wesley, 2002
[2] M. Fowler, K. Beck, J. Brant, W. Opdyke and D. Roberts, Refactoring: Improving the Design of Existing Code, 1st ed., E. Gamma, Ed., Pearson Education India, 1999.
[3] L. Madeyski, "Emperical Studies on the impact of test first programming", Technical Report I32/09/, Wroclaw University of Technology, Instituteof Informatics, 2009.
[4] W. Bissi, A. G. Serra-Seca-Neto and M. C. F. Pereira Emer, "The effects of test driven development on internal quality, external quality and productivity: A systematic review", Information and Software Technology, vol. 74, pp. 45-54, 2016.
[5] S. Mäkinen and J. Münch, "Effects of Test-Driven Development: A Comparative Analysis of Empirical Studies", Proceedings of the 6th International Conference Software Quality, vol.6, pp. 155-169, 2014.
[6] R. H. Rosero, O. S. Gómez and G. Rodríguez, "15 years of software regression testing techniques—a survey" ,International Journal of Software Engineering and Knowledge Engineering, vol. 26, no. 5, pp. 675-689, 2016).
[7] P. Ammann, & J. Offutt (2016). Introduction to software testing. Cambridge University Press.
[8] A. Nanthaamornphong and J. C. Carver, "Test-Driven Development in scientific software: a survey", Software Quality Journal, vol. 25, no. 2, pp. 343-372, 2017.
]9[ ز. مافی و س.ح. ميريان حسين آبادی، "يک روش توليد آزمونرانه بهبود يافته"، کنفرانس ملی فناوريهاي نوين در مهندسی برق و کامپيوتر، اصفهان،1396.
[10] S. Yoo and M. Harman, "Regression testing minimization, selection and prioritization: a survey", Software Testing, Verification and Reliability, vol. 22, no. 2, pp. 67-120, 2012.
[11] D. Parsons, T. Susnjak and M. Lange, "Influences on regression testing strategies in agile software development environments," Software Quality Journal, vol. 22, no. 4, p. 717–739, 2014.
[12] E. W. Myers, "An O(ND) Difference Algorithm and Its Variations," Algorithmica, vol. 1, no. 1-4, pp. 251-266, 1986.
[13] F. I. Vokolos and P. Frankl, "Empirical evaluation of the textual differencing regression testing technique” , IEEE International Conference on Software Maintenance (Cat. No. 98CB36272), 1998.
[14] G. Canfora, L. Cerulo and M. D. Penta, "LDiff: an Enhanced Line Differencing Tool” , 31st International Conference on Software Engineering. IEEE Computer Society, 2009.
[15] M. Asaduzzaman, C. Roy, K. Schneider and M. Di Penta, "LHDiff: A language-independent hybrid approach for tracking source code lines" , IEEE International Conference on Software Maintenance, 2013.
[16] W. Yang, "Identifying syntactic differences between two programs" , Software: Practice and Experience, vol. 21, no. 7, pp. 739-755, 1991.
[17] J. I. Maletic and M. L. Collard, "Supporting Source Code Difference Analysis" , 20th IEEE International Conference on Software Maintenance, 2004.
[18] D. Archambault, "Structural differences between two graphs through hierarchies” , Proceedings of Graphics Interface , 2009.
[19] A. Goto, N. Yoshida, M. Ioka, E. Choi and K. Inoue, "How to extract differences from similar programs? A cohesion metric approach” , 7th International Workshop on Software Clones (IEEE Press), 2013.
[20] M. Linares-Vásquez, L. Cortés-Coy, J. Aponte and D. Poshyvanyk, "Changescribe: A tool for automatically generating commit messages” , 37th IEEE International Conference on Software Engineering, 2015.
[21] M. Kim and N. David, "Discovering and representing systematic code changes” , IEEE 31st International Conference on Software Engineering, 2009.
[22] J.-R. Falleri, M. Floréal, B. Xavier, M. Matias and M. Martin, "Fine-grained and Accurate Source Code Differencing” , 29th ACM/IEEE international conference on Automated software engineering, 2014.
[23] X. Wang, L. Pollock and K. Vijay-Shanker, "Automatic segmentation of method code into meaningful blocks to improve readability” , 18th Working Conference on Reverse Engineering IEEE, 2011.
[24] S. Horwitz, "Identifying The Semantic and Textual Differences Between Two Versions of a Program ” , ACM, vol. 25, no. 6, pp. 234-245, 1990.
[25] D. Binkley, "Using semantic differencing to reduce the cost of regression testing” , IEEE Conference on Software Maintenance , 1992.
[26] N. Iulian, F. S. Jeffrey and M. Hicks, "Understanding Source Code Evolution Using Abstract Syntax Tree Matching” , ACM SIGSOFT Software Engineering Notes, vol. 30, no. 4, pp. 1-5, 2005.
[27] T. Apiwattanapong, A. Orso and M. J. Harrold, "JDiff: A differencing technique and tool for object-oriented programs” , Automated Software Engineering, vol 14, pp. 3-36, 2007.
[28] M. Görg and J. Zhao, "Identifying semantic differences in AspectJ programs” , 18th international symposium on Software testing and analysis (ACM), 2009.
[29] T. Wang, K. Wang, X. SU and P. MA, "Detection of semantically similar code” , Frontiers of Computer Science, vol. 8, no. 6, pp. 996-1011, 2014.
[30] H. A. Nguyen, T. T. Nguyen, H. V. Nguyen and T. N. Nguyen, "idiff: Interaction-based program differencing tool” , 26th IEEE/ACM International Conference on Automated Software Engineering, 2011.
[31] O. Wolfgang, [Online]. Available: TDD Kata, https://www.programmingwithwolfgang.com/tdd-kata/ [Accessed April 28, 2024]
[32] R. Dyer, N. Hoan Anh, R. Hridesh and N. N. Tien, "Boa: A language and infrastructure for analyzing ultra-large-scale software repositories” , IEEE, 35th International Conference on Software Engineering (ICSE), 2013.
[33] N. C. Borle, M. Feghhi, E. Stroulia, R. Greiner and A. Hindle, "Analyzing the effects of test driven development in GitHub” , Empirical Software Engineering, vol. 23, no. 4, pp. 1931-1958, 2018.