0
0
Software Engineeringknowledge~30 mins

Equivalence partitioning and boundary value analysis in Software Engineering - Mini Project: Build & Apply

Choose your learning style9 modes available
Equivalence Partitioning and Boundary Value Analysis
📖 Scenario: You are a QA engineer designing test cases for a function that validates a student's exam score. The score must be an integer between 0 and 100 (inclusive). You will use equivalence partitioning and boundary value analysis to derive a minimal but effective test set.
🎯 Goal: Build a Python model that defines equivalence partitions, selects representative values, identifies boundary values, and combines them into a final test set with expected results.
📋 What You'll Learn
Define equivalence partitions for the score input domain
Select one representative value from each partition
Identify boundary values at partition edges
Combine partitions and boundaries into a final test set with expected outcomes
💡 Why This Matters
🌍 Real World
EP and BVA are used in every QA department to design efficient test cases. They are standard techniques in ISTQB certification and required knowledge for QA roles.
💼 Career
QA engineers and SDETs are expected to derive test cases from specifications using EP and BVA. These techniques appear in virtually every software testing interview.
Progress0 / 4 steps
1
Define equivalence partitions
Create a dictionary called partitions with three entries: 'invalid_low' mapped to 'score < 0', 'valid' mapped to '0 <= score <= 100', and 'invalid_high' mapped to 'score > 100'.
Software Engineering
Hint

Three partitions cover all possible integer inputs: below range, within range, and above range.

2
Select representative values from each partition
Create a dictionary called partition_tests with three entries: 'invalid_low' mapped to -10, 'valid' mapped to 50, and 'invalid_high' mapped to 150.
Software Engineering
Hint

Pick any value well inside each partition. The exact value does not matter as long as it clearly belongs to that class.

3
Identify boundary values
Create a dictionary called boundary_tests with six entries: 'below_lower' mapped to -1, 'at_lower' mapped to 0, 'above_lower' mapped to 1, 'below_upper' mapped to 99, 'at_upper' mapped to 100, and 'above_upper' mapped to 101.
Software Engineering
Hint

Test one value below, at, and above each boundary. For lower boundary 0: test -1, 0, 1. For upper boundary 100: test 99, 100, 101.

4
Combine into final test set with expected outcomes
Create a dictionary called final_tests. Use a for loop with variables name and value over partition_tests.items(), setting final_tests[value] to 'valid' if 0 <= value <= 100 else 'invalid'. Then use another for loop with name and value over boundary_tests.items() doing the same.
Software Engineering
Hint

Each test value gets an expected outcome: valid if within 0-100, invalid otherwise.