{"id":254,"date":"2018-07-25T04:42:53","date_gmt":"2018-07-25T04:42:53","guid":{"rendered":"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=254"},"modified":"2018-08-08T05:47:20","modified_gmt":"2018-08-08T05:47:20","slug":"software-engineering-black-box-testing","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/chapter\/software-engineering-black-box-testing\/","title":{"rendered":"Software Testing &#8211; Black Box Testing"},"content":{"raw":"<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>BLACK BOX TESTING<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Black box testing is a software testing technique where the functionalities of the system is tested without comprehending or looking into the internal structure.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>LEARNING OBJECTIVES\u00a0<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">\u2022 To execute a program with the intent of finding an error.<\/p>\r\n<p style=\"text-align: justify\">\u2022\u00a0To check if the system meets the requirements and be executed successfully in the Intended environment.<\/p>\r\n<p style=\"text-align: justify\">\u2022 To check if the system is \u201cFit for purpose\u201d.<\/p>\r\n<p style=\"text-align: justify\">\u2022 To study on the various types of Black box Testing and its mode of operation.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>MOTIVATION\u00a0<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">The motivation for performing testing process include as follows:<\/p>\r\n\r\n<ul>\r\n \t<li style=\"text-align: justify\">People are not perfect as we make errors in design and code.<\/li>\r\n \t<li style=\"text-align: justify\">Goal of testing is to uncover as many errors as possible.<\/li>\r\n \t<li style=\"text-align: justify\">Important and expensive activity:\r\n<ul>\r\n \t<li style=\"text-align: justify\">May spend 30-40% of total project effort on testing.<\/li>\r\n \t<li style=\"text-align: justify\">For safety critical system cost of testing is several times higher than all other activities combined.<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Ways of Thinking\u00a0<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Design and coding are creative activities. Testing is destructive and the primary goal is to \u201cbreak\u201d the code to uncover errors and faults. Often same person does both coding and testing. So the person must need \u201csplit personality\u201d i.e. when they start testing, must become paranoid and malicious. This is surprisingly difficult as people don\u2019t like to find out that they made mistakes.<\/p>\r\n\r\n<\/div>\r\n<div style=\"text-align: justify\">\r\n\r\n&nbsp;\r\n\r\n<strong>Testing Objective\u00a0<\/strong>\r\n\r\n&nbsp;\r\n\r\n\u00b7\u00a0 <strong>Testing: <\/strong>a process of executing software with the intent of finding errors.\r\n\r\n\u00b7\u00a0 <strong>Good testing: <\/strong>a high probability of finding as-yet-undiscovered errors.\r\n\r\n\u00b7\u00a0 <strong>Successful testing: <\/strong>discovers unknown errors.\r\n\r\n&nbsp;\r\n\r\n<strong>Test Data and Test Cases\u00a0<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong style=\"text-align: initial;text-indent: 1em;font-size: 1em\">Test-to-pass <\/strong><span style=\"text-align: initial;text-indent: 1em;font-size: 1em\">assures that the software minimally works and does not push the capabilities of the software. It applies simple and straightforward test cases, without trying to \u201cbreak\u201d the program.<\/span><strong>Test data <\/strong>is the inputs which have been devised to test the system. <strong>Test cases <\/strong>provide inputs to test the system and the predicted outputs from these inputs if the system operates according to its specification. Test case specifies the inputs; the pre-test state of the software and the expected results (outputs of the state).<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Test-to-fail <\/strong>is designing and running test cases with the sole purpose of breaking the software. It comprises of strategically chosen test cases to probe for common weaknesses in the software.<\/p>\r\n&nbsp;\r\n\r\n<strong>BLACK-BOX TESTING\u00a0<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe characteristics of black-box testing comprises of the following:\r\n\r\n&nbsp;\r\n\r\n\u25e6\u00a0 Program is treated as a black box.\r\n\r\n\u25e6\u00a0 Implementation details do not matter.\r\n\r\n\u25e6\u00a0 Requires an end-user perspective.\r\n\r\n\u25e6\u00a0 Criteria are not precise.\r\n\r\n\u25e6\u00a0 Test planning can begin early.\r\n\r\n&nbsp;\r\n\r\n<img class=\"aligncenter wp-image-265 size-full\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/BLACK-BOX-TESTING-e1533706948183.png\" alt=\"\" width=\"551\" height=\"94\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Black box testing is also known as specification-based testing. Black box testing refers to test activities using specification-based testing methods and criteria to discover program errors based on program requirements and product specifications. The major testing focuses on the following:<\/span><\/p>\r\n\r\n<\/div>\r\n<div style=\"text-align: justify\">\r\n<ul>\r\n \t<li>Specification-based function errors<\/li>\r\n \t<li>Specification-based component\/system behavior errors<\/li>\r\n \t<li>Specification-based performance errors<\/li>\r\n \t<li>User-oriented usage errors<\/li>\r\n \t<li>Black box interface errors<\/li>\r\n<\/ul>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Black box testing comprises of testing software against a specification of its external behavior without knowledge of internal implementation details It can be applied to software \u201cunits\u201d (e.g., classes) or to entire programs. The external behavior is defined in API docs, functional specs, requirements specs, etc. Black box testing purposely disregards the program's control structure and the attention is focused primarily on the information domain (i.e., data that goes in, data that comes out). The goal is to derive sets of input conditions (test cases) that fully exercise the external functionality.<\/p>\r\n&nbsp;\r\n\r\n<strong>Information Domain: inputs and outputs\u00a0<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Inputs encompass of individual input values and hence many different values are tried for each individual input. The combinations of inputs include:<\/p>\r\n\r\n<ul>\r\n \t<li>Individual inputs that are not independent from each other.<\/li>\r\n \t<li>Programs process multiple input values together, not just one at a time.<\/li>\r\n \t<li>Try many different combinations of inputs in order to achieve good coverage of the input domain.<\/li>\r\n<\/ul>\r\n&nbsp;\r\n<p style=\"text-align: justify\">In addition to the particular combination of input values chosen, the ordering and timing of the inputs can also make a difference.<\/p>\r\n&nbsp;\r\n\r\n<strong>Defining the input domain\u00a0<\/strong>\r\n<ul>\r\n \t<li>Boolean value\r\n<ul>\r\n \t<li>T or F<\/li>\r\n<\/ul>\r\n<\/li>\r\n \t<li>Numeric value in a particular range\r\n<ul>\r\n \t<li>99 &lt;= N &lt;= 99<\/li>\r\n \t<li>Integer, Floating point<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<\/div>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong><span style=\"text-align: initial;font-size: 1em\">Equivalence Partitioning\u00a0<\/span><\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Typically the universe of all possible test cases is so large that you cannot try them all. You have to select a relatively small number of test cases to actually run, but which test cases to choose. Equivalence partitioning helps answer this question.<\/span><\/p>\r\n\r\n<div style=\"text-align: justify\">\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Partition the test cases into \u201cequivalence classes\u201d. Each equivalence class contains a set of \"equivalent\" test cases. Two test cases are considered to be equivalent if we expect the program to process them both in the same way (i.e., follow the same path through the code). If you expect the program to process two test cases in the same way, only test one of them, thus reducing the number of test cases you have to run.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"aligncenter size-full wp-image-264\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/First-level-partitioning.png\" alt=\"\" width=\"606\" height=\"507\" \/>\r\n\r\n<span style=\"font-size: 1em;text-align: initial\">Create a test case for at least one value from each equivalence class.<\/span>\r\n\r\n<\/div>\r\n<div style=\"text-align: justify\">\r\n\r\n<img class=\"aligncenter wp-image-263\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Create-a-test.png\" alt=\"\" width=\"252\" height=\"198\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">When designing test cases, you may use different definitions of \u201cequivalence\u201d, each of which will partition the test case space differently. Test multiple values in each equivalence class as many times you\u2019re not sure if you have defined the equivalence classes correctly or completely, and testing multiple values in each class is more thorough than relying on a single value.<\/p>\r\n&nbsp;\r\n\r\n<strong>Example 1: <\/strong>int Add (n1, n2, n3...)\r\n<ul>\r\n \t<li>Equivalence Definition 1: partition test cases by the number of inputs (1, 2, 3, etc.).<\/li>\r\n \t<li>Equivalence Definition 2: partition test cases by the number signs they contain (positive, negative, both).<\/li>\r\n \t<li>Equivalence Definition 3: partition test cases by the magnitude of operands (large numbers, small numbers, both).<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n<strong>Example 2: <\/strong>string Fetch (URL)\r\n<ul>\r\n \t<li>Equivalence Definition 1: partition test cases by URL protocol (\u201chttp\u201d, \u201chttps\u201d, \u201cftp\u201d, \u201cfile\u201d, etc.).<\/li>\r\n \t<li>Equivalence Definition 2: partition test cases by type of file being retrieved (HTML, GIF, JPEG, Plain Text, etc.).<\/li>\r\n \t<li>Equivalence Definition 3: partition test cases by length of URL (very short, short, medium, long, very long, etc.).<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n<strong>Equivalence Partitioning - example<\/strong>\r\n\r\n<\/div>\r\n<img class=\"aligncenter size-full wp-image-260\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example.png\" alt=\"\" width=\"629\" height=\"463\" \/>\r\n\r\n<img class=\"aligncenter size-full wp-image-259\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example1.png\" alt=\"\" width=\"627\" height=\"301\" \/>\r\n\r\n<img class=\"aligncenter size-full wp-image-258\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example2.png\" alt=\"\" width=\"629\" height=\"368\" \/>\r\n\r\n<img class=\"aligncenter size-full wp-image-257\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example3.png\" alt=\"\" width=\"629\" height=\"477\" \/>\r\n<p style=\"text-align: justify\"><strong><span style=\"text-align: initial;font-size: 1em\">Boundary Value Analysis\u00a0<\/span><\/strong><\/p>\r\n\r\n<div style=\"text-align: justify\">\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">When choosing values from an equivalence class to test the program; use the values that are most likely to cause the program to fail. Errors tend to occur at the boundaries of equivalence classes rather than at the \"center\"<\/p>\r\n&nbsp;\r\n\r\n\u25e6\u00a0 If (200 &lt; areaCode &amp;&amp; areaCode &lt; 999) { \/\/ valid area code }- Wrong!\r\n\r\n\u25e6\u00a0 If (200 &lt;= areaCode &amp;&amp; areaCode &lt;= 999) { \/\/ valid area code }\r\n\r\n\u25e6\u00a0 Testing area codes 200 and 999 would catch this error, but a center value like 770 would not.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In addition to testing center values, we should also test boundary values i.e. right on a boundary and very close to a boundary on either side. Create test cases to test boundaries of equivalence classes.<\/p>\r\n<img class=\"aligncenter size-full wp-image-262\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis.png\" alt=\"\" width=\"310\" height=\"261\" \/>\r\n\r\n<strong>Boundary Value Analysis- example<\/strong>\r\n\r\n<\/div>\r\n<img class=\"aligncenter wp-image-261\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example.png\" alt=\"\" width=\"486\" height=\"872\" \/>\r\n\r\n<strong>Web Links<\/strong>\r\n<ul>\r\n \t<li>https:\/\/www.tutorialspoint.com\/software_testing\/software_testing_types.htm<\/li>\r\n \t<li>https:\/\/softwaretestingfundamentals.com<\/li>\r\n \t<li>www.softwaretestinghelp.com\/types-of-software-testing\/<\/li>\r\n \t<li>https:\/\/en.wikipedia.org\/wiki\/Black-box_testing<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n<strong>Supporting &amp; Reference Materials<\/strong>\r\n<ul>\r\n \t<li>Roger S. Pressman, \u201cSoftware Engineering: A Practitioner\u2019s Approach\u201d, Fifth Edition, McGraw Hill, 2001.<\/li>\r\n \t<li>Pankaj Jalote, \u201cAn Integrated Approach to Software Engineering\u201d, Second Edition, Narosa Publications, 2005.<\/li>\r\n \t<li>Ian Sommerville, \u201cSoftware Engineering\u201d, TEnth Edition,Pearson education, 2017.<\/li>\r\n<\/ul>\r\n<p style=\"text-align: justify\"><\/p>","rendered":"<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>BLACK BOX TESTING<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Black box testing is a software testing technique where the functionalities of the system is tested without comprehending or looking into the internal structure.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>LEARNING OBJECTIVES\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">\u2022 To execute a program with the intent of finding an error.<\/p>\n<p style=\"text-align: justify\">\u2022\u00a0To check if the system meets the requirements and be executed successfully in the Intended environment.<\/p>\n<p style=\"text-align: justify\">\u2022 To check if the system is \u201cFit for purpose\u201d.<\/p>\n<p style=\"text-align: justify\">\u2022 To study on the various types of Black box Testing and its mode of operation.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>MOTIVATION\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The motivation for performing testing process include as follows:<\/p>\n<ul>\n<li style=\"text-align: justify\">People are not perfect as we make errors in design and code.<\/li>\n<li style=\"text-align: justify\">Goal of testing is to uncover as many errors as possible.<\/li>\n<li style=\"text-align: justify\">Important and expensive activity:\n<ul>\n<li style=\"text-align: justify\">May spend 30-40% of total project effort on testing.<\/li>\n<li style=\"text-align: justify\">For safety critical system cost of testing is several times higher than all other activities combined.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Ways of Thinking\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Design and coding are creative activities. Testing is destructive and the primary goal is to \u201cbreak\u201d the code to uncover errors and faults. Often same person does both coding and testing. So the person must need \u201csplit personality\u201d i.e. when they start testing, must become paranoid and malicious. This is surprisingly difficult as people don\u2019t like to find out that they made mistakes.<\/p>\n<\/div>\n<div style=\"text-align: justify\">\n<p>&nbsp;<\/p>\n<p><strong>Testing Objective\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u00b7\u00a0 <strong>Testing: <\/strong>a process of executing software with the intent of finding errors.<\/p>\n<p>\u00b7\u00a0 <strong>Good testing: <\/strong>a high probability of finding as-yet-undiscovered errors.<\/p>\n<p>\u00b7\u00a0 <strong>Successful testing: <\/strong>discovers unknown errors.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Test Data and Test Cases\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong style=\"text-align: initial;text-indent: 1em;font-size: 1em\">Test-to-pass <\/strong><span style=\"text-align: initial;text-indent: 1em;font-size: 1em\">assures that the software minimally works and does not push the capabilities of the software. It applies simple and straightforward test cases, without trying to \u201cbreak\u201d the program.<\/span><strong>Test data <\/strong>is the inputs which have been devised to test the system. <strong>Test cases <\/strong>provide inputs to test the system and the predicted outputs from these inputs if the system operates according to its specification. Test case specifies the inputs; the pre-test state of the software and the expected results (outputs of the state).<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Test-to-fail <\/strong>is designing and running test cases with the sole purpose of breaking the software. It comprises of strategically chosen test cases to probe for common weaknesses in the software.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>BLACK-BOX TESTING\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The characteristics of black-box testing comprises of the following:<\/p>\n<p>&nbsp;<\/p>\n<p>\u25e6\u00a0 Program is treated as a black box.<\/p>\n<p>\u25e6\u00a0 Implementation details do not matter.<\/p>\n<p>\u25e6\u00a0 Requires an end-user perspective.<\/p>\n<p>\u25e6\u00a0 Criteria are not precise.<\/p>\n<p>\u25e6\u00a0 Test planning can begin early.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-265 size-full\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/BLACK-BOX-TESTING-e1533706948183.png\" alt=\"\" width=\"551\" height=\"94\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/BLACK-BOX-TESTING-e1533706948183.png 551w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/BLACK-BOX-TESTING-e1533706948183-300x51.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/BLACK-BOX-TESTING-e1533706948183-65x11.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/BLACK-BOX-TESTING-e1533706948183-225x38.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/BLACK-BOX-TESTING-e1533706948183-350x60.png 350w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Black box testing is also known as specification-based testing. Black box testing refers to test activities using specification-based testing methods and criteria to discover program errors based on program requirements and product specifications. The major testing focuses on the following:<\/span><\/p>\n<\/div>\n<div style=\"text-align: justify\">\n<ul>\n<li>Specification-based function errors<\/li>\n<li>Specification-based component\/system behavior errors<\/li>\n<li>Specification-based performance errors<\/li>\n<li>User-oriented usage errors<\/li>\n<li>Black box interface errors<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Black box testing comprises of testing software against a specification of its external behavior without knowledge of internal implementation details It can be applied to software \u201cunits\u201d (e.g., classes) or to entire programs. The external behavior is defined in API docs, functional specs, requirements specs, etc. Black box testing purposely disregards the program&#8217;s control structure and the attention is focused primarily on the information domain (i.e., data that goes in, data that comes out). The goal is to derive sets of input conditions (test cases) that fully exercise the external functionality.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Information Domain: inputs and outputs\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Inputs encompass of individual input values and hence many different values are tried for each individual input. The combinations of inputs include:<\/p>\n<ul>\n<li>Individual inputs that are not independent from each other.<\/li>\n<li>Programs process multiple input values together, not just one at a time.<\/li>\n<li>Try many different combinations of inputs in order to achieve good coverage of the input domain.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In addition to the particular combination of input values chosen, the ordering and timing of the inputs can also make a difference.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Defining the input domain\u00a0<\/strong><\/p>\n<ul>\n<li>Boolean value\n<ul>\n<li>T or F<\/li>\n<\/ul>\n<\/li>\n<li>Numeric value in a particular range\n<ul>\n<li>99 &lt;= N &lt;= 99<\/li>\n<li>Integer, Floating point<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong><span style=\"text-align: initial;font-size: 1em\">Equivalence Partitioning\u00a0<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Typically the universe of all possible test cases is so large that you cannot try them all. You have to select a relatively small number of test cases to actually run, but which test cases to choose. Equivalence partitioning helps answer this question.<\/span><\/p>\n<div style=\"text-align: justify\">\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Partition the test cases into \u201cequivalence classes\u201d. Each equivalence class contains a set of &#8220;equivalent&#8221; test cases. Two test cases are considered to be equivalent if we expect the program to process them both in the same way (i.e., follow the same path through the code). If you expect the program to process two test cases in the same way, only test one of them, thus reducing the number of test cases you have to run.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-264\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/First-level-partitioning.png\" alt=\"\" width=\"606\" height=\"507\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/First-level-partitioning.png 606w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/First-level-partitioning-300x251.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/First-level-partitioning-65x54.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/First-level-partitioning-225x188.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/First-level-partitioning-350x293.png 350w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/p>\n<p><span style=\"font-size: 1em;text-align: initial\">Create a test case for at least one value from each equivalence class.<\/span><\/p>\n<\/div>\n<div style=\"text-align: justify\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-263\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Create-a-test.png\" alt=\"\" width=\"252\" height=\"198\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Create-a-test.png 310w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Create-a-test-300x236.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Create-a-test-65x51.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Create-a-test-225x177.png 225w\" sizes=\"auto, (max-width: 252px) 100vw, 252px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">When designing test cases, you may use different definitions of \u201cequivalence\u201d, each of which will partition the test case space differently. Test multiple values in each equivalence class as many times you\u2019re not sure if you have defined the equivalence classes correctly or completely, and testing multiple values in each class is more thorough than relying on a single value.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Example 1: <\/strong>int Add (n1, n2, n3&#8230;)<\/p>\n<ul>\n<li>Equivalence Definition 1: partition test cases by the number of inputs (1, 2, 3, etc.).<\/li>\n<li>Equivalence Definition 2: partition test cases by the number signs they contain (positive, negative, both).<\/li>\n<li>Equivalence Definition 3: partition test cases by the magnitude of operands (large numbers, small numbers, both).<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Example 2: <\/strong>string Fetch (URL)<\/p>\n<ul>\n<li>Equivalence Definition 1: partition test cases by URL protocol (\u201chttp\u201d, \u201chttps\u201d, \u201cftp\u201d, \u201cfile\u201d, etc.).<\/li>\n<li>Equivalence Definition 2: partition test cases by type of file being retrieved (HTML, GIF, JPEG, Plain Text, etc.).<\/li>\n<li>Equivalence Definition 3: partition test cases by length of URL (very short, short, medium, long, very long, etc.).<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Equivalence Partitioning &#8211; example<\/strong><\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-260\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example.png\" alt=\"\" width=\"629\" height=\"463\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example.png 629w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example-300x221.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example-65x48.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example-225x166.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example-350x258.png 350w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-259\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example1.png\" alt=\"\" width=\"627\" height=\"301\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example1.png 627w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example1-300x144.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example1-65x31.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example1-225x108.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example1-350x168.png 350w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-258\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example2.png\" alt=\"\" width=\"629\" height=\"368\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example2.png 629w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example2-300x176.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example2-65x38.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example2-225x132.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example2-350x205.png 350w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-257\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example3.png\" alt=\"\" width=\"629\" height=\"477\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example3.png 629w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example3-300x228.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example3-65x49.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example3-225x171.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Equivalence-Partitioning-example3-350x265.png 350w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/p>\n<p style=\"text-align: justify\"><strong><span style=\"text-align: initial;font-size: 1em\">Boundary Value Analysis\u00a0<\/span><\/strong><\/p>\n<div style=\"text-align: justify\">\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">When choosing values from an equivalence class to test the program; use the values that are most likely to cause the program to fail. Errors tend to occur at the boundaries of equivalence classes rather than at the &#8220;center&#8221;<\/p>\n<p>&nbsp;<\/p>\n<p>\u25e6\u00a0 If (200 &lt; areaCode &amp;&amp; areaCode &lt; 999) { \/\/ valid area code }- Wrong!<\/p>\n<p>\u25e6\u00a0 If (200 &lt;= areaCode &amp;&amp; areaCode &lt;= 999) { \/\/ valid area code }<\/p>\n<p>\u25e6\u00a0 Testing area codes 200 and 999 would catch this error, but a center value like 770 would not.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In addition to testing center values, we should also test boundary values i.e. right on a boundary and very close to a boundary on either side. Create test cases to test boundaries of equivalence classes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-262\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis.png\" alt=\"\" width=\"310\" height=\"261\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis.png 310w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-300x253.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-65x55.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-225x189.png 225w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<p><strong>Boundary Value Analysis- example<\/strong><\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-261\" src=\"http:\/\/csp8.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example.png\" alt=\"\" width=\"486\" height=\"872\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example.png 855w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example-167x300.png 167w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example-768x1378.png 768w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example-571x1024.png 571w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example-65x117.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example-225x404.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-content\/uploads\/sites\/53\/2018\/07\/Boundary-Value-Analysis-example-350x628.png 350w\" sizes=\"auto, (max-width: 486px) 100vw, 486px\" \/><\/p>\n<p><strong>Web Links<\/strong><\/p>\n<ul>\n<li>https:\/\/www.tutorialspoint.com\/software_testing\/software_testing_types.htm<\/li>\n<li>https:\/\/softwaretestingfundamentals.com<\/li>\n<li>www.softwaretestinghelp.com\/types-of-software-testing\/<\/li>\n<li>https:\/\/en.wikipedia.org\/wiki\/Black-box_testing<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Supporting &amp; Reference Materials<\/strong><\/p>\n<ul>\n<li>Roger S. Pressman, \u201cSoftware Engineering: A Practitioner\u2019s Approach\u201d, Fifth Edition, McGraw Hill, 2001.<\/li>\n<li>Pankaj Jalote, \u201cAn Integrated Approach to Software Engineering\u201d, Second Edition, Narosa Publications, 2005.<\/li>\n<li>Ian Sommerville, \u201cSoftware Engineering\u201d, TEnth Edition,Pearson education, 2017.<\/li>\n<\/ul>\n<p style=\"text-align: justify\">\n","protected":false},"author":4,"menu_order":26,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["dr-r-baskaran"],"pb_section_license":""},"chapter-type":[],"contributor":[58],"license":[],"class_list":["post-254","chapter","type-chapter","status-publish","hentry","contributor-dr-r-baskaran"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/pressbooks\/v2\/chapters\/254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/wp\/v2\/users\/4"}],"version-history":[{"count":8,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/pressbooks\/v2\/chapters\/254\/revisions"}],"predecessor-version":[{"id":409,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/pressbooks\/v2\/chapters\/254\/revisions\/409"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/pressbooks\/v2\/chapters\/254\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/pressbooks\/v2\/chapter-type?post=254"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/wp\/v2\/contributor?post=254"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp8\/wp-json\/wp\/v2\/license?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}