SDET vs QA Engineer
Skills Gap: Where to Focus
Core Programming Skills for SDETs
An SDET who cannot read and write production-quality code is a test scripter. SDETs who understand software engineering principles become indispensable.
The Minimum Programming Bar
You do not need to be a full-stack engineer. You need to be able to:
- Read code: Understand what a method does well enough to identify what could go wrong
- Write maintainable test code: Clean, well-structured test code that other engineers want to maintain
- Debug failures: Distinguish between test bugs, application bugs, and environment issues
- Review pull requests: Give meaningful code review on both application and test code
Object-Oriented Principles Applied to Testing
Encapsulation: Page objects encapsulate UI interaction. Step definitions call POM methods — they don't call WebDriver directly.
Inheritance: Base test class holds @Before/@After setup. Subclasses inherit setup without duplicating it.
Composition: Test helpers composed from smaller utilities — better than deep inheritance hierarchies.
Single Responsibility: Each class has one purpose. LoginPage handles login interactions. LoginSteps wires Gherkin. LoginFixtures creates test data.
Design Patterns Used in Test Automation
Factory: Create different test users based on role:
UserFactory.admin() → user with admin role
UserFactory.customer() → user with free plan
UserFactory.premium() → user with paid subscription
Builder: Construct complex test objects fluently:
Order order = new OrderBuilder()
.withProduct("Widget A", 2)
.withProduct("Widget B", 1)
.withShippingAddress("123 Main St")
.withPaymentMethod("test-visa")
.build();
Strategy: Swap authentication methods:
// Different strategies for different test contexts
LoginStrategy strategy = isApiTest ? new ApiKeyStrategy() : new SessionCookieStrategy();
driver.authenticate(strategy);
Code Quality in Test Code
Apply the same standards to test code as production code:
- No magic numbers or strings — use constants or enums
- Descriptive method names:
submitLoginForm()notclickButton() - No duplicate code — extract to shared helpers
- Tests should be readable without comments
Why should SDETs apply software engineering design patterns to test code?
Next Lesson
Classes, Objects, Inheritance in Java