QA
Mid-level QAFrameworks & Design PatternsFree question

What is a hybrid framework? Compare data-driven, keyword-driven and BDD frameworks.

60-second answer

A data-driven framework separates test data from test logic, so the same test runs with many data sets from Excel, CSV or JSON. A keyword-driven framework defines actions as keywords, like click, enterText, verifyText, in a table, so non-programmers can write tests, but it's harder to maintain. BDD uses Gherkin feature files with Given-When-Then, written in business language and linked to step definitions in code, with tools like Cucumber. A hybrid framework combines these, typically Page Object Model plus data-driven plus optional BDD, to get the benefits of each.

Explanation

TypeStrengthWeakness
Linear / record-playbackQuick startUnmaintainable
ModularReuseNeeds coding
Data-drivenMany inputs, one testData management
Keyword-drivenNon-coders can authorAbstraction overhead, debugging
BDDShared understanding, living docsExtra layer; useless if business doesn't read it
HybridPick what fitsNeeds design discipline

Example

Our framework is POM-based, with JSON data providers for data-driven checkout tests, and a small Cucumber layer only for acceptance scenarios the product owner reviews.

Sample code

Feature: Checkout
  Scenario Outline: Apply coupons
    Given I have a cart worth <total>
    When I apply coupon "<code>"
    Then I should pay <payable>

    Examples:
      | total | code    | payable |
      | 1000  | SAVE10  | 900     |
      | 1000  | FLAT200 | 800     |