DEV Community

shruti
shruti

Posted on

TASK-2

Q: Describe the following testing techniques with proper examples
a) Boundary value Analysis
A: Boundary value analysis is based on testing the boundary values valid and invalid partitions. The behavior at the edge of the equivalence partition is more likely to be incorrect than the behavior within the partition, so boundaries are an area where testing is likely to yield defects.
It checks for the input values near the boundary that have a higher chance of error. Every partition has its maximum and minimum values and these maximum and minimum values are the boundary values of a partition.
In BVA we test boundaries between equivalence partitions one test case for each boundary value.

Benefits of BVA :-

Efficient identification of potential errors at the edges of input domains.
It helps to ensure that the software handles boundary conditions correctly.
Provides focused testing on critical areas where errors are likely to occur.

Note:

A boundary value for a valid partition is a valid boundary value.
A boundary value for a invalid partition is a invalid boundary value.

Below are the principle of BVA :-

  1. Input Boundaries: >>BVA is applied to both input and output boundaries. >>It considers the minimum ,maximum, and just beyond the min and max value for input.
  2. Test cases: >>Test cases are designed to evaluate the behavior of the software at the boundary values. >>Typically three sets of test cases are created for each boundary: one with a value just below the boundary, one at the boundary, and one just beyond the boundary.
  3. Error Detection: >>The goal is to identify errors related to boundary values, such as off-by-one errors or issues with boundary conditions.
  4. Examples: >>If a system accepts values between 1 to 100, boundary values would include tests with 0,1,100 and 101. >>For a range of dates, boundary values might include testing the day before, the first day, the last day, and the day after the specified range.
  5. Applicability: >>BVA is particularly effective for input conditions that have a range of valid values, such as numeric ranges, date ranges, or any other parameter with defined limits.

Example :-

  1. Consider a system that accepts ages from 18 to 56

Image description

Valid test case : Valid test cases for the above example can be any value entered greater that 17 and less than 57

  1. Enter the value : 18
  2. Enter the value : 19
  3. Enter the value : 37
  4. Enter the value : 55
  5. Enter the value : 56

Invalid test case : Where any value less than 18 and greater than 56 is entered

  1. Enter the value : 17
  2. Enter the value : 57

b) Decision Table testing
A : Decision table testing is very effective tool in testing the software and its requirements management. The output may be dependent on many input conditions and decision tables give a tabular view of various combinations of input conditions and these conditions are in the form of True(T) and False (F). Also, It provides a set of conditions and its corresponding action required in the testing.
This is systematic approach where the different input combinations and their corresponding system behavior(Output) are captured in a tabular form.

Components of decision table testing

  1. Conditions: >> These are the factors or criteria that influence the decision making process. >> Conditions can be either True or False.
  2. Actions: >> These represents the possible outcomes or actions based on the combinations of conditions.
  3. Rules: >> Each row in the decision table represents a unique combination of conditions and the corresponding action or outcome.
  4. Columns: >> Columns represent different conditions and actions

Example of a decision Table :

Consider a example where a system determine if a person is eligible for a discount based on age and membership status:

Image description

In this above example, the decision table outlines the different combinations of age and membership status conditions, along with corresponding discount actions. Testing would involve creating test cases based on these combinations to ensure the system behaves correctly.

c) Use Case testing
A : Use case testing is a Black box testing technique that focuses on validating the functionality of a software application by testing its use cases. A use case represents a specific way of user interacts with the system to achieve a particular goal. use case testing ensures that the system behaves as intended and meets user requirements in real world scenarios.
Tests can be derived from use cases, which are specific way designing with software items.
Use cases are associated with actors(Humans, External hardware, other components or system) and subjects (the component or system to which the use cases is applied).

Key steps in use case testing

  1. Identify the use cases : Define and identify the various use cases that describes how different users interact with the system to accomplish specific tasks or goals.
  2. Understand user scenarios : Gain a comprehensive understanding of the user scenario outlined in each use cases, This includes input, expected outputs and the sequence of interactions.
  3. Create test cases : Develop test cases based on the identified use cases, covering various scenarios and conditions that users might encounter during real world usage
  4. Test execution : Execute the test cases to verify that the system behaves correctly and provides the expected outputs in accordance with the defined use cases.
  5. Evaluate Functionalities : Validate whether the functionalities described in the use cases are implemented correctly and meet user expectations.
  6. Boundary conditions and Exception handling : Test boundary conditions and exceptional scenarios to ensure that the system handles edge cases and unexpected inputs as specified in the use cases.
  7. User interface testing : If applicable, Perform user interface testing to ensure that the graphical elements and interactions align with the use cases

Example :- Consider and e-commerce application with a use cases for placing order. The use case may include below steps :

  1. User login
  2. User adds items to the shopping cart
  3. User proceeds to checkout
  4. User enters shipping and payments information
  5. User confirms the order

d)LCSAJ Testing
A : Linear code sequence: A Linear code sequence refers to a series of instructions in a program executed in straight, sequential order without any branches or jumps. The goal is to test each linear sequence of code to ensure that it behaves as expected.
Jump : A "Jump" Refers to control flow operations in programming where the normal sequential execution of code is altered based on conditions. This includes construct like if statements, loops and other branching mechanism.

Example:-

  1. Read input A
  2. Read input B
  3. if A>B 4.C=A+B
  4. else:
  5. C=A-7
  6. D=C*2
  7. Print D

Sequence 1: Lines 1-2
Sequence 2: Lines 3-4
Sequence 3: Lines 5-6
Sequence 4: Lines 7
Sequence 5: Line 8

  1. Test case 1:

Input: A = 3, B = 2 (A>B is true)

Expected execution path:

Sequence 1, Sequence 2, Sequence 4, Sequence 5

  1. Test case 2:

Input: A = 2 , B = 3 (A>B is false)

Expected execution path:

Sequence 1, Sequence 3, Sequence 5

  1. Test case 3:

Input: A = 5, B = 5 (A>B is false)

Expected execution path:

Sequence 1, Sequence 3, Sequence 5

Top comments (0)