DEV Community

Dhivya.R
Dhivya.R

Posted on

Testing Techniques with proper examples: 1)Boundary Value Analysis 2)Decision Table Testing 3)use case testing 4)LCSAJ testing

Boundary Value Analysis:
• Boundary value analysis is based on testing the boundary values of valid and invalid partitions.
• Every partition has its maximum and minimum values and these maximum and minimum values
are the boundary values of a partition.
Example: If we want to enter an amount between 100 to 1000.
Here we check based on boundaries for 100, we take 98, 99, 101, 102 and for 1000, we take 998, 999,
1001, 1002

Decision Table Technique:
• In Decision table technique, we deal with combinations of inputs.
• To identify the test cases with decision table, we consider conditions and actions.
• We take conditions as inputs and actions as outputs.
Example: Login validation - Allow user to login only when both the username and password is correct.
• Conditions 1: Enter valid username and valid password and Click Login.
o Actions 1: Display home page and Execute.
• Conditions 2: Enter invalid username and valid password and Click Login.
o Actions 2: Display Error message as invalid username

Email(condition 1) | T | T | F | F
Password(condition2) | T | F | T | F
Expected Result (Action)| Account | Incorrect |Incorrect | Incorrect
| Page | password | email | email

Use Case Testing:
Definition: Use case testing focuses on validating the behavior of a system based on its use cases, which are descriptions of interactions between users (actors) and the system.
Purpose: It ensures that the system meets the functional requirements specified in each use case. Use cases typically describe end-to-end scenarios or processes within the system.
Example: In an online shopping application, a use case might detail how a user adds items to the cart, applies discounts, and completes a purchase. Test cases would be derived from these use cases to validate that each step and condition within the scenario works correctly.

TC1: Add Items to Cart
Steps: Add multiple items to the cart.
Expected Outcome: Cart displays correct items with quantities.

TC2: Apply Valid Discount Code
Steps: Apply a valid discount code during checkout.
Expected Outcome: Total amount reflects the discounted price.

TC3: Apply Invalid Discount Code
Steps: Attempt to apply an invalid discount code.
Expected Outcome: System displays an error message indicating the discount code is invalid.

TC4: Complete Purchase - Payment Success
Steps: Complete the purchase process with a valid payment method.
Expected Outcome: Order is successfully placed, and confirmation is received.

TC5: Complete Purchase - Payment Failure Handling
Steps: Simulate a payment failure during checkout.
Expected Outcome: User receives appropriate error message and guidance on next steps

LCSAJ testing:
verifies that all linear sequences of code (straight-line execution paths) and jump statements (such as if, else, for, while conditions) in a program are executed at least once during testing. This ensures comprehensive coverage of the code's execution paths, helping to identify potential errors and ensuring that all parts of the program are tested.

** Example:**
in a function that calculates discounts based on a customer's membership status and the price of an item, LCSAJ testing would involve creating test cases that cover different scenarios:

Checking if the discount calculation branch (if price > 100) is executed correctly.
Verifying that both branches of the membership status condition (if is_member) are tested.

Top comments (0)