News
Detection of Multiple Enumeration in the C# Source Code Using Static Analysis
Abstract
This article is dedicated to the problem of multiple enumeration of lazy collections in C#, an antipattern that can lead to significant performance degradation and unpredictable program behavior. A static detector is proposed, implemented within the industrial static analyzer SharpChecker. The algorithm is based on symbolic execution sensitive to control flow and execution paths and supports interprocedural analysis. The detector identifies both repeated enumerations within a single method and those occurring through chains of called methods. Experimental evaluation on 20 open-source projects demonstrated a high true positive rate (approximately 95%). The results demonstrate the effectiveness and practical value of the proposed approach, allowing its integration as a core detector and providing the functionality to users.
Keywords
Edition
Proceedings of the Institute for System Programming, vol. 38, issue 6, part 1, 2026, pp. 9-22
ISSN 2220-6426 (Online), ISSN 2079-8156 (Print).
DOI: 10.15514/ISPRAS-2026-38(6)-1
For citation
Full text of the paper in pdf (in Russian)
Back to the contents of the volume