{"id":361,"date":"2022-05-16T17:27:57","date_gmt":"2022-05-16T16:27:57","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/?page_id=361"},"modified":"2024-12-05T14:39:19","modified_gmt":"2024-12-05T14:39:19","slug":"testing","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/testing\/","title":{"rendered":"Testing"},"content":{"rendered":"<p>Once the program has been written it is necessary to test\u00a0the program for any errors. The testing stage can take\u00a0quite a long time as the program must work under most\u00a0conditions.\u00a0\u200b<\/p>\n<p>There are three types of testing:\u00a0\u200b<\/p>\n<p><strong>Normal<\/strong>\u00a0(N) &#8211; Data the program should expect to handle.\u00a0\u200b<\/p>\n<p><strong>Extreme<\/strong>\u00a0(L) &#8211; Data at the limits of what the program should\u00a0handle.\u00a0\u200b<\/p>\n<p><strong>Exceptional<\/strong> (E) &#8211; Data which the program should not handle<\/p>\n<p>The aim of testing is to prevent software failure. Using normal, exceptional and extreme test data as part of a test plan will reduce the prevalence of syntax, logic and execution to errors in code.<\/p>\n<h2 style=\"color: red\">Test Tables<\/h2>\n<p>Test tables are used to provide a structure to testing.<\/p>\n<p>Programmers will often create a table with a selection of normal, extreme and exceptional data that they intend to use during testing. The table will include:<\/p>\n<ul>\n<li>a column for the expected result<\/li>\n<li>a column for what actually happens when the program runs<\/li>\n<\/ul>\n<p>The programmer will refer to the functional requirements created at the analysis phase to act as a reminder of the inputs that the program is expected to handle.<\/p>\n<h3 style=\"color: red\">What data to test<\/h3>\n<p>A test table should include:<\/p>\n<ul>\n<li>at least two items of normal data<\/li>\n<li>at least two items of exceptional data]<\/li>\n<li>both extreme values if testing a range of numbers<\/li>\n<\/ul>\n<p>It is also good practice to test the values immediately out with the accepted range as it is common to find errors that occur because of a selection statement that makes use of incorrect logical operators.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-362\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16172430\/Screenshot-2022-05-16-172416-300x107.png\" alt=\"\" width=\"852\" height=\"304\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16172430\/Screenshot-2022-05-16-172416-300x107.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16172430\/Screenshot-2022-05-16-172416-1024x365.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16172430\/Screenshot-2022-05-16-172416-768x274.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16172430\/Screenshot-2022-05-16-172416-624x223.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16172430\/Screenshot-2022-05-16-172416.png 1200w\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" \/><\/p>\n<h2 style=\"color: red\">Syntax, Execution and Logic errors<\/h2>\n<p style=\"margin: 0cm 0cm 12.0pt 0cm\"><span style=\"font-family: 'Arial',sans-serif;color: #231f20\">There are three types of error that you need to understand.<\/span><\/p>\n<h3 style=\"color: red\">Syntax error<\/h3>\n<p style=\"margin: 0cm 0cm 12.0pt 0cm\"><span style=\"font-family: 'Arial',sans-serif;color: #231f20\">The rule of the code is not being met, such as incorrect spelling, forgetting to include commas\/speech marks. A syntax error will be identified by an interpreter and will stop the code when the error is found..<\/span><\/p>\n<h3 style=\"color: red\">Execution error<\/h3>\n<p style=\"margin: 0cm 0cm 12.0pt 0cm\"><span style=\"font-family: 'Arial',sans-serif;color: #231f20\">Sometimes called a runtime error, execution errors only become evident during run time. An execution error occurs when a program is asked to do something that it cannot, resulting in a \u2018crash\u2019. The widely used example of a run time error is asking a program to divide by 0.<\/span><\/p>\n<h3 style=\"color: red\">Logic error<\/h3>\n<p>The program will run, but the outputs will be wrong due to an incorrect calculation or using <strong>&lt;<\/strong> instead of <strong>&gt;<\/strong> or <strong>AND<\/strong> rather than <strong>OR<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once the program has been written it is necessary to test\u00a0the program for any errors. The testing stage can take\u00a0quite a long time as the program must work under most\u00a0conditions.\u00a0\u200b There are three types of testing:\u00a0\u200b Normal\u00a0(N) &#8211; Data the program should expect to handle.\u00a0\u200b Extreme\u00a0(L) &#8211; Data at the limits of what the program [&hellip;]<\/p>\n","protected":false},"author":79984,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-361","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/users\/79984"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":5,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/361\/revisions"}],"predecessor-version":[{"id":615,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/361\/revisions\/615"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/media?parent=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}