xNose: A Test Smell Detector for C# (2405.04063v1)
Abstract: Test smells, similar to code smells, can negatively impact both the test code and the production code being tested. Despite extensive research on test smells in languages like Java, Scala, and Python, automated tools for detecting test smells in C# are lacking. This paper aims to bridge this gap by extending the study of test smells to C#, and developing a tool (xNose) to identify test smells in this language and analyze their distribution across projects. We identified 16 test smells from prior studies that were language-independent and had equivalent features in C# and evaluated xNose, achieving a precision score of 96.97% and a recall score of 96.03%. In addition, we conducted an empirical study to determine the prevalence of test smells in xUnit-based C# projects. This analysis sheds light on the frequency and distribution of test smells, deepening our understanding of their impact on C# projects and test suites. The development of xNose and our analysis of test smells in C# code aim to assist developers in maintaining code quality by addressing potential issues early in the development process.
- Accessed 2022-15-10. Roslyn Api. https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/.
- Accessed 2022-15-10. Visual Studio. https://visualstudio.microsoft.com/.
- Accessed 2023-15-01. Aspnetboilerplate. https://github.com/aspnetboilerplate/aspnetboilerplate.
- Accessed 2023-15-01. C4Sharp. https://github.com/8T4/c4sharp.
- Accessed 2023-15-01. eShopOnWeb. https://github.com/dotnet-architecture/eShopOnWeb.
- Accessed 2023-15-01. GraphQl-Platform.GreenDonut. https://github.com/ChilliCream/graphql-platform.
- Accessed 2023-15-01a. GraphQl-Platform.HotChocolate.Caching. https://github.com/ChilliCream/graphql-platform.
- Accessed 2023-15-01b. GraphQl-Platform.HotChocolate.Core. https://github.com/ChilliCream/graphql-platform.
- Accessed 2023-15-01. NLog. https://github.com/NLog/NLog.
- Accessed 2023-15-01. Ocelot. https://github.com/ThreeMammals/Ocelot.
- Accessed 2023-15-01. Refit. https://github.com/reactiveui/refit.
- Accessed 2023-15-01. Scrutor. https://github.com/khellang/Scrutor.
- Accessed 2023-15-01. Skoruba.IdentityServer4.Admin. https://github.com/IdentityServer/IdentityServer4.
- Accessed on December 20, 2022. Test Smell Catalog. https://test-smell-catalog.readthedocs.io/en/latest/Issues%20in%20test%20steps/Issues%20in%20assertions/Inappropriate%20Assertions.html
- Accessed on July 13, 2023. Dataset for Empirical Study. https://anonymous.4open.science/r/xNose-4D3E/repoCollection.json
- An Empirical Study of Design Degradation: How Software Projects Get Worse over Time. 2015 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM) (2015), 1–10.
- Test Smell Detection Tools: A Systematic Mapping Study.
- An empirical analysis of the distribution of unit test smells and their impact on software maintenance. 2012 28th IEEE International Conference on Software Maintenance (ICSM) (2012), 56–65.
- Are test smells really harmful? An empirical study. Empirical Software Engineering 20 (2014), 1052 – 1094.
- Assessing diffusion and perception of test smells in scala projects. In IEEE Working Conference on Mining Software Repositories.
- Manuel Breugelmans and Bart Van Rompaey. 2008. Testq: Exploring structural and maintenance characteristics of unit test suites. In WASDeTT-1: 1st International Workshop on Advanced Software Development Tools and Techniques. Citeseer.
- Socrates: Scala radar for test smells. In Proceedings of the Tenth ACM SIGPLAN Symposium on Scala. 22–26.
- TEMPY: Test Smell Detector for Python. Proceedings of the XXXVI Brazilian Symposium on Software Engineering (2022).
- Comparing and experimenting machine learning techniques for code smell detection. Empirical Software Engineering 21 (2016), 1143–1191.
- Automatically identifying focal methods under test in unit test cases. In 2015 IEEE 15th International Working Conference on Source Code Analysis and Manipulation (SCAM). IEEE, 61–70.
- Automated Detection of Test Fixture Strategies and Smells. 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation (2013), 322–331.
- Some Code Smells Have a Significant but Small Effect on Faults. ACM Trans. Softw. Eng. Methodol. 23 (2014), 33:1–33:39.
- Exploring the benefits of utilizing conceptual information in test-to-code traceability. In Proceedings of the 6th International Workshop on Realizing Artificial Intelligence Synergies in Software Engineering. 8–14.
- Testroutes: A manually curated method level dataset for test-to-code traceability. In Proceedings of the 17th International Conference on Mining Software Repositories. 593–597.
- Dong Jae Kim. 2020. An Empirical Study on the Evolution of Test Smell. 2020 IEEE/ACM 42nd International Conference on Software Engineering: Companion Proceedings (ICSE-Companion) (2020), 149–151.
- Evidence-based software engineering and systematic reviews. Vol. 4. CRC press.
- Just-in-time test smell detection and refactoring: The darts project. In Proceedings of the 28th international conference on program comprehension. 441–445.
- Wei Li and Raed Shatnawi. 2007. An empirical study of the bad smells and class error probability in the post-release object-oriented system evolution. J. Syst. Softw. 80 (2007), 1120–1128.
- Gerard Meszaros. 2007. xUnit Test Patterns: Refactoring Test Code.
- NDepend. [n. d.]. Code diff since baseline. https://www.ndepend.com/features/code-diff#BuildComparison
- The evolution and impact of code smells: A case study of two open source systems. 2009 3rd International Symposium on Empirical Software Engineering and Measurement (2009), 390–400.
- Automatic test smell detection using information retrieval techniques. In 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 311–322.
- Tsdetect: An open source test smells detection tool. In Proceedings of the 28th ACM joint meeting on european software engineering conference and symposium on the foundations of software engineering. 1650–1654.
- On the distribution of test smells in open source android applications: An exploratory study. (2019).
- Kenneth Reitz and Tanya Schlusser. 2016. The Hitchhiker’s guide to Python: best practices for development. ” O’Reilly Media, Inc.”.
- Mauricio A. Saca. 2017. Refactoring improving the design of existing code. In 2017 IEEE 37th Central America and Panama Convention (CONCAPAN XXXVII). 1–3. https://doi.org/10.1109/CONCAPAN.2017.8278488
- RAIDE: a tool for Assertion Roulette and Duplicate Assert identification and refactoring. In Proceedings of the XXXIV Brazilian Symposium on Software Engineering. 374–379.
- On the Relation of Test Smells to Software Code Quality. 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME) (2018), 1–12.
- When and Why Your Code Starts to Smell Bad (and Whether the Smells Go Away). IEEE Transactions on Software Engineering 43 (2015), 1063–1088.
- Lionel Sujay Vailshery. 2021. Worldwide Developer Survey: Most Used Programming Languages 2021. https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/. Accessed: February 20, 2023.
- Refactoring test code. Report - Software engineering (2001), 1–6.
- Characterizing the Relative Significance of a Test Smell. In 2006 22nd IEEE International Conference on Software Maintenance. 391–400. https://doi.org/10.1109/ICSM.2006.18
- On the detection of test smells: A metrics-based approach for general fixture and eager test. IEEE Transactions on software engineering 33, 12 (2007), 800–817.
- Jnose: Java test smell detector. In Proceedings of the XXXIV Brazilian Symposium on Software Engineering. 564–569.
- On the influence of test smells on test coverage. In Proceedings of the XXXIII Brazilian Symposium on Software Engineering. 467–471.
- PyNose: A Test Smell Detector For Python. 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE) (2021), 593–605.
- xUnit.net. n.d.. Documentation. Retrieved March 1, 2023, from https://xunit.net/#documentation.
- Investigating the impact of design debt on software quality. In MTD ’11.