{"id":2409,"date":"2020-01-30T12:03:06","date_gmt":"2020-01-30T06:33:06","guid":{"rendered":"http:\/\/artoftesting.com\/?p=2409"},"modified":"2021-04-28T17:36:08","modified_gmt":"2021-04-28T12:06:08","slug":"negative-testing","status":"publish","type":"post","link":"https:\/\/artoftesting.com\/negative-testing","title":{"rendered":"Negative Testing"},"content":{"rendered":"\n<p>In software testing, the following are the main testing strategies-<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Positive Testing<\/strong> \u2013 Positive testing is also known as \u201cHappy Path Testing\u201d. In this testing strategy, by providing valid and correct data, the system\u2019s behavior is checked. Any error or unexpected result is not desired in this testing strategy.<br><\/li><li><strong>Negative Testing<\/strong> \u2013 It makes sure the system works smoothly when invalid or unexpected data is entered. It is also known as \u201cAn error Path Testing\u201d or \u201cFailure Testing\u201d. Exceptions or errors are desired in this testing strategy.<\/li><\/ul>\n\n\n\n<p>In this tutorial, we will focus on \u201cNegative Testing\u201d.<br><br><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-flat ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">Content<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/artoftesting.com\/negative-testing\/#What_is_Negative_Testing\" title=\"What is Negative Testing?\">What is Negative Testing?<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/artoftesting.com\/negative-testing\/#Some_Examples_of_Negative_Testing\" title=\"Some Examples of Negative Testing\">Some Examples of Negative Testing<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/artoftesting.com\/negative-testing\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Negative_Testing\"><\/span><strong>What is Negative Testing?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>While using any application, it is quite possible that the user may enter invalid data intentionally or unintentionally. Now the system should be smart enough to manage such scenarios. More importantly, the system should not crash in the event of such mistakes.&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Negative testing is a type of testing in which a tester intentionally enters invalid data in the system to check the robustness of the application. <\/p><\/blockquote>\n\n\n\n<p>When the wrong input is fed to the system, it should show an error message and handle such invalid values gracefully.<\/p>\n\n\n\n<p>One of the examples of negative testing is the testing of the \u201cContact number\u201d field. \u201cContact number\u201d field should not accept anything other than numbers. So, while doing negative testing, a tester will try to enter the alphabets or special characters in the \u2018Contact number\u2019 field and will check the system\u2019s behavior. The system should display an error message such as \u201cInvalid Value. This field accepts only numbers\u201d.<\/p>\n\n\n\n<p>Negative testing can be done using both manual and <a href=\"http:\/\/artoftesting.com\/automation-testing\">automation testing<\/a>. It is also useful while doing security checks of the system. A malicious user deliberately tries to hack the system and exploit vulnerabilities by passing some scripts or commands in the text fields. A thoroughly negative tested application can help in minimizing the risk for the same.<br><br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Some_Examples_of_Negative_Testing\"><\/span><strong>Some Examples of Negative Testing<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This section lists some scenarios of negative test cases-<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>On entering invalid and unexpectable values than the one supported by the input fields e.g. negative test data can include <strong>passing special characters, foreign language characters, non-text keys<\/strong>, etc in the text boxes.<br><br><\/li><li>Uploading invalid files to the file upload fields or as an attachment e.g. we may <strong>upload a corrupt file<\/strong>, a file containing some virus, a large file with size in GBs (while the application may support only file size in KBs).<br><br><\/li><li>Following <strong>invalid navigations in the application<\/strong> e.g. in order to test the vulnerability of the application a tester may follow the navigation route that is different from the standard path. This can include directly trying to open an authorized URL without authentication or trying to skip some mandatory steps by directly opening a link.<br><br><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Negative testing is useful in making the system more robust and accurate. It helps the testing team in covering all the possible scenarios which can affect the functioning of the system negatively.\u00a0<br><br>Negative testing has its own disadvantages too. Apart from being a time-consuming exercise, it also increases workload as it needs extra thinking when it comes to test case creation.\u00a0But if the application needs to be completely error-free, negative testing is equally important as positive testing.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In software testing, the following are the main testing strategies- Positive Testing &ndash; Positive testing is also known as &ldquo;Happy Path Testing&rdquo;. In this testing strategy, by providing valid and correct data, the system&rsquo;s behavior is checked. Any error or unexpected result is not desired in this testing strategy. Negative Testing &ndash; It makes sure &#8230; <a title=\"Negative Testing\" class=\"read-more\" href=\"https:\/\/artoftesting.com\/negative-testing\" aria-label=\"Read more about Negative Testing\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":2410,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-2409","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-manual-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Negative Testing - Definition, Techniques and Examples<\/title>\n<meta name=\"description\" content=\"Negative testing is a type of testing in which a tester intentionally enters invalid data in the system to check the robustness of the application.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/artoftesting.com\/negative-testing\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Negative Testing - Definition, Techniques and Examples\" \/>\n<meta property=\"og:description\" content=\"Negative testing is a type of testing in which a tester intentionally enters invalid data in the system to check the robustness of the application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/artoftesting.com\/negative-testing\" \/>\n<meta property=\"og:site_name\" content=\"ArtOfTesting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/artoftesting\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-30T06:33:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-28T12:06:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"728\" \/>\n\t<meta property=\"og:image:height\" content=\"416\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kuldeep Rana\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@theartoftesting\" \/>\n<meta name=\"twitter:site\" content=\"@theartoftesting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kuldeep Rana\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/artoftesting.com\/negative-testing#article\",\"isPartOf\":{\"@id\":\"https:\/\/artoftesting.com\/negative-testing\"},\"author\":{\"name\":\"Kuldeep Rana\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5\"},\"headline\":\"Negative Testing\",\"datePublished\":\"2020-01-30T06:33:06+00:00\",\"dateModified\":\"2021-04-28T12:06:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/artoftesting.com\/negative-testing\"},\"wordCount\":541,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/artoftesting.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/negative-testing#primaryimage\"},\"thumbnailUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg\",\"articleSection\":[\"Manual Testing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/artoftesting.com\/negative-testing#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/artoftesting.com\/negative-testing\",\"url\":\"https:\/\/artoftesting.com\/negative-testing\",\"name\":\"Negative Testing - Definition, Techniques and Examples\",\"isPartOf\":{\"@id\":\"https:\/\/artoftesting.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/artoftesting.com\/negative-testing#primaryimage\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/negative-testing#primaryimage\"},\"thumbnailUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg\",\"datePublished\":\"2020-01-30T06:33:06+00:00\",\"dateModified\":\"2021-04-28T12:06:08+00:00\",\"description\":\"Negative testing is a type of testing in which a tester intentionally enters invalid data in the system to check the robustness of the application.\",\"breadcrumb\":{\"@id\":\"https:\/\/artoftesting.com\/negative-testing#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/artoftesting.com\/negative-testing\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/negative-testing#primaryimage\",\"url\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg\",\"contentUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg\",\"width\":728,\"height\":416,\"caption\":\"Negative testing\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/artoftesting.com\/negative-testing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/artoftesting.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Manual Testing\",\"item\":\"https:\/\/artoftesting.com\/category\/manual-testing\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Negative Testing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/artoftesting.com\/#website\",\"url\":\"https:\/\/artoftesting.com\/\",\"name\":\"ArtOfTesting\",\"description\":\"A Beginners Guide to Testing\",\"publisher\":{\"@id\":\"https:\/\/artoftesting.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/artoftesting.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/artoftesting.com\/#organization\",\"name\":\"ArtOfTesting\",\"url\":\"https:\/\/artoftesting.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png\",\"contentUrl\":\"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png\",\"width\":400,\"height\":60,\"caption\":\"ArtOfTesting\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/artoftesting\",\"https:\/\/x.com\/theartoftesting\",\"https:\/\/www.linkedin.com\/groups\/4797819\/\",\"https:\/\/in.pinterest.com\/artoftesting\/\",\"https:\/\/www.youtube.com\/channel\/UCQ9PUVenvvyrUdDQ9yKn31Q\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5\",\"name\":\"Kuldeep Rana\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g\",\"caption\":\"Kuldeep Rana\"},\"description\":\"Kuldeep is the founder and lead author of ArtOfTesting. He is skilled in test automation, performance testing, big data, and CI-CD. He brings his decade of experience to his current role where he is dedicated to educating the QA professionals.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Negative Testing - Definition, Techniques and Examples","description":"Negative testing is a type of testing in which a tester intentionally enters invalid data in the system to check the robustness of the application.","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:\/\/artoftesting.com\/negative-testing","og_locale":"en_US","og_type":"article","og_title":"Negative Testing - Definition, Techniques and Examples","og_description":"Negative testing is a type of testing in which a tester intentionally enters invalid data in the system to check the robustness of the application.","og_url":"https:\/\/artoftesting.com\/negative-testing","og_site_name":"ArtOfTesting","article_publisher":"https:\/\/facebook.com\/artoftesting","article_published_time":"2020-01-30T06:33:06+00:00","article_modified_time":"2021-04-28T12:06:08+00:00","og_image":[{"width":728,"height":416,"url":"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg","type":"image\/jpeg"}],"author":"Kuldeep Rana","twitter_card":"summary_large_image","twitter_creator":"@theartoftesting","twitter_site":"@theartoftesting","twitter_misc":{"Written by":"Kuldeep Rana","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/artoftesting.com\/negative-testing#article","isPartOf":{"@id":"https:\/\/artoftesting.com\/negative-testing"},"author":{"name":"Kuldeep Rana","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5"},"headline":"Negative Testing","datePublished":"2020-01-30T06:33:06+00:00","dateModified":"2021-04-28T12:06:08+00:00","mainEntityOfPage":{"@id":"https:\/\/artoftesting.com\/negative-testing"},"wordCount":541,"commentCount":2,"publisher":{"@id":"https:\/\/artoftesting.com\/#organization"},"image":{"@id":"https:\/\/artoftesting.com\/negative-testing#primaryimage"},"thumbnailUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg","articleSection":["Manual Testing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/artoftesting.com\/negative-testing#respond"]}]},{"@type":"WebPage","@id":"https:\/\/artoftesting.com\/negative-testing","url":"https:\/\/artoftesting.com\/negative-testing","name":"Negative Testing - Definition, Techniques and Examples","isPartOf":{"@id":"https:\/\/artoftesting.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/artoftesting.com\/negative-testing#primaryimage"},"image":{"@id":"https:\/\/artoftesting.com\/negative-testing#primaryimage"},"thumbnailUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg","datePublished":"2020-01-30T06:33:06+00:00","dateModified":"2021-04-28T12:06:08+00:00","description":"Negative testing is a type of testing in which a tester intentionally enters invalid data in the system to check the robustness of the application.","breadcrumb":{"@id":"https:\/\/artoftesting.com\/negative-testing#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/artoftesting.com\/negative-testing"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/negative-testing#primaryimage","url":"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg","contentUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2020\/01\/negative-testing-image.jpg","width":728,"height":416,"caption":"Negative testing"},{"@type":"BreadcrumbList","@id":"https:\/\/artoftesting.com\/negative-testing#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/artoftesting.com\/"},{"@type":"ListItem","position":2,"name":"Manual Testing","item":"https:\/\/artoftesting.com\/category\/manual-testing"},{"@type":"ListItem","position":3,"name":"Negative Testing"}]},{"@type":"WebSite","@id":"https:\/\/artoftesting.com\/#website","url":"https:\/\/artoftesting.com\/","name":"ArtOfTesting","description":"A Beginners Guide to Testing","publisher":{"@id":"https:\/\/artoftesting.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/artoftesting.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/artoftesting.com\/#organization","name":"ArtOfTesting","url":"https:\/\/artoftesting.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/","url":"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png","contentUrl":"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png","width":400,"height":60,"caption":"ArtOfTesting"},"image":{"@id":"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/artoftesting","https:\/\/x.com\/theartoftesting","https:\/\/www.linkedin.com\/groups\/4797819\/","https:\/\/in.pinterest.com\/artoftesting\/","https:\/\/www.youtube.com\/channel\/UCQ9PUVenvvyrUdDQ9yKn31Q"]},{"@type":"Person","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5","name":"Kuldeep Rana","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g","caption":"Kuldeep Rana"},"description":"Kuldeep is the founder and lead author of ArtOfTesting. He is skilled in test automation, performance testing, big data, and CI-CD. He brings his decade of experience to his current role where he is dedicated to educating the QA professionals."}]}},"_links":{"self":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts\/2409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/comments?post=2409"}],"version-history":[{"count":1,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts\/2409\/revisions"}],"predecessor-version":[{"id":4934,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts\/2409\/revisions\/4934"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/media\/2410"}],"wp:attachment":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/media?parent=2409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/categories?post=2409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/tags?post=2409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}