Bird
Raised Fist0
Testing Fundamentalstesting~20 mins

Testing in the software development lifecycle in Testing Fundamentals - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
SDLC Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
When is integration testing typically performed in the software development lifecycle?

Choose the phase in the software development lifecycle when integration testing is usually done.

AAfter unit testing and before system testing
BBefore unit testing
CAfter system testing and before acceptance testing
DOnly after the software is deployed to production
Attempts:
2 left
💡 Hint

Integration testing checks how different parts work together, so it happens after individual parts are tested.

❓ Predict Output
intermediate
1:30remaining
What is the output of this test execution report summary?

Given the following test execution summary, what is the total number of failed tests?

Testing Fundamentals
Test Suite: User Login Tests
Tests run: 10
Tests passed: 8
Tests failed: 2
Tests skipped: 0
A2
B0
C10
D8
Attempts:
2 left
💡 Hint

Look for the line that says 'Tests failed'.

❓ assertion
advanced
2:00remaining
Which assertion correctly verifies that a function returns a non-empty list?

Choose the assertion statement that correctly checks if the function get_items() returns a list with at least one item.

Testing Fundamentals
def get_items():
    return ['apple', 'banana']
Aassert get_items() == ''
Bassert get_items() == []
Cassert get_items() is None
Dassert len(get_items()) > 0
Attempts:
2 left
💡 Hint

Think about how to check the size of a list.

🔧 Debug
advanced
2:00remaining
Identify the error in this test case code snippet

What error will this test code raise when executed?

Testing Fundamentals
def test_divide():
    result = divide(10, 0)
    assert result == 0
AAssertionError because result is not 0
BNameError because 'divide' function is not defined
CZeroDivisionError because of division by zero
DNo error, test passes
Attempts:
2 left
💡 Hint

Check if the function used is defined anywhere.

❓ framework
expert
2:30remaining
In a CI/CD pipeline, which testing stage should run immediately after code commit to catch errors early?

Choose the testing stage that is best suited to run right after a developer commits code to the repository in a Continuous Integration/Continuous Deployment (CI/CD) pipeline.

ASystem testing
BUser acceptance testing
CUnit testing
DPerformance testing
Attempts:
2 left
💡 Hint

Think about fast, automated tests that check small pieces of code.

Practice

(1/5)
1. Which phase in the software development lifecycle is primarily responsible for planning how testing will be done?
easy
A. Deployment
B. Coding
C. Requirement Analysis
D. Maintenance

Solution

  1. Step 1: Understand the role of Requirement Analysis

    This phase gathers and analyzes what the software should do, including defining test requirements.
  2. Step 2: Identify testing planning activities

    Planning how to test is done early, during Requirement Analysis, to ensure tests cover all needs.
  3. Final Answer:

    Requirement Analysis -> Option C
  4. Quick Check:

    Testing plan starts in Requirement Analysis [OK]
Hint: Testing plans start with requirements, not coding [OK]
Common Mistakes:
  • Confusing coding phase with testing planning
  • Thinking deployment includes test planning
  • Assuming maintenance is for initial test planning
2. Which of the following is the correct syntax to describe a test case in a test plan document?
easy
A. Test Case ID: TC001\nDescription: Verify login functionality\nExpected Result: User logs in successfully
B. Test Case: Verify login\nResult: Success\nID: 001
C. ID: 001\nTest: Login check\nOutcome: Pass
D. Case Test 1\nCheck login\nExpected: true

Solution

  1. Step 1: Identify standard test case format

    Standard test cases include clear ID, description, and expected result fields.
  2. Step 2: Compare options to standard format

    Test Case ID: TC001\nDescription: Verify login functionality\nExpected Result: User logs in successfully matches the clear, structured format; others are incomplete or unclear.
  3. Final Answer:

    Test Case ID: TC001\nDescription: Verify login functionality\nExpected Result: User logs in successfully -> Option A
  4. Quick Check:

    Clear ID, description, expected result = Test Case ID: TC001\nDescription: Verify login functionality\nExpected Result: User logs in successfully [OK]
Hint: Look for clear ID, description, expected result format [OK]
Common Mistakes:
  • Using unclear or incomplete test case fields
  • Mixing field names or order
  • Omitting expected results
3. Consider this code snippet representing a simple test function in Python:
def test_addition():
    result = 2 + 3
    assert result == 5
    print('Test passed')

What will be the output when this test runs?
medium
A. SyntaxError
B. Test passed
C. No output
D. AssertionError

Solution

  1. Step 1: Analyze the test function logic

    The function adds 2 + 3, stores 5 in result, then asserts result equals 5, which is true.
  2. Step 2: Determine output after assertion

    Since assertion passes, the print statement runs, outputting 'Test passed'.
  3. Final Answer:

    Test passed -> Option B
  4. Quick Check:

    Assertion true means print runs [OK]
Hint: If assert condition is true, print runs [OK]
Common Mistakes:
  • Thinking assertion always raises error
  • Expecting no output from print
  • Confusing syntax with runtime error
4. A tester wrote this test script snippet:
def test_divide():
    result = 10 / 0
    assert result == 0

What is the main problem with this test?
medium
A. Test function name is incorrect
B. Assertion should check for 10, not 0
C. Missing print statement
D. Division by zero causes runtime error

Solution

  1. Step 1: Identify the operation causing error

    Dividing 10 by 0 causes a ZeroDivisionError at runtime.
  2. Step 2: Understand impact on test execution

    Because of the error, assertion is never reached and test fails with exception.
  3. Final Answer:

    Division by zero causes runtime error -> Option D
  4. Quick Check:

    Division by zero = runtime error [OK]
Hint: Division by zero always causes error [OK]
Common Mistakes:
  • Ignoring runtime error and focusing on assertion
  • Thinking assertion is wrong instead
  • Assuming print statement needed
5. In a software project, testing is integrated throughout the lifecycle. Which testing type is best suited to catch issues caused by changes in code after deployment?
hard
A. Regression Testing
B. Unit Testing
C. Acceptance Testing
D. Smoke Testing

Solution

  1. Step 1: Understand testing types and their purpose

    Unit Testing checks small code parts; Acceptance Testing checks user needs; Smoke Testing checks basic functionality.
  2. Step 2: Identify testing for post-deployment changes

    Regression Testing reruns tests to ensure new changes don't break existing features after deployment.
  3. Final Answer:

    Regression Testing -> Option A
  4. Quick Check:

    Regression Testing catches post-change issues [OK]
Hint: Regression Testing checks after code changes [OK]
Common Mistakes:
  • Confusing unit testing with regression testing
  • Thinking acceptance testing covers code changes
  • Assuming smoke testing is for detailed checks
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard