SayPro

SayPro Apply requirement-based test design techniques.

Equivalence partitioning:Dividing the test input data into a range of values and selecting one input value from each range is called Equivalence Partitioning. This is a black box test design technique used to calculate the effectiveness of test cases and which can be applied to all levels of testing from unit, integration, system testing and so forth.We cannot test all the possible input domain values, because if we attempted this, the number of test cases would be too large. In this method, input data is divided into different classes, each class representing the input criteria from the equivalence class. We then select one input from each class.This technique is used to reduce an infinite number of test cases to a finite number, while ensuring that the selected test cases are still effective test cases which will cover all possible scenarios.Let’s take a very basic and simple example to understand the Equivalence Partitioning concept:

  • If one application is accepting input range from 1 to 100, using equivalence class we can divide inputs into the classes, for example, one for valid input and another for invalid input and design one test case from each class.

In this example test cases are chosen as below:TRY REQTEST FREE – #1 BUG TRACKING TOOLOne is for valid input class i.e. selects any value from input between ranges 1 to 100. So here we are not writing hundreds of test cases for each value. Any one value from this equivalence class should give you the same result.One is for invalid data below lower limit i.e. any one value below 1.One is for invalid data above upper limit i.e. any value above 100.Boundary value analysis:

  • For the most part, errors are observed in the extreme ends of the input values, so these extreme values like start/end or lower/upper values are called Boundary values and analysis of these Boundary values is called “Boundary value analysis”. It is also sometimes known as ‘range checking’.
  • Boundary value analysis is another black box test design technique and it is used to find the errors at boundaries of input domain rather than finding those errors in the center of input.
  • Equivalence Partitioning and Boundary value analysis are linked to each other and can be used together at all levels of testing. Based on the edges of the equivalence classes, test cases can then be derived.
  • Each boundary has a valid boundary value and an invalid boundary value. Test cases are designed based on the both valid and invalid boundary values. Typically, we choose one test case from each boundary.

Finding defects using Boundary value analysis test design technique is very effective and it can be used at all test levels. You can select multiple test cases from valid and invalid input domains based on your needs or previous experience but remember you do have to select at least one test case from each input domain.TRY REQTEST FREE FOR TEST MANAGEMENTLet’s take same above example to understand the Boundary value analysis concept:

  • One test case for exact boundary values of input domains each means 1 and 100.
  • One test case for just below boundary value of input domains each means 0 and 99.
  • One test case for just above boundary values of input domains each means 2 and 101.

Test case writing techniques for dynamic testing

  • Equivalence partitioning
  • Boundary Value Analysis
  • Decision table
  • Cause and effect graph technique
  • State transition diagram
  • Orthogonal array testing(OATS)
  • Error guessing.

We have some really good papers 1st, 2nd and 3rd points (Equivalence portioning, BVA and decision tables) here in STH. I am going to discuss point 4 which is Cause and effect graph.IntroductionCause and effect graph is a dynamic test case writing technique. Here causes are the input conditions and effects are the results of those input conditions.Cause-Effect Graphing is a technique which starts with a set of requirements and determines the minimum possible test cases for maximum test coverage which reduces test execution time and ultimately cost.The goal is to reduce the total number of test cases still achieving the desired application quality by covering the necessary test cases for maximum coverage.But at the same time obviously, there are some downsides of using this test case writing technique. It takes time to model all your requirements into this cause-effect graph before writing test cases.The Cause-Effect graph technique restates the requirements specification in terms of the logical relationship between the input and output conditions. Since it is logical, it is obvious to use Boolean operators like AND, OR and NOT.Notations we are going to use:Now let’s try to implement this technique with some example.

  1. Draw a cause and effect graph based on a requirement/situation
  2. Cause and Effect graph is given, draw a decision table based on it to draw the test case.

