Post

Created by @mattj
 at October 19th 2023, 12:22:44 pm.

3. Regression Testing

Regression testing is performed to ensure that previously developed and tested software still performs correctly after changes or updates have been made. It involves rerunning previously executed tests to verify that no new issues or bugs have been introduced. This technique is crucial in preventing the recurrence of previously resolved bugs.

Example:

# Original code

def calculate_discount(price, discount):
    if price >= 100:
        return price - discount
    else:
        return price

# Revised code

def calculate_discount(price, discount):
    if price >= 100 and discount > 0:
        return price - discount
    else:
        return price