0
0
Testing Fundamentalstesting~10 mins

Pair testing in Testing Fundamentals - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test simulates a pair testing session where two testers work together to test a simple login form. It verifies that both testers can interact with the form and validate the login functionality collaboratively.

Test Code - unittest
Testing Fundamentals
class PairTestingSimulation:
    def __init__(self):
        self.login_successful = False
        self.tester1_input = None
        self.tester2_input = None

    def tester1_enters_username(self, username):
        self.tester1_input = username

    def tester2_enters_password(self, password):
        self.tester2_input = password

    def submit_login(self):
        if self.tester1_input == 'user' and self.tester2_input == 'pass':
            self.login_successful = True
        else:
            self.login_successful = False

import unittest

class TestPairTesting(unittest.TestCase):
    def test_pair_login(self):
        session = PairTestingSimulation()
        session.tester1_enters_username('user')
        session.tester2_enters_password('pass')
        session.submit_login()
        self.assertTrue(session.login_successful, 'Login should be successful with correct credentials')

if __name__ == '__main__':
    unittest.main()
Execution Trace - 5 Steps
StepActionSystem StateAssertionResult
1Test starts and PairTestingSimulation instance is createdA new testing session is ready with no inputs-PASS
2Tester 1 enters username 'user'Username field set to 'user'-PASS
3Tester 2 enters password 'pass'Password field set to 'pass'-PASS
4Submit login is triggeredSystem checks if username and password match expected valuesCheck if login_successful is TruePASS
5Assertion verifies login successlogin_successful is TrueassertTrue(login_successful)PASS
Failure Scenario
Failing Condition: Either tester enters incorrect credentials
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify in the pair testing session?
AThat only one tester can enter data
BThat the system rejects all logins
CThat both testers can input credentials and login succeeds
DThat the password is visible on screen
Key Result
Pair testing helps catch issues early by combining two testers' perspectives, improving test coverage and collaboration.