{"id":436,"date":"2023-01-24T11:22:50","date_gmt":"2023-01-24T11:22:50","guid":{"rendered":"http:\/\/learnlearn.uk\/ibcs\/?page_id=436"},"modified":"2023-02-24T14:08:33","modified_gmt":"2023-02-24T14:08:33","slug":"choosing-test-data","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/","title":{"rendered":"Choosing Test Data"},"content":{"rendered":"<div class=\"responsive-tabs\">\n<h2 class=\"tabtitle\">Testing Data<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Choosing Testing Data<\/h3>\n<p>It is important that you choose test data that simulates a wide variety of usage and especially that you choose data that tests the three types of test data:<\/p>\n<ul>\n<li>Normal<\/li>\n<li>Boundary<\/li>\n<li>Extreme<\/li>\n<li>Abnormal<\/li>\n<\/ul>\n<p>When White Box Testing, as you have access to the source code, you should ensure that your test data covers all the possible programs paths for that function or module.<\/p>\n<p><strong>Example<\/strong><\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre>age = input(\"How old are you?\")\r\nif not age.isdigit():\r\n    print(\"Age must be a whole number\")\r\nelif int(age) &lt; 0:\r\n    print(\"Age must be greater than or equal to zero\")\r\nelif int(age) &lt; 10:\r\n\tprint(\"You are young\")\r\nelif int(age) &gt; 70:\r\n\tprint(\"You are old!\")\r\nelse:\r\n\tprint(\"You are a normal age\")\r\n<\/pre>\n<\/div>\n<p>In the code above there are 5 possible paths in the program to test and so your test data should probably include values\u00a0 such as:<\/p>\n<ul>\n<li>2.5<\/li>\n<li>-1<\/li>\n<li>5<\/li>\n<li>20<\/li>\n<li>100<\/li>\n<\/ul>\n\n<\/div><h2 class=\"tabtitle\">Normal<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Normal Data<\/h3>\n<p>Normal Data is data that you would usually<strong> expect<\/strong> to be input within reasonable bounds.<\/p>\n<p>For a user&#8217;s age, you would probably expect a whole number between 10 and 80<\/p>\n<p>&nbsp;<\/p>\n\n<\/div><h2 class=\"tabtitle\">Abnormal<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Abnormal Test Data<\/h3>\n<p>This is test data is unexpected and needs to be handled appropriately.<\/p>\n<p>For a user&#8217;s age, you should check:<\/p>\n<ul>\n<li>Float style input (e.g.\u00a0 2.5)<\/li>\n<li>Character input (e.g. twenty five)<\/li>\n<li>Mixed input( e.g. 25 Years Old)<\/li>\n<li>Zero length string input (e.g. &#8220;&#8221;)<\/li>\n<\/ul>\n\n<\/div><h2 class=\"tabtitle\">Boundary<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Boundary Test Data<\/h3>\n<p>Boundary test data incorporates two main areas:<\/p>\n<ul>\n<li>The data at the very limits of what is deemed normal, to ensure that is allowed (but perhaps with a warning\/notification)<\/li>\n<li>Data that sits on the boundary between two normal ranges, to ensure that the program branches correctly.<\/li>\n<\/ul>\n<p>Boundary test data is extremely important as often logical errors can be found are boundaries.<\/p>\n<p><strong>Example<\/strong><\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre>try:\r\n\ttemp = int(input(\"What is the temperature?\"))\r\n\t\r\n\tif temp &lt; 0:\r\n\t\tprint(\"It's freezing!\")\r\n\telif temp &gt; 0:\r\n\t\tprint(\"It's not freezing:\")\r\n\t\r\nexcept:\r\n\tprint(\"Invalid temperature\")\r\n<\/pre>\n<\/div>\n<p>In the code above a subtle error has been included in the code. If the user inputs the temperature as 0, then nothing at all will be printed out. This error would be highlighted if boundary test data is included.<\/p>\n\n<\/div><h2 class=\"tabtitle\">Extreme<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Extreme test data<\/h3>\n<p>This is data outside of the limits of acceptable data and should be handled appropriately.<\/p>\n<p>For example:<\/p>\n<ul>\n<li>500<\/li>\n<li>-50<\/li>\n<\/ul>\n\n<\/div><h2 class=\"tabtitle\">Resources<\/h2>\n<div class=\"tabcontent\">\n\n<p><a href=\"https:\/\/docs.google.com\/document\/d\/1yW1kRRZQJ8V_UIfAMH64ckQ26177POReq1-rAsvJ_-0\/edit?usp=sharing\">Testing &amp; Maintenance Worksheet<\/a><\/p>\n<p><a href=\"https:\/\/docs.google.com\/document\/d\/1hJ0vdCiSvUjVtnRkbKZaH7K4or7BlNxEoNg0a0mg5Gg\/edit?usp=sharing\">Testing Table Worksheet<\/a><\/p>\n<p><a href=\"https:\/\/docs.google.com\/presentation\/d\/1i7yK4c0g-ITQY-no__OGxXEIbHRtTmISQ_8CPSnMb6Q\/edit?usp=sharing\">Faulty Towers Theme Park &#8211; Test data programming challenge<\/a><\/p>\n<\/div><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Choosing Testing Data It is important that you choose test data that simulates a wide variety of usage and especially that you choose data that tests the three types of test data: Normal Boundary Extreme Abnormal When White Box Testing, as you have access to the source code, you should ensure that your test data&hellip;&nbsp;<a href=\"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Choosing Test Data<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":70,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Choosing Test Data - IB Computer Science<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Choosing Test Data - IB Computer Science\" \/>\n<meta property=\"og:description\" content=\"Choosing Testing Data It is important that you choose test data that simulates a wide variety of usage and especially that you choose data that tests the three types of test data: Normal Boundary Extreme Abnormal When White Box Testing, as you have access to the source code, you should ensure that your test data&hellip;&nbsp;Read More &raquo;Choosing Test Data\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/\" \/>\n<meta property=\"og:site_name\" content=\"IB Computer Science\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-24T14:08:33+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/\",\"url\":\"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/\",\"name\":\"Choosing Test Data - IB Computer Science\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/#website\"},\"datePublished\":\"2023-01-24T11:22:50+00:00\",\"dateModified\":\"2023-02-24T14:08:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"IB Computer Science\",\"item\":\"https:\/\/learnlearn.uk\/ibcs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Choosing Test Data\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/#website\",\"url\":\"https:\/\/learnlearn.uk\/ibcs\/\",\"name\":\"IB Computer Science\",\"description\":\"- learnlearn..uk\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/ibcs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/#organization\",\"name\":\"IB Computer Science\",\"url\":\"https:\/\/learnlearn.uk\/ibcs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/ibcs\/wp-content\/uploads\/sites\/25\/2022\/09\/LearnLearnLogowhite-300x41.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/ibcs\/wp-content\/uploads\/sites\/25\/2022\/09\/LearnLearnLogowhite-300x41.png\",\"width\":300,\"height\":41,\"caption\":\"IB Computer Science\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/ibcs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Choosing Test Data - IB Computer Science","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/","og_locale":"en_GB","og_type":"article","og_title":"Choosing Test Data - IB Computer Science","og_description":"Choosing Testing Data It is important that you choose test data that simulates a wide variety of usage and especially that you choose data that tests the three types of test data: Normal Boundary Extreme Abnormal When White Box Testing, as you have access to the source code, you should ensure that your test data&hellip;&nbsp;Read More &raquo;Choosing Test Data","og_url":"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/","og_site_name":"IB Computer Science","article_modified_time":"2023-02-24T14:08:33+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/","url":"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/","name":"Choosing Test Data - IB Computer Science","isPartOf":{"@id":"https:\/\/learnlearn.uk\/ibcs\/#website"},"datePublished":"2023-01-24T11:22:50+00:00","dateModified":"2023-02-24T14:08:33+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/ibcs\/choosing-test-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"IB Computer Science","item":"https:\/\/learnlearn.uk\/ibcs\/"},{"@type":"ListItem","position":2,"name":"Choosing Test Data"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/ibcs\/#website","url":"https:\/\/learnlearn.uk\/ibcs\/","name":"IB Computer Science","description":"- learnlearn..uk","publisher":{"@id":"https:\/\/learnlearn.uk\/ibcs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/ibcs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/ibcs\/#organization","name":"IB Computer Science","url":"https:\/\/learnlearn.uk\/ibcs\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/ibcs\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/ibcs\/wp-content\/uploads\/sites\/25\/2022\/09\/LearnLearnLogowhite-300x41.png","contentUrl":"https:\/\/learnlearn.uk\/ibcs\/wp-content\/uploads\/sites\/25\/2022\/09\/LearnLearnLogowhite-300x41.png","width":300,"height":41,"caption":"IB Computer Science"},"image":{"@id":"https:\/\/learnlearn.uk\/ibcs\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/ibcs\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"Choosing Testing Data It is important that you choose test data that simulates a wide variety of usage and especially that you choose data that tests the three types of test data: Normal Boundary Extreme Abnormal When White Box Testing, as you have access to the source code, you should ensure that your test data&hellip;&nbsp;Read&hellip;","_links":{"self":[{"href":"https:\/\/learnlearn.uk\/ibcs\/wp-json\/wp\/v2\/pages\/436"}],"collection":[{"href":"https:\/\/learnlearn.uk\/ibcs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/ibcs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/ibcs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/ibcs\/wp-json\/wp\/v2\/comments?post=436"}],"version-history":[{"count":7,"href":"https:\/\/learnlearn.uk\/ibcs\/wp-json\/wp\/v2\/pages\/436\/revisions"}],"predecessor-version":[{"id":524,"href":"https:\/\/learnlearn.uk\/ibcs\/wp-json\/wp\/v2\/pages\/436\/revisions\/524"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/ibcs\/wp-json\/wp\/v2\/media?parent=436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}