{"id":22013,"date":"2018-07-03T15:41:04","date_gmt":"2018-07-03T19:41:04","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=22013"},"modified":"2018-07-03T15:41:04","modified_gmt":"2018-07-03T19:41:04","slug":"debugging-with-c-reduce","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/07\/03\/debugging-with-c-reduce\/","title":{"rendered":"Debugging With C-Reduce"},"content":{"rendered":"<p><a href=\"https:\/\/www.mikeash.com\/pyblog\/friday-qa-2018-06-29-debugging-with-c-reduce.html\">Mike Ash<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=17424442\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/www.mikeash.com\/pyblog\/friday-qa-2018-06-29-debugging-with-c-reduce.html\"><p>Debugging a complex problem is tough, and it can be especially difficult when it&rsquo;s not obvious which chunk of code is responsible. It&rsquo;s common to attempt to produce a reduced test case in order to narrow it down. It&rsquo;s tedious to do this manually, but it&rsquo;s also the sort of thing computers are really good at. C-Reduce is a program which automatically takes programs and pares them down to produce a reduced test case.<\/p><p>[&#8230;]<\/p><p>When you use C-Reduce, you provide not only a program to reduce but also a small script which tests whether a reduced program is &ldquo;interesting.&rdquo; Exactly what &ldquo;interesting&rdquo; means is up to you. If you&rsquo;re trying to isolate a bug, then &ldquo;interesting&rdquo; would mean that the bug still occurs in the program. You can define it to mean whatever you want, as long as you can script it. Whatever test you provide, C-Reduce will try to provide a reduced version of the program that still passes the test.<\/p>\n<p>[&#8230;]<\/p>\n<p>Blind reduction of a test case is not a very sophisticated debugging technique, but the ability to automate it can make it extremely useful. C-Reduce can be a fantastic addition to your debugging toolbox.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Mike Ash (Hacker News): Debugging a complex problem is tough, and it can be especially difficult when it&rsquo;s not obvious which chunk of code is responsible. It&rsquo;s common to attempt to produce a reduced test case in order to narrow it down. It&rsquo;s tedious to do this manually, but it&rsquo;s also the sort of thing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2018-07-03T19:41:06Z","apple_news_api_id":"5e43a2db-43d4-4d9b-9254-530fe9f665f9","apple_news_api_modified_at":"2018-07-03T19:41:06Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AXkOi20PUTZuSVFMP6fZl-Q","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[45,56,31,30,71,901,226],"class_list":["post-22013","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c","tag-debugging","tag-ios","tag-mac","tag-programming","tag-swift-programming-language","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22013","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=22013"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22013\/revisions"}],"predecessor-version":[{"id":22014,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22013\/revisions\/22014"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=22013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=22013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=22013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}