<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">mais</journal-id><journal-title-group><journal-title xml:lang="ru">Моделирование и анализ информационных систем</journal-title><trans-title-group xml:lang="en"><trans-title>Modeling and Analysis of Information Systems</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">1818-1015</issn><issn pub-type="epub">2313-5417</issn><publisher><publisher-name>Yaroslavl State University</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.18255/1818-1015-2014-6-83-93</article-id><article-id custom-type="elpub" pub-id-type="custom">mais-73</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>Оригинальные статьи</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="en"><subject>Articles</subject></subj-group></article-categories><title-group><article-title>Использование метода ограниченной проверки моделей для генерации тестов</article-title><trans-title-group xml:lang="en"><trans-title>Using a Bounded Model Checker for Test Generation: How to Kill Two Birds with One SMT-solver</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Петров</surname><given-names>Максим Алексеевич</given-names></name><name name-style="western" xml:lang="en"><surname>Petrov</surname><given-names>Maxim</given-names></name></name-alternatives><bio xml:lang="ru"><p>аспирант, 195251, Россия, г. Санкт-Петербург, Политехническая ул., 29</p></bio><bio xml:lang="en"><p>аспирант, Polytechnicheskaya street, 29, Saint-Petersburg 195251 Russia</p></bio><email xlink:type="simple">maxim.petrov@kspt.icc.spbstu.ru</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Гагарский</surname><given-names>Кирилл Алексеевич</given-names></name><name name-style="western" xml:lang="en"><surname>Gagarski</surname><given-names>Kirill</given-names></name></name-alternatives><bio xml:lang="ru"><p>исследователь, 195251, Россия, г. Санкт-Петербург, Политехническая ул., 29</p></bio><bio xml:lang="en"><p>исследователь, Polytechnicheskaya street, 29, Saint-Petersburg 195251 Russia</p></bio><email xlink:type="simple">gagarski@kspt.icc.spbstu.ru</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Беляев</surname><given-names>Михаил Анатольевич</given-names></name><name name-style="western" xml:lang="en"><surname>Belyaev</surname><given-names>Mikhail</given-names></name></name-alternatives><bio xml:lang="ru"><p>аспирант, 195251, Россия, г. Санкт-Петербург, Политехническая ул., 29</p></bio><bio xml:lang="en"><p>аспирант, Polytechnicheskaya street, 29, Saint-Petersburg 195251 Russia</p></bio><email xlink:type="simple">belyaev@kspt.icc.spbstu.ru</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Ицыксон</surname><given-names>Владимир Михайлович</given-names></name><name name-style="western" xml:lang="en"><surname>Itsykson</surname><given-names>Vladimir</given-names></name></name-alternatives><bio xml:lang="ru"><p>доцент, 195251, Россия, г. Санкт-Петербург, Политехническая ул., 29</p></bio><bio xml:lang="en"><p>доцент, Polytechnicheskaya street, 29, Saint-Petersburg 195251 Russia</p></bio><email xlink:type="simple">vlad@icc.spbstu.ru</email><xref ref-type="aff" rid="aff-1"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru"><institution>Санкт-Петербургский государственный политехнический университет</institution><country>Россия</country></aff><aff xml:lang="en"><institution>Saint-Petersburg State Polytechnic University</institution><country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2014</year></pub-date><pub-date pub-type="epub"><day>20</day><month>12</month><year>2014</year></pub-date><volume>21</volume><issue>6</issue><fpage>83</fpage><lpage>93</lpage><permissions><copyright-statement>Copyright &amp;#x00A9; Петров М.А., Гагарский К.А., Беляев М.А., Ицыксон В.М., 2014</copyright-statement><copyright-year>2014</copyright-year><copyright-holder xml:lang="ru">Петров М.А., Гагарский К.А., Беляев М.А., Ицыксон В.М.</copyright-holder><copyright-holder xml:lang="en">Petrov M., Gagarski K., Belyaev M., Itsykson V.</copyright-holder><license xml:lang="ru" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>Данная работа распространяется под лицензией Creative Commons Attribution 4.0.</license-p></license><license xml:lang="en" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://www.mais-journal.ru/jour/article/view/73">https://www.mais-journal.ru/jour/article/view/73</self-uri><abstract><p>В настоящее время автоматическая генерация тестов исследуется все более и более активно, поскольку является решением многих проблем, связанных с тестированием программного обеспечния (ПО), таких как необходимость написания тестов и обеспечения тестового покрытия с учетом человеческого фактора.</p><p>Наиболее перспективным методом автоматической генерации тестов является динамическое символьное исполнение (dynamic symbolic execution, DSE), выполняемое с помощью автоматического решателя ограничений, например SMT-решателя. Данный метод во многом похож на метод ограниченной проверки моделей, который также предполагает построение моделей из исходного кода, проверку логических свойств на них и обработку полученной модели.</p><p>В данной работе рассматривается метод генерации модульных тестов для языка C, основанный на методе ограниченной проверки моделей. Показано, что эти методы имеют много общего и могут быть реализованы с использованием общих базовых компонентов. Реализован прототип средства генерации тестов, основанный на работающем средстве ограниченной проверки моделей Borealis.</p><p>Прототип средства был опробован на множестве примеров и показал хорошие результаты с точки зрения полноты тестового покрытия и избыточности тестового набора.</p></abstract><trans-abstract xml:lang="en"><p>The automated test generation has received a lot of attention in the last decades as it is one of possible solutions to software testing inherent problems: the need to write tests and providing test coverage in presence of human factor. The most promising technique of generating a test automatically is the dynamic symbolic execution assisted by an automated constraint solver, e. g., an SMT-solver. This process is very similar to the bounded model checking, which also has to deal with generating models from a source code, asserting logic properties in it and process the returned model. This paper describes a prototype unit test generator for C based on a working bounded model checker called Borealis and shows that these two techniques are very similar and can be easily implemented by using the same basic components. The prototype test generator was sampled on a number of examples and showed good results in terms of test coverage and test excessiveness.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>автоматическая генерация тестов</kwd><kwd>динамическое символьное выполнение</kwd><kwd>ограниченная проверка моделей</kwd><kwd>контракты кода</kwd><kwd>SMT</kwd></kwd-group><kwd-group xml:lang="en"><kwd>automated test generation</kwd><kwd>dynamic symbolic execution</kwd><kwd>bounded model checking</kwd><kwd>satisfiability modulo theories</kwd><kwd>function contracts</kwd></kwd-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">Marat Akhin, Mikhail Belyaev, and Vladimir Itsykson. Yet another defect detection: Combining bounded model checking and code contracts // PSSV’13. 2013. P. 1–11.</mixed-citation><mixed-citation xml:lang="en">Marat Akhin, Mikhail Belyaev, and Vladimir Itsykson. Yet another defect detection: Combining bounded model checking and code contracts // PSSV’13. 2013. P. 1–11.</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Alessandro Armando, Jacopo Mantovani, and Lorenzo Platania. Bounded model checking of software using SMT solvers instead of SAT solvers // Int. J. Softw. Tools Technol. Transf. 2009. 11(1). P. 69–83.</mixed-citation><mixed-citation xml:lang="en">Alessandro Armando, Jacopo Mantovani, and Lorenzo Platania. Bounded model checking of software using SMT solvers instead of SAT solvers // Int. J. Softw. Tools Technol. Transf. 2009. 11(1). P. 69–83.</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">Patrick Baudin, Jean C. Filliˆatre, Thierry Hubert, Claude March´e, Benjamin Monate, Yannick Moy, and Virgile Prevosto // ACSL: ANSI/ISO C Specification Language. Preliminary Design, version 1.4, 2008., preliminary edition, may 2008.</mixed-citation><mixed-citation xml:lang="en">Patrick Baudin, Jean C. Filliˆatre, Thierry Hubert, Claude March´e, Benjamin Monate, Yannick Moy, and Virgile Prevosto // ACSL: ANSI/ISO C Specification Language. Preliminary Design, version 1.4, 2008., preliminary edition, may 2008.</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">Kent Beck. Test-driven development: by example. Addison-Wesley Professional, 2003.</mixed-citation><mixed-citation xml:lang="en">Kent Beck. Test-driven development: by example. Addison-Wesley Professional, 2003.</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">Boris Beizer. Software testing techniques. Dreamtech Press, 2003.</mixed-citation><mixed-citation xml:lang="en">Boris Beizer. Software testing techniques. Dreamtech Press, 2003.</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">Dirk Beyer. Competition on software verification // TACAS’12. Springer, 2012. P. 504–524.</mixed-citation><mixed-citation xml:lang="en">Dirk Beyer. Competition on software verification // TACAS’12. Springer, 2012. P. 504–524.</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">Armin Biere, Alessandro Cimatti, Edmund M. Clarke, and Yunshan Zhu. Symbolic model checking without BDDs // TACAS’9. 1999. P. 193–207.</mixed-citation><mixed-citation xml:lang="en">Armin Biere, Alessandro Cimatti, Edmund M. Clarke, and Yunshan Zhu. Symbolic model checking without BDDs // TACAS’9. 1999. P. 193–207.</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">Edmund Clarke, Daniel Kroening, and Flavio Lerda. A tool for checking ANSI-C programs // TACAS’04. 2004. P. 168–176.</mixed-citation><mixed-citation xml:lang="en">Edmund Clarke, Daniel Kroening, and Flavio Lerda. A tool for checking ANSI-C programs // TACAS’04. 2004. P. 168–176.</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">David M Cohen, Siddhartha R Dalal, Jesse Parelius, and Gardner C Patton. The combinatorial design approach to automatic test generation // IEEE software. 1996. 13(5). P. 83–88.</mixed-citation><mixed-citation xml:lang="en">David M Cohen, Siddhartha R Dalal, Jesse Parelius, and Gardner C Patton. The combinatorial design approach to automatic test generation // IEEE software. 1996. 13(5). P. 83–88.</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">Lucas Cordeiro, Bernd Fischer, and Joao Marques-Silva. SMT-based bounded model checking for embedded ANSI-C software // ASE’09. 2009. P. 137–148.</mixed-citation><mixed-citation xml:lang="en">Lucas Cordeiro, Bernd Fischer, and Joao Marques-Silva. SMT-based bounded model checking for embedded ANSI-C software // ASE’09. 2009. P. 137–148.</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">Leonardo De Moura and Nikolaj Bjørner. Z3: An efficient SMT solver. 2008. P. 337–340.</mixed-citation><mixed-citation xml:lang="en">Leonardo De Moura and Nikolaj Bjørner. Z3: An efficient SMT solver. 2008. P. 337–340.</mixed-citation></citation-alternatives></ref><ref id="cit12"><label>12</label><citation-alternatives><mixed-citation xml:lang="ru">RA DeMilli and A. Jefferson Offutt. Constraint-based automatic test data generation // Software Engineering, IEEE Transactions on. 1991. 17(9). P. 900–910.</mixed-citation><mixed-citation xml:lang="en">RA DeMilli and A. Jefferson Offutt. Constraint-based automatic test data generation // Software Engineering, IEEE Transactions on. 1991. 17(9). P. 900–910.</mixed-citation></citation-alternatives></ref><ref id="cit13"><label>13</label><citation-alternatives><mixed-citation xml:lang="ru">Patrice Godefroid, Nils Klarlund, and Koushik Sen. DART: directed automated random testing // ACM Sigplan Notices. ACM, 2005. Vol. 40. P. 213–223.</mixed-citation><mixed-citation xml:lang="en">Patrice Godefroid, Nils Klarlund, and Koushik Sen. DART: directed automated random testing // ACM Sigplan Notices. ACM, 2005. Vol. 40. P. 213–223.</mixed-citation></citation-alternatives></ref><ref id="cit14"><label>14</label><citation-alternatives><mixed-citation xml:lang="ru">Richard Hamlet. Random testing // Encyclopedia of software Engineering, 1994.</mixed-citation><mixed-citation xml:lang="en">Richard Hamlet. Random testing // Encyclopedia of software Engineering, 1994.</mixed-citation></citation-alternatives></ref><ref id="cit15"><label>15</label><citation-alternatives><mixed-citation xml:lang="ru">Franjo Ivanˇci´c and Sriram Sankaranarayanan. NECLA static analysis benchmarks.</mixed-citation><mixed-citation xml:lang="en">Franjo Ivanˇci´c and Sriram Sankaranarayanan. NECLA static analysis benchmarks.</mixed-citation></citation-alternatives></ref><ref id="cit16"><label>16</label><citation-alternatives><mixed-citation xml:lang="ru">Anil Kumar and J St Clair. Cunit-a unit testing framework for c // Diposnıvel em: http://cunit. sourceforge. net/doc/index. html. Acesso em, 25, 2005.</mixed-citation><mixed-citation xml:lang="en">Anil Kumar and J St Clair. Cunit-a unit testing framework for c // Diposnıvel em: http://cunit. sourceforge. net/doc/index. html. Acesso em, 25, 2005.</mixed-citation></citation-alternatives></ref><ref id="cit17"><label>17</label><citation-alternatives><mixed-citation xml:lang="ru">Chris Lattner. LLVM and Clang: Next generation compiler technology // The BSD Conference, 2008.</mixed-citation><mixed-citation xml:lang="en">Chris Lattner. LLVM and Clang: Next generation compiler technology // The BSD Conference, 2008.</mixed-citation></citation-alternatives></ref><ref id="cit18"><label>18</label><citation-alternatives><mixed-citation xml:lang="ru">Chris Lattner and Vikram Adve. LLVM: A compilation framework for lifelong program analysis &amp; transformation // CGO’04. 2004. P. 75–86.</mixed-citation><mixed-citation xml:lang="en">Chris Lattner and Vikram Adve. LLVM: A compilation framework for lifelong program analysis &amp; transformation // CGO’04. 2004. P. 75–86.</mixed-citation></citation-alternatives></ref><ref id="cit19"><label>19</label><citation-alternatives><mixed-citation xml:lang="ru">Florian Merz, Stephan Falke, and Carsten Sinz. LLBMC: Bounded model checking of C and C++ programs using a compiler IR // VSTTE’12. 2012. P. 146–161.</mixed-citation><mixed-citation xml:lang="en">Florian Merz, Stephan Falke, and Carsten Sinz. LLBMC: Bounded model checking of C and C++ programs using a compiler IR // VSTTE’12. 2012. P. 146–161.</mixed-citation></citation-alternatives></ref><ref id="cit20"><label>20</label><citation-alternatives><mixed-citation xml:lang="ru">Bertrand Meyer. Applying ‘design by contract’ // Computer. 1992. 25(10). P. 40–51.</mixed-citation><mixed-citation xml:lang="en">Bertrand Meyer. Applying ‘design by contract’ // Computer. 1992. 25(10). P. 40–51.</mixed-citation></citation-alternatives></ref><ref id="cit21"><label>21</label><citation-alternatives><mixed-citation xml:lang="ru">Glenford J Myers, Corey Sandler, and Tom Badgett // The art of software testing. John Wiley &amp; Sons, 2011.</mixed-citation><mixed-citation xml:lang="en">Glenford J Myers, Corey Sandler, and Tom Badgett // The art of software testing. John Wiley &amp; Sons, 2011.</mixed-citation></citation-alternatives></ref><ref id="cit22"><label>22</label><citation-alternatives><mixed-citation xml:lang="ru">Clementine Nebut, Franck Fleurey, Yves Le Traon, and J-M Jezequel. Automatic test generation: A use case driven approach // Software Engineering, IEEE Transactions on. 2006. 32(3). P. 140–155.</mixed-citation><mixed-citation xml:lang="en">Clementine Nebut, Franck Fleurey, Yves Le Traon, and J-M Jezequel. Automatic test generation: A use case driven approach // Software Engineering, IEEE Transactions on. 2006. 32(3). P. 140–155.</mixed-citation></citation-alternatives></ref><ref id="cit23"><label>23</label><citation-alternatives><mixed-citation xml:lang="ru">Carlos Pacheco, Shuvendu K Lahiri, Michael D Ernst, and Thomas Ball. Feedback-directed random test generation // Software Engineering, 2007. ICSE 2007. 29th International Conference on. IEEE, 2007. P. 75–84.</mixed-citation><mixed-citation xml:lang="en">Carlos Pacheco, Shuvendu K Lahiri, Michael D Ernst, and Thomas Ball. Feedback-directed random test generation // Software Engineering, 2007. ICSE 2007. 29th International Conference on. IEEE, 2007. P. 75–84.</mixed-citation></citation-alternatives></ref><ref id="cit24"><label>24</label><citation-alternatives><mixed-citation xml:lang="ru">Koushik Sen, Darko Marinov, and Gul Agha. CUTE: a concolic unit testing engine for C // ACM, 2005. Vol. 30.</mixed-citation><mixed-citation xml:lang="en">Koushik Sen, Darko Marinov, and Gul Agha. CUTE: a concolic unit testing engine for C // ACM, 2005. Vol. 30.</mixed-citation></citation-alternatives></ref><ref id="cit25"><label>25</label><citation-alternatives><mixed-citation xml:lang="ru">Nikolai Tillmann and Jonathan De Halleux. Pex—white box test generation for .Net // Tests and Proofs. Springer, 2008. P. 134–153.</mixed-citation><mixed-citation xml:lang="en">Nikolai Tillmann and Jonathan De Halleux. Pex—white box test generation for .Net // Tests and Proofs. Springer, 2008. P. 134–153.</mixed-citation></citation-alternatives></ref><ref id="cit26"><label>26</label><citation-alternatives><mixed-citation xml:lang="ru">Tao Xie, Nikolai Tillmann, Jonathan de Halleux, and Wolfram Schulte. Fitness-guided path exploration in dynamic symbolic execution // IEEE, 2009. P. 359–368.</mixed-citation><mixed-citation xml:lang="en">Tao Xie, Nikolai Tillmann, Jonathan de Halleux, and Wolfram Schulte. Fitness-guided path exploration in dynamic symbolic execution // IEEE, 2009. P. 359–368.</mixed-citation></citation-alternatives></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>
