<?xml version="1.0" encoding="UTF-8"?>
<article article-type="research-article" dtd-version="1.3" xml:lang="ru" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://metafora.rcsi.science/xsd_files/journal3.xsd">
  <front>
    <journal-meta>
      <journal-id journal-id-type="publisher-id">moitvivt</journal-id>
      <journal-title-group>
        <journal-title xml:lang="ru">Моделирование, оптимизация и информационные технологии</journal-title>
        <trans-title-group xml:lang="en">
          <trans-title>Modeling, Optimization and Information Technology</trans-title>
        </trans-title-group>
      </journal-title-group>
      <issn pub-type="epub">2310-6018</issn>
      <publisher>
        <publisher-name>Издательство</publisher-name>
      </publisher>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.26102/2310-6018/2026.62.11.011</article-id>
      <article-id pub-id-type="custom" custom-type="elpub">2505</article-id>
      <title-group>
        <article-title xml:lang="ru">Классификация дефектов многопоточных программ как основа построения требований к тестированию</article-title>
        <trans-title-group xml:lang="en">
          <trans-title>Classification of defects in multithreaded programs as a basis for formulating testing requirements</trans-title>
        </trans-title-group>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <name-alternatives>
            <name name-style="eastern" xml:lang="ru">
              <surname>Шульга</surname>
              <given-names>Дмитрий Константинович</given-names>
            </name>
            <name name-style="western" xml:lang="en">
              <surname>Shulga</surname>
              <given-names>Dmitrii Konstantinovich</given-names>
            </name>
          </name-alternatives>
          <email>yurina_iriha@mail.ru</email>
          <xref ref-type="aff">aff-1</xref>
        </contrib>
      </contrib-group>
      <aff-alternatives id="aff-1">
        <aff xml:lang="ru">Санкт-Петербургский политехнический университет Петра Великого</aff>
        <aff xml:lang="en">Peter the Great St. Petersburg Polytechnic University</aff>
      </aff-alternatives>
      <pub-date pub-type="epub">
        <day>01</day>
        <month>01</month>
        <year>2026</year>
      </pub-date>
      <volume>1</volume>
      <issue>1</issue>
      <elocation-id>10.26102/2310-6018/2026.62.11.011</elocation-id>
      <permissions>
        <copyright-statement>Copyright © Авторы, 2026</copyright-statement>
        <copyright-year>2026</copyright-year>
        <license license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/">
          <license-p>This work is licensed under a Creative Commons Attribution 4.0 International License</license-p>
        </license>
      </permissions>
      <self-uri xlink:href="https://moitvivt.ru/ru/journal/article?id=2505"/>
      <abstract xml:lang="ru">
        <p>Рост вычислительной мощности многоядерных систем, распространение серверных платформ, облачных сервисов и высоконагруженных приложений привели к тому, что многопоточность стала одним из базовых механизмов современной разработки программного обеспечения. Вместе с тем расширение сферы её применения сопровождалось увеличением числа трудно обнаруживаемых нарушений, связанных не только с логикой алгоритма, но и с порядком исполнения конкурентных действий, организацией синхронизации, публикацией состояния и распределением доступа к общим ресурсам. В статье рассматривается проблема классификации дефектов многопоточных программ как необходимая теоретическая основа для построения эффективных методов тестирования. Цель работы состоит в систематизации основных типов конкурентных нарушений и формулировании требований к тестированию, вытекающих из их природы. Использованы системный и сравнительный анализ, структурно-логическая классификация дефектов, обобщение требований к инструментальным средствам и имитационное моделирование конкурентного исполнения. Выделены основные группы дефектов: состояния гонки, взаимные блокировки, livelock, голодание, нарушения видимости памяти, ошибки синхронизации, атомарностные и порядковые нарушения, дефекты жизненного цикла потоков и ресурсные конкурентные нарушения. Показано, что такие дефекты обладают отложенной наблюдаемостью, зависят от конкретных вариантов interleaving и нередко проявляются лишь в редких сценариях. На этой основе сформулированы ключевые требования к тестированию: учёт пространства расписаний, воспроизводимость, наблюдаемость межпоточных взаимодействий, контроль прогресса, чувствительность к модели памяти, сочетание статических и динамических методов, приемлемые накладные расходы. Впервые сформулирована проверяемая гипотеза о вероятностной природе обнаруживаемости конкурентных дефектов, введены количественные характеристики дефекта (окно конкуренции и коэффициент проявления) и предложен профиль наблюдаемости как критерий полноты тестирования; имитационный эксперимент подтверждает, что обнаруживаемость определяется режимом планирования, а не числом прогонов.</p>
      </abstract>
      <trans-abstract xml:lang="en">
        <p>The growth of multicore computing power and the widespread use of server platforms, cloud services, and high-load applications have made multithreading one of the basic mechanisms of modern software development. At the same time, the expansion of its use has been accompanied by an increase in hard-to-detect faults related not only to algorithmic logic but also to the order of concurrent actions, synchronization, state publication, and access to shared resources. The paper examines the classification of defects in multithreaded programs as a necessary theoretical basis for building effective testing methods. The purpose of the study is to systematize the main types of concurrency-related faults and formulate testing requirements arising from their nature. The methods used include systems and comparative analysis, structural classification of defects, generalization of requirements for verification tools, and simulation of concurrent execution. The main groups of defects are identified: race conditions, deadlocks, livelock, starvation, memory visibility violations, synchronization errors, atomicity and ordering violations, thread lifecycle defects, and concurrent resource defects. It is shown that such defects are characterized by delayed observability, depend on specific interleavings, and often manifest themselves only in rare execution scenarios. On this basis, the key testing requirements are formulated: accounting for the scheduling space, reproducibility, observability of inter-thread interactions, progress control, sensitivity to the memory model, integration of static and dynamic methods, and acceptable overhead. The paper formulates a testable hypothesis on the probabilistic nature of concurrency-defect detectability, introduces quantitative defect characteristics (the concurrency window and the manifestation coefficient), and proposes the observability profile as a testing-completeness criterion; simulation results confirm that detectability is governed by the scheduling regime rather than by the number of runs.</p>
      </trans-abstract>
      <kwd-group xml:lang="ru">
        <kwd>многопоточные программы</kwd>
        <kwd>состояния гонки</kwd>
        <kwd>взаимные блокировки</kwd>
        <kwd>синхронизация</kwd>
        <kwd>тестирование программного обеспечения</kwd>
        <kwd>конкурентное исполнение</kwd>
        <kwd>окно конкуренции</kwd>
        <kwd>коэффициент проявления</kwd>
        <kwd>имитационное моделирование</kwd>
      </kwd-group>
      <kwd-group xml:lang="en">
        <kwd>multithreaded programs</kwd>
        <kwd>race conditions</kwd>
        <kwd>deadlocks</kwd>
        <kwd>synchronization</kwd>
        <kwd>software testing</kwd>
        <kwd>concurrent execution</kwd>
        <kwd>concurrency window</kwd>
        <kwd>manifestation coefficient</kwd>
        <kwd>simulation modeling</kwd>
      </kwd-group>
      <funding-group>
        <funding-statement xml:lang="ru">Исследование выполнено без спонсорской поддержки.</funding-statement>
        <funding-statement xml:lang="en">The study was performed without external funding.</funding-statement>
      </funding-group>
    </article-meta>
  </front>
  <back>
    <ref-list>
      <title>References</title>
      <ref id="cit1">
        <label>1</label>
        <mixed-citation xml:lang="ru">Herlihy M., Shavit N., Luchangco V., Spear M. The Art of Multiprocessor Programming. Cambridge: Morgan Kaufmann; 2020. 576 p.</mixed-citation>
      </ref>
      <ref id="cit2">
        <label>2</label>
        <mixed-citation xml:lang="ru">Pacheco P., Malensek M. An Introduction to Parallel Programming. Cambridge: Morgan Kaufmann; 2021. 496 p.</mixed-citation>
      </ref>
      <ref id="cit3">
        <label>3</label>
        <mixed-citation xml:lang="ru">Кулямин В.В. Обзор методов динамического анализа программного обеспечения. Труды Института системного программирования РАН. 2023;35(4):7–44. https://doi.org/10.15514/ISPRAS-2023-35(4)-1</mixed-citation>
      </ref>
      <ref id="cit4">
        <label>4</label>
        <mixed-citation xml:lang="ru">Рагозина П.И., Игнатьев В.Н. Обнаружение ошибок взаимоисключающей блокировки в программах на языке C# при помощи методов статического анализа. Труды Института системного программирования РАН. 2022;34(4):63–78. https://doi.org/10.15514/ISPRAS-2022-34(4)-5</mixed-citation>
      </ref>
      <ref id="cit5">
        <label>5</label>
        <mixed-citation xml:lang="ru">Доронин О.В., Дергун К.И., Дергачев А.М., Ильина А.Г., Горлач С.П. Тестирование многопоточных приложений с блокировками на неатомарных переменных. Научно-технический вестник информационных технологий, механики и оптики. 2020;20(2):243–248. https://doi.org/10.17586/2226-1494-2020-20-2-243-248</mixed-citation>
      </ref>
      <ref id="cit6">
        <label>6</label>
        <mixed-citation xml:lang="ru">Герлиц Е.А., Мутилин В.С. Фреймворк автоматизации тестирования на гонки по данным. Труды Института системного программирования РАН. 2025;37(1):107–120.</mixed-citation>
      </ref>
      <ref id="cit7">
        <label>7</label>
        <mixed-citation xml:lang="ru">Руденчик В.П., Андрианов П.С., Мутилин В.С. Ограничение количества переключений потоков при динамическом анализе многопоточных программ. Труды Института системного программирования РАН. 2025;37(6):133–148.</mixed-citation>
      </ref>
      <ref id="cit8">
        <label>8</label>
        <mixed-citation xml:lang="ru">Lu Sh., Park S., Seo E., Zhou Y. Learning from Mistakes: A Comprehensive Study on Real World Concurrency Bug Characteristics. In: Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS XIII), 01–05 March 2008, Seattle, WA, USA. New York: ACM; 2008. P. 329–339. https://doi.org/10.1145/1346281.1346323</mixed-citation>
      </ref>
      <ref id="cit9">
        <label>9</label>
        <mixed-citation xml:lang="ru">Musuvathi M., Qadeer Sh., Ball Th., Basler G., Nainar P.A., Neamtiu I. Finding and Reproducing Heisenbugs in Concurrent Programs. In: 8th USENIX Symposium on Operating Systems Design and Implementation (OSDI 2008), 08–10 December 2008, San Diego, CA, USA. USENIX Association; 2008. P. 267–280.</mixed-citation>
      </ref>
      <ref id="cit10">
        <label>10</label>
        <mixed-citation xml:lang="ru">Lee E.A. The problem with threads. Computer. 2006;39(5):33–42. https://doi.org/10.1109/MC.2006.180</mixed-citation>
      </ref>
      <ref id="cit11">
        <label>11</label>
        <mixed-citation xml:lang="ru">Sutter H., Larus J. Software and the concurrency revolution: Leveraging the full power of multicore processors demands new tools and new thinking from the software industry. Queue. 2005;3(7):54–62. https://doi.org/10.1145/1095408.1095421</mixed-citation>
      </ref>
      <ref id="cit12">
        <label>12</label>
        <mixed-citation xml:lang="ru">Kleppmann M. Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems. Sebastopol: O'Reilly Media; 2017. 616 p.</mixed-citation>
      </ref>
    </ref-list>
    <fn-group>
      <fn fn-type="conflict">
        <p>The authors declare that there are no conflicts of interest present.</p>
      </fn>
    </fn-group>
  </back>
</article>