{"id":565,"date":"2013-01-14T17:30:39","date_gmt":"2013-01-15T01:30:39","guid":{"rendered":"http:\/\/angryweasel.com\/blog\/?p=565"},"modified":"2013-01-16T09:05:17","modified_gmt":"2013-01-16T17:05:17","slug":"debugging-for-testers","status":"publish","type":"post","link":"https:\/\/angryweasel.com\/blog\/debugging-for-testers\/","title":{"rendered":"Debugging For Testers"},"content":{"rendered":"<p>I came across a few comments and statements recently that set off a slightly red (orange?) flag for me. The gist was that debugging was for coders, and that testers &#8220;just found the issues&#8221;. I get the context (or at least I think I get it) \u2013 I agree that all testers don&#8217;t have to be coders, and that all testers certainly don&#8217;t have to be debugging masters, but I<em><br \/>\n<\/em>don&#8217;t think that any testers should run away from a debugger in fear either.<\/p>\n<p>In fact, I&#8217;d say there&#8217;s a minimum amount of information that <span style=\"text-decoration: underline;\">every<\/span> tester should know about debuggers, regardless of whether they are monster-rock-star programmers, or part-time IT application validators. I&#8217;ll start a list here, and likely add to it when I&#8217;m annoyed.<\/p>\n<p>So here goes:<\/p>\n<p><strong>Things Every Tester Should Know About Debuggers<br \/>\n<\/strong><\/p>\n<ul>\n<li>\n<div><strong>Call Stacks<\/strong> &#8211; A &#8220;call stack&#8221; is a list of functions that led up to the application crash. Different debuggers display this differently, but it will look something like this:<\/div>\n<pre>FunctionThatCrashed\r\nFunction_Three\r\nFunction_Two\r\nFunction_One<\/pre>\n<p>Read this from bottom to top \u2013 Function_One called Function_Two, which called Function_Three, which called FunctionThatCrashed (which crashed).<\/p>\n<p>Typically you&#8217;ll see parameters after the functions, and those will probably give you a clue. If you&#8217;re working with developers, and you see a crash in the debugger, the call stack is probably the most important contextual information you, as a tester, can provide.<\/li>\n<li>\n<div><strong>Crash vs. Assert<\/strong> \u2013 When a program breaks into the debugger (meaning the program stops executing, and the debugger springs into action), the program may have crashed (e.g. attempted to read\/write to\/from invalid memory), or it could have broken at a developer-induced breakpoint (often in a macro called an &#8216;assert&#8217;). On x86 \/ amd64 platforms this shows up as an <span style=\"font-size: 10pt;\"><span style=\"font-family: Courier New;\">int 3<\/span><br \/>\n<\/span>or <span style=\"font-family: Courier New; font-size: 10pt;\">int 2C <\/span>in the debugger. The important thing to note in the case of the assert type of error is that <em>the reason for the break is obvious\u00a0<\/em> &#8211; or at least obvious if you can view the code. In practice, asserts often look like this:<\/div>\n<\/li>\n<\/ul>\n<pre>      bool bSuccess = CreateUserAccount();\r\n      \/\/break into the debugger of the call to CUA fails so we can debug\r\n      ASSERT(bSuccess == true);<\/pre>\n<p>When a tester sees this break, instead of saying, &#8220;The program crashed during logon&#8221;, they can say, &#8220;I&#8217;m hitting an assert because CreateUserAccount is failing on today&#8217;s build&#8221;. While both statements have value, the latter statement is much more informative, and in many cases actually <em>actionable<\/em>.<\/p>\n<ul>\n<li><strong>Basic Lingo<\/strong> \u2013 Know a little about a few basic types of crashes \u2013 e.g. Access Violation (AV), Stack Overflow, or Buffer Overrun, and know a little about what <em>causes <\/em> these errors (e.g. reading from a bad memory address, calling too many functions \u2013 usually via recursion, or putting too long of a string into a buffer). You don&#8217;t have to be an expert, but a little knowledge here goes a long, long way in diagnosing bugs and getting them fixed.<strong><br \/>\n<\/strong><\/li>\n<\/ul>\n<p>Off the top of my head, that seems like enough, but not that much. There&#8217;s certainly more to learn, but I think knowing just this much should be a minimum for any professional tester.<\/p>\n<p>More ideas \u2013 add &#8217;em to the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I came across a few comments and statements recently that set off a slightly red (orange?) flag for me. The gist was that debugging was for coders, and that testers &#8220;just found the issues&#8221;. I get the context (or at least I think I get it) \u2013 I agree that all testers don&#8217;t have to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-565","post","type-post","status-publish","format-standard","hentry","category-allposts"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/posts\/565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/comments?post=565"}],"version-history":[{"count":0,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/posts\/565\/revisions"}],"wp:attachment":[{"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/media?parent=565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/categories?post=565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angryweasel.com\/blog\/wp-json\/wp\/v2\/tags?post=565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}