علوم رایانشی

علوم رایانشی

اندازه‌گیری تاثیر اصلاح نابسامانی‌های کد بر مصرف انرژی و پایداری سیستم

نوع مقاله : مقاله پژوهشی

نویسندگان
1 دانش‌آموخته کارشناسی ارشد نرم‌افزار، گروه مهندسی کامپیوتر، دانشکده فنی و مهندسی، دانشگاه شهرکرد، شهرکرد، ایران
2 استادیار، گروه مهندسی کامپیوتر، دانشکده فنی و مهندسی، دانشگاه شهرکرد، شهرکرد، ایران
10.22034/csj.2025.214938
چکیده
در سال‌های اخیر، بهینه‌سازی مصرف انرژی و ارتقای پایداری نرم‌افزار به یکی از دغدغه‌های اصلی در حوزه مهندسی نرم‌افزار تبدیل شده است. نابسامانی‌های کد، به‌عنوان عواملی که منجر به افزایش پیچیدگی، کاهش کارایی و تأثیرات منفی بر مصرف منابع می‌شوند، توجه پژوهشگران را به خود جلب کرده‌اند. این پژوهش با هدف بررسی تأثیر رفع نابسامانی‌های کد بر مصرف انرژی و زمان اجرای نرم‌افزار انجام شده است. برای این منظور، سه سوال تحقیق اصلی تدوین شده است: ۱) اصلاح نابسامانی‌ها چگونه بر مصرف انرژی تأثیر می‌گذارد؟ ۲) کدام نابسامانی‌ها بیشترین تأثیر را بر زمان اجرا دارند؟ ۳) آیا رفع نابسامانی‌ها به بهبود پایداری نرم‌افزار منجر می‌شود؟ در این راستا، هشت مطالعه موردی بر روی انواع نابسامانی‌های کد، طراحی و پیاده‌سازی شده است. در هر مطالعه، نسخه اولیه و اصلاح ‌شده کد از نظر زمان اجرا و مصرف انرژی با استفاده از ابزارهای دقیق اندازه‌گیری و تحلیل شدند. نتایج نشان داد که رفع نابسامانی‌ها در اغلب موارد منجر به بهبود خوانایی و کاهش پیچیدگی کد شده است. در چهار نمونه به ویژه در مورد مطالعه دستور سوییچ، زمان اجرای برنامه بهینه شده کمتر از برنامه نابسامان است. همچنین، در پنج نمونه میزان مصرف انرژی کد بهینه شده تقریبا کمتر از کد دارای نابسامانی است. برای مثال، در مطالعه استفاده افراطی از نوع داده اولیه 15 درصد کاهش مصرف انرژی را شاهد بوده‌ایم. با این حال، در نابسامانی‌هایی نظیر شیء خداوند و متد طولانی، به‌دلیل افزایش فراخوانی‌ها و مدیریت اشیاء، سربار پردازشی و مصرف انرژی در تکرارهای بالا افزایش یافته است.
کلیدواژه‌ها
موضوعات

  1. Guldner, R. Bender, C. Calero, G. S. Fernando, M. Funke, J. Gröger, L. M. Hilty, J. Hörnschemeyer, G.-D. Hoffmann, D. Junger, T. Kennes, S. Kreten, P. Lago, F. Mai, I. Malavolta, J. Murach, K. Obergöker, B. Schmidt, A. Tarara, J. P. De Veaugh-Geiss, S. Weber, M. Westing, V. Wohlgemuth, and S. Naumann, "Development and evaluation of a reference measurement model for assessing the resource and energy efficiency of software products and components—Green Software Measurement Model (GSMM)," Future Generation Computer Systems, vol. 155, pp. 402–418, 2024.
  2. Gupta, B. Suri, and S. Misra, “A systematic literature review: code bad smells in java source code,” in Computational Science and Its Applications–ICCSA 2017: 17th International Conference, Trieste, Italy, July 3-6, 2017, Proceedings, Part V, vol. 17, pp. 665-682. Springer International Publishing, 2017.
  3. Zhang, T. Hall, and N. Baddoo, "Code bad smells: a review of current knowledge," Journal of Software Maintenance and Evolution: Research and Practice, vol. 23, no. 3, pp. 179-202, 2011.
  4. Lacerda, F. Petrillo, M. Pimenta, and Y. G. Guéhéneuc, “Code smells and refactoring: A tertiary systematic review of challenges and observations,” Journal of Systems and Software, vol. 167, p. 110610, 2020.
  5. Imran, T. Kosar, J. Zola, and F. Bulut, "Predicting the impact of batch refactoring code smells on application resource consumption," in Proc. ACM Conference, 2023.
  6. Armand, R. Rajan, and A. T. Idgunji, "MLPerf Power: Benchmarking the energy efficiency of machine learning systems," arXiv preprint, arXiv: 2410. 12032, 2024.
  7. Bree and D. Ó Cinnéide, "Weighted metrics for the development of energy efficient software," in Proc. ACM Designing, vol. 24, pp. 1–6, 2024.
  8. Verma, K. Kumar, and H. K. Verma, "A study of relevant parameters influencing code smell prioritization in object-oriented software systems," in Proc. IEEE 6th International Conference on Signal Processing, Computing and Control (ISPCC), Solan, India, 2021, pp. 150–154, doi: 10.1109/ ISPCC53510.2021.9609478.
  9. S. Yadav, R. S. Rao, and A. Mishra, "An evaluation of multi-label classification approaches for method-level code smells detection," IEEE Access, vol. 9, pp. 3387856–3387870, 2024, doi: 10.1109/ACCESS.2024.3387856.
  10. C. B. Ribeiro, "Effects of applying energy efficient patterns," M.S. thesis, Instituto Superior de Engenharia do Porto, Portugal, 2023.
  11. Ournani, R. Rouvoy, P. Rust, and J. Penhoat, "Comparing the energy consumption of Java I/O libraries and methods," in Proc. 37th International Conference on Software Maintenance and Evolution (ICSME), 2021, pp. 1–12.
  12. -K. Hong, "Metrics for code quality check in SEED_mode.c," International Journal of Internet, Broadcasting and Communication, vol. 16, no. 3, pp. 184–191, 2024, doi: 10.7236/IJIBC.2024.16.3.184.
  13. Abdou and N. Darwish, "Severity classification of software code smells using machine learning techniques: A comparative study," Journal of Software Evolution and Process, e2454, 2022, doi: 10.1002/smr.2454.
  14. Bree and D. Ó Cinnéide, "Energy efficiency of the visitor pattern: Contrasting Java and C++ implementations," Empirical Software Engineering, vol. 28, no. 1, pp. 145, 2023, doi: 10.1007/s10664-023-10387-8.
  15. Gupta, B. Suri, D. Sharma, S. Misra, and L. Fernandez-Sanz, "Code smells analysis for android applications and a solution for less battery consumption," Scientific Reports, vol. 14, no. 1, p. 18194, 2024.
  16. Verma, K. Kumar, and H. K. Verma, "Code smell prioritization in object-oriented software systems: A systematic literature review," Journal of Software Evolution and Process, e2536, 2023, doi: 10.1002/smr.2536.
  17. Oumarou and Kolyang, "A source-code maintainability evaluation model for software products," Science, Engineering and Technology, vol. 3, no. 2, pp. 97–105, 2023, doi: 10.54327/set2023/v3.i2.73.
  18. Alkharabsheh, S. Alawadi, Y. Crespo, and J. Á. Taboada, "Exploring the role of project status information in effective code smell detection," Cluster Computing, vol. 28, no. 1, pp. 29, 2025, doi: 10.1007/s10586-024-04724-9.
  19. نسرین مقصودی شقاقی، لیلا صمیمی دهکردی، عباس حری، 1401، شناسایی نابسامانی‌های کد به کمک مهندسی معکوس مدل‌رانده، ششمین کنفرانس ملی کاربرد فناوری‌های نوین در علوم مهندسی، تربت حیدریه.