Let’s see both of them one by one.Let’s draw a cause and effect graph based on a situationSituation:The “Print message” is software that read two characters and, depending on their values, messages must be printed.The first character must be an “A” or a “B”.The second character must be a digit.If the first character is an “A” or “B” and the second character is a digit, the file must be updated.If the first character is incorrect (not an “A” or “B”), the message X must be printed.If the second character is incorrect (not a digit), the message Y must be printed.Solution:The causes for this situation are:C1 – First character is AC2 – First character is BC3 – the Second character is a digitThe effects (results) for this situation areE1 – Update the fileE2 – Print message “X”E3 – Print message “Y”First, draw the causes and effects as shown below:Cause and effect graph testing 2Key – Always go from effect to cause (left to right). That means, to get effect “E”, what causes should be true.In this example, let’s start with Effect E1.Effect E1 is to update the file. The file is updated when– The first character is “A” and the second character is a digit– The first character is “B” and the second character is a digit– The first character can either be “A” or “B” and cannot be both.Now let’s put these 3 points in symbolic form:For E1 to be true – following are the causes:– C1 and C3 should be true– C2 and C3 should be true– C1 and C2 cannot be true together. This means C1 and C2 are mutually exclusive.Now let’s draw this:Cause and effect graph testing 3So as per the above diagram, for E1 to be true the condition is(C1 1C2) C3The circle in the middle is just an interpretation of the middle point to make the graph less messy.There is a third condition where C1 and C2 are mutually exclusive. So the final graph for effect E1 to be true is shown below:Cause and effect graph testing 4So as per the above diagram, for E1 to be true the condition is(C1 1C2) 2 C3The circle in the middle is just an interpretation of the middle point to make the graph less messy.There is a third condition where C1 and C2 are mutually exclusive. So the final graph for effect E1 to be true is shown below:Cause and effect graph testing 5For Effect E3.E3 states to print message “Y”. Message Y will be printed when Second character is incorrect.Which means Effect E3 will hold true when C3 is invalid. So the graph for Effect E3 is shown as (In Green line)Cause and effect graph testing 6This completes the Cause and Effect graph for the above situation.Move to draw the Decision table based on the above graph.Writing Decision table based on Cause and Effect graphFirst, write down the Causes and Effects in a single column shown belowCause and effect graph testing 7Key is the same. Go from bottom to top which means traverse from effect to cause.Start with Effect E1. For E1 to be true, the condition is (C1 1 C2) C3.Here we are representing True as 1 and False as 0First, put Effect E1 as True in the next column asCause and effect graph testing 8Now for E1 to be “1” (true), we have the below two conditions –C1 AND C3 will be trueC2 AND C3 will be trueCause and effect graph testing 9For E2 to be True, either C1 or C2 has to be false shown asCause and effect graph testing 10For E3 to be true, C3 should be false.Cause and effect graph testing 11So it’s done. Let’s complete the graph by adding 0 in the blank column and including the test case identifier.Cause and effect graph testing 12Writing Test cases from the decision tableI am writing a sample test case for test case 1 (TC1) and Test Case 2 (TC2). In a similar fashion, you can create other test cases.(A test case contains many other attributes like preconditions, test data, severity, priority, build, version, release, environment etc. I assume all these attributes to be included when you write the test cases in actual situation)Guidelines for Cause-Effect Functional Testing Technique:

  • If the variables refer to physical quantities, domain testing and equivalence class testing are indicated.
  • If the variables are independent, domain testing and equivalence class testing are indicated.
  • If the variables are dependent, decision table testing is indicated.
  • If the single-fault assumption is warranted, boundary value analysis (BVA) and robustness testing are indicated.
  • If the multiple-fault assumption is warranted, worst-case testing, robust worst-case testing and decision table testing are identical.
  • If the program contains significant exception handling, robustness testing and decision table testing are indicated.
  • If the variables refer to logical quantities, equivalence class testing and decision table testing are indicated.

Decision tables are a concise visual representation for specifying which actions to perform depending on given conditions. They are algorithms whose output is a set of actions. The information expressed in decision tables could also be represented as decision trees or in a programming language as a series of if-then-else and switch-case statements.Each decision corresponds to a variable, relation or predicate whose possible values are listed among the condition alternatives. Each action is a procedure or operation to perform, and the entries specify whether (or in what order) the action is to be performed for the set of condition alternatives the entry corresponds to.To make them more concise, many decision tables include in their condition alternatives a don’t care symbol. This can be a hyphen[1][2][3] or blank,[4] although using a blank is discouraged as it may merely indicate that the decision table has not been finished. One of the uses of decision tables is to reveal conditions under which certain input factors are irrelevant on the actions to be taken, allowing these input tests to be skipped and thereby streamlining decision-making procedures.Aside from the basic four quadrant structure, decision tables vary widely in the way the condition alternatives and action entries are represented. Some decision tables use simple true/false values to represent the alternatives to a condition, other tables may use numbered alternatives, and some tables even use fuzzy logic or probabilistic representations for condition alternatives. In a similar way, action entries can simply represent whether an action is to be performed , or in more advanced decision tables, the sequencing of actions to perform.Image result for design a computer program decision tablesPlease visit our website at www.saypro.online Email: info@saypro.online Email: info@saypro.online Call: + 27 11 071 1903 WhatsApp: + 27 84 313 7407. Comment below for any questions and feedback. For SayPro Courses, SayPro Jobs, SayPro Community Development, SayPro Products, SayPro Services, SayPro Consulting, and SayPro Advisory visit our website to www.saypro.online

Comments

Leave a Reply