{"id":69398,"date":"2021-08-20T04:10:07","date_gmt":"2021-08-20T08:10:07","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/key-strategies-in-software-debugging-22\/"},"modified":"2021-08-20T04:10:07","modified_gmt":"2021-08-20T08:10:07","slug":"key-strategies-in-software-debugging-22","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=69398","title":{"rendered":"Key Strategies in Software Debugging #22"},"content":{"rendered":"<p><strong>Key Strategies in Software Debugging.<\/strong> <\/p>\n<p>1. Understand the requirements well.  Design the software well. Code well.<br \/>\nThese will reduce the number of defects in your system.<\/p>\n<p>2. Don&#8217;t use random guessing about defects. Use a systematic and scientific method to detect and fix bugs. <\/p>\n<p>3. Identify the root cause of a defect. Understand the program and then try to solve<\/p>\n<p>4. Set the compiler warning in it&#8217;s pickiest level. Solve all the issues as listed in the warning messages<\/p>\n<p>5. Make wise use of debugging tools but use your brain in parallel.<\/p>\n<p>Debugging? Is a process to find the cause of an error\/issue\/defect whereas testing is the process to find the error\/defect in the first place.<\/p>\n<p><strong>Defects are opportunities for a good programmer<\/strong>. How? When you are a good programmer, you will code well. <\/p>\n<p>Still if you have defects than something is missing somewhere, it will give you opportunities to learn many stuffs like:<\/p>\n<p>1. Check: Did you understand the program\/requirements?<\/p>\n<p>2. Learn: what kinds of mistakes you make<\/p>\n<p>3. Learn: how you solve problems4. How you fix defects<br \/>\nWhen you know your own patterns then there will be opportunities to improve yourself.<\/p>\n<p><strong>Bad ways to debug software:<\/strong><\/p>\n<p>1. Find defects by random guessing, by using print statements randomly.<\/p>\n<p>2. Don&#8217;t try to understand the program just find the defect and fix<\/p>\n<p>3. Use most obvious fix. You see the code does not work for 23 as input otherwise fine. So write a special case for 23<\/p>\n<p>4. Debugging by superstition.<\/p>\n<p><strong><br \/>\nFinding a Defect<\/strong><\/p>\n<p>Scientific method of debugging<\/p>\n<p>1. Stabilize the error through experiments. Be sure about the error and when it happens.<\/p>\n<p>2. Gather the data through repeatable experiments that produces the defect<\/p>\n<p>3. Form a hypothesis that states the cause of the error<\/p>\n<p>4. Design experiments to prove or disprove the hypothesis. <\/p>\n<p>5. Prove or disprove the hypothesis. <\/p>\n<p>6. Repeat as needed<\/p>\n<p>7. Fix the defect<\/p>\n<p>8. Test the fix<\/p>\n<p>9. Look for similar errors in your code.<\/p>\n<p><strong>Checklist for finding defects:<\/strong><\/p>\n<p>Reproduce the same error in several different ways.<\/p>\n<p>Brainstorm for possible hypotheses<\/p>\n<p>Use a notepad to list the things to try<\/p>\n<p>Find the suspicious region of your code<\/p>\n<p>Check the error-prone classes and routines<\/p>\n<p>Check recently modified\/added codes<\/p>\n<p>Check for common defects<\/p>\n<p>Check region by region. Expand your region after one region is covered<\/p>\n<p>Talk to someone about the problem<\/p>\n<p>Relax a bit. It works great sometimes. <\/p>\n<p>Reference: Code Complete, 2nd Edition by  Steve McConnel<\/p>\n<p>From: http:\/\/sitestree.com\/?p=4780<br \/> Categories:22<br \/>Tags:<br \/> Post Data:2006-11-06 07:32:26<\/p>\n<pre><code>    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\"&gt;https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    (Big Data, Cloud, Security, Machine Learning): Courses: &lt;a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"&gt; http:\/\/Training.SitesTree.com&lt;\/a&gt; \n    In Bengali: &lt;a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\"&gt;http:\/\/Bangla.SaLearningSchool.com&lt;\/a&gt;\n    &lt;a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\"&gt;http:\/\/SitesTree.com&lt;\/a&gt;\n    8112223 Canada Inc.\/JustEtc: &lt;a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\"&gt;http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) &lt;\/a&gt;\n    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com'&gt; https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    Medium: &lt;a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"&gt; https:\/\/medium.com\/@SayedAhmedCanada &lt;\/a&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Key Strategies in Software Debugging. 1. Understand the requirements well. Design the software well. Code well. These will reduce the number of defects in your system. 2. Don&#8217;t use random guessing about defects. Use a systematic and scientific method to detect and fix bugs. 3. Identify the root cause of a defect. Understand the program &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=69398\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-69398","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":70091,"url":"http:\/\/bangla.sitestree.com\/?p=70091","url_meta":{"origin":69398,"position":0},"title":"Debugging PHP code  under Eclipse PDT #16","author":"Author-Check- Article-or-Video","date":"August 25, 2021","format":false,"excerpt":"Click Here to Download: This is a great manual to understand clearly how to debug PHP code under eclipse PDT. However, remember that you need to install XDebugger or Zend Debugger along with Eclipse PDT. One option is, you download and install the right package with all components. Download the\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":62734,"url":"http:\/\/bangla.sitestree.com\/?p=62734","url_meta":{"origin":69398,"position":1},"title":"Histogram: Part &#8211; 3: Quality Control #PMP &#8211; Project Management","author":"Author-Check- Article-or-Video","date":"May 20, 2021","format":false,"excerpt":"Histogram: Pareto chart: Histogram-shows defects ranked from greatest to least. Pareto law: 80% problems come from 20% problems. Pareto chart is used to find the root causes of the problems. Run Chart: Displays quality over time. Example: Time\/month on X axis, defects per thousand on y axis. Scatter Diagram: Plot\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65677,"url":"http:\/\/bangla.sitestree.com\/?p=65677","url_meta":{"origin":69398,"position":2},"title":"Debugging in .Net, (XML Web Services) #Misc .Net","author":"Author-Check- Article-or-Video","date":"July 11, 2021","format":false,"excerpt":"Brought from: http:\/\/salearningschool.com\/displayArticle.php?table=Articles&articleID=1117&title=Debugging%20in%20.Net,%20(XML%20Web%20Services) Just listing some related notes. Tools: DbgClr -GUI Based, CorDbg - command line based You can use the debug menu. Start, Step Into, Step Over, New Breakpoint options - as available in most Good to great IDEs for debugging Watch Window: Check the values of variables and\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69390,"url":"http:\/\/bangla.sitestree.com\/?p=69390","url_meta":{"origin":69398,"position":3},"title":"Debugging in .Net, (XML Web Services) #24","author":"Author-Check- Article-or-Video","date":"August 20, 2021","format":false,"excerpt":"May not make sense to all. Just listing some related notes. Tools: DbgClr - GUI Based, CorDbg - command line based You can use the debug menu. Start, Step Into, Step Over, New Breakpoint options - as available in most Good to great IDEs for debugging Watch Window: Check the\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":21605,"url":"http:\/\/bangla.sitestree.com\/?p=21605","url_meta":{"origin":69398,"position":4},"title":"Remember.. #Web Development #Root #By Sayed Ahmed","author":"Author-Check- Article-or-Video","date":"March 3, 2021","format":false,"excerpt":"Remember: Just 2 cents... 1. Testing can never proof absence of errors 2. Testing by itself does not improve software quality 3. The best debugging skill, think right, write the right code...impossible to be 100% perfect on your first try, however, the better you do in writing the right code\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":22043,"url":"http:\/\/bangla.sitestree.com\/?p=22043","url_meta":{"origin":69398,"position":5},"title":"Configure Netbeans IDE for Debugging [PHP platform] #Software Development #Web Development #Root #PHP #Web Testing #Mobile Development #By Sayed Ahmed","author":"Author-Check- Article-or-Video","date":"March 9, 2021","format":false,"excerpt":"Presentation slides on this topic: click To enable xdebug debugging in Netbeans IDE php.ini needs some configuration [You will be able to debug PHP applications the way you do in Visual Studio, Turbo C\/C++ IDE] php.ini configuration Required ;XDEBUG Extension zend_extension = \"c:\/wamp\/bin\/php\/php5.4.12\/zend_ext\/php_xdebug-2.2.3-5.4-vc9-x86_64.dll\" [xdebug] xdebug.remote_enable=true xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.remote_handler=dbgp xdebug.profiler_enable=1 xdebug.profiler_output_dir\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/69398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69398"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/69398\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69398"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}