0
0
Testing Fundamentalstesting~10 mins

When to automate vs manual test in Testing Fundamentals - Test Execution Compared

Choose your learning style9 modes available
Test Overview

This test checks if the tester correctly decides when to use automated testing versus manual testing based on test case characteristics.

Test Code - PyTest
Testing Fundamentals
def decide_test_method(test_case):
    """Decide whether to automate or do manual testing based on test case properties."""
    if test_case['is_repetitive'] and test_case['stable_requirements'] and test_case['high_risk_area']:
        return 'Automate'
    elif test_case['requires_exploratory'] or test_case['one_time_test']:
        return 'Manual'
    else:
        return 'Manual'

# Example test cases
repetitive_test = {'is_repetitive': True, 'stable_requirements': True, 'high_risk_area': True, 'requires_exploratory': False, 'one_time_test': False}
exploratory_test = {'is_repetitive': False, 'stable_requirements': False, 'high_risk_area': False, 'requires_exploratory': True, 'one_time_test': False}
one_time_test = {'is_repetitive': False, 'stable_requirements': True, 'high_risk_area': False, 'requires_exploratory': False, 'one_time_test': True}

assert decide_test_method(repetitive_test) == 'Automate'
assert decide_test_method(exploratory_test) == 'Manual'
assert decide_test_method(one_time_test) == 'Manual'
Execution Trace - 5 Steps
StepActionSystem StateAssertionResult
1Test startsTest function decide_test_method is ready to run with example test cases-PASS
2Call decide_test_method with repetitive_test caseInput: {'is_repetitive': True, 'stable_requirements': True, 'high_risk_area': True, 'requires_exploratory': False, 'one_time_test': False}Return value should be 'Automate'PASS
3Call decide_test_method with exploratory_test caseInput: {'is_repetitive': False, 'stable_requirements': False, 'high_risk_area': False, 'requires_exploratory': True, 'one_time_test': False}Return value should be 'Manual'PASS
4Call decide_test_method with one_time_test caseInput: {'is_repetitive': False, 'stable_requirements': True, 'high_risk_area': False, 'requires_exploratory': False, 'one_time_test': True}Return value should be 'Manual'PASS
5All assertions checkedAll test cases returned expected resultsAll assert statements passedPASS
Failure Scenario
Failing Condition: The decide_test_method returns wrong test method for any test case
Execution Trace Quiz - 3 Questions
Test your understanding
Which test case should be automated according to the test?
AA one-time exploratory test
BA test requiring manual exploration
CA repetitive test with stable requirements and high risk
DA test with unstable requirements
Key Result
Automate tests that are repetitive, stable, and high risk to save time and reduce errors. Use manual testing for exploratory or one-time tests where human insight is needed.