{"id":771,"date":"2021-07-03T11:11:00","date_gmt":"2021-07-03T09:11:00","guid":{"rendered":"http:\/\/blog.ansuz.nl\/?p=771"},"modified":"2023-01-25T18:28:29","modified_gmt":"2023-01-25T17:28:29","slug":"fuzz-testing","status":"publish","type":"post","link":"http:\/\/blog.ansuz.nl\/index.php\/2021\/07\/03\/fuzz-testing\/","title":{"rendered":"Fuzz testing"},"content":{"rendered":"\n<p>Last year at Droidcon Online Xavier Gouchet gave a talk titled: &#8220;<a href=\"https:\/\/www.droidcon.com\/media-detail?video=458602728\" target=\"_blank\" rel=\"noreferrer noopener\">It&#8217;s time to up your test game<\/a>&#8220;. Here he talked about testing and more specifically fuzz testing.<\/p>\n\n\n\n<p>Wikipedia describes fuzz testing as follows:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Fuzzing or fuzz testing is an automated software testing technique that involves providing invalid, unexpected, or random data as inputs to a computer program. The program is then monitored for exceptions such as crashes, failing built-in code assertions, or potential memory leaks.<\/p><cite><a href=\"https:\/\/en.wikipedia.org\/wiki\/Fuzzing\" target=\"_blank\" rel=\"noreferrer noopener\">Wikipedia<\/a><\/cite><\/blockquote>\n\n\n\n<p>In his talk he introduced <a href=\"https:\/\/github.com\/xgouchet\/Elmyr\" target=\"_blank\" rel=\"noreferrer noopener\">Elmyr<\/a>: <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>A Kotlin library providing tools to generate \u201crandom\u201d values. <\/p><cite>Elmyr github page<\/cite><\/blockquote>\n\n\n\n<p>Seeing how easy it was to use Elmyr, it got me inspired to start using it in my own projects as well. About a month ago I found some time to get started and I&#8217;m loving it! <\/p>\n\n\n\n<p>Adding and using Elmyr turned out to be super easy. It took very little time to get up and running.<\/p>\n\n\n\n<p>What surprised me most is that almost immediately I found a bug in my code due to the random test data that Elmyr produces!<\/p>\n\n\n\n<p>Another thing I really like is that I no longer need to think about what test data to use with my subject under test. All I need to do is ask Elmyr to give me some random data.<\/p>\n\n\n\n<p>If you need Elmyr to support some of your own classes for fuzzing, simply create a new <a href=\"https:\/\/github.com\/xgouchet\/Elmyr\/blob\/main\/core\/src\/main\/kotlin\/fr\/xgouchet\/elmyr\/ForgeryFactory.kt\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ForgeryFactory<\/code><\/a>, add it to the <code>Forge<\/code> in your test and you&#8217;re done.<\/p>\n\n\n\n<p>Now I wish that I learned about fuzz testing ages ago!<\/p>\n\n\n\n<p>If Elmyr doesn&#8217;t do the trick for you, Github hosts tons of other <a href=\"https:\/\/github.com\/topics\/fuzzing\" target=\"_blank\" rel=\"noreferrer noopener\">fuzzing libraries<\/a>.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Last year at Droidcon Online Xavier Gouchet gave a talk titled: &#8220;It&#8217;s time to up your test game&#8220;. Here he talked about testing and more specifically fuzz testing. Wikipedia describes fuzz testing as follows: Fuzzing or fuzz testing is an &hellip; <a href=\"http:\/\/blog.ansuz.nl\/index.php\/2021\/07\/03\/fuzz-testing\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[170,160],"tags":[125,171],"class_list":["post-771","post","type-post","status-publish","format-standard","hentry","category-general-programming","category-testing","tag-android-2","tag-fuzz"],"_links":{"self":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/comments?post=771"}],"version-history":[{"count":5,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/771\/revisions"}],"predecessor-version":[{"id":799,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/771\/revisions\/799"}],"wp:attachment":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/media?parent=771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/categories?post=771"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/tags?post=771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}