Key Points To Remember While Testing Data Streams

Pavan Kumar S
TestVagrant
Published in
5 min readSep 13, 2019

Data Streaming and Event-Driven Architecture topics are tightly coupled to each other, so let’s understand these topics with simple examples. Purpose of this blog is to share a few key points to consider while building Automation Test Suite for Event-Driven Architecture.

In any e-commerce platform, there will be an Inventory Control System which basically keeps track of purchasing, shipping, receiving, tracking, warehousing , storage, turnover, and reordering etc. These terms differ from application to application, when you order a product online and when product is ready for shipping then the state of the product should change from “Order Received” to “Ready for Shipping” in Inventory Control System and this change of state continues till product completes the cycle of “Order Fulfilment”

Order FulFilment Cycle

In every phase of the above Order Fulfilment Cycle, there is some information/data is passed to next phase of the cycle in sequence, this process of passing of information/data and making kick start of the next phase we can call it as “Event”.If you picture this process of “Order Fulfillment Cycle” in the backend system then there will be millions of “Events” generated in any e-commerce application per day.

To manage these millions of Events there should be an architecture that we can call it as “Event-Driven Architecture”, considering Events as a piece of data, to manage those Events, process and to make meaningful transaction out of it “Data Streaming” is necessary.

What is Data Streaming and usage ?:

“A software design pattern in which application data is modeled as streams of events, rather than as operations on static records .Streaming data is data that is continuously generated by different sources at high-speed rate,which typically send in the data records simultaneously, and in small sizes. Streaming data includes a wide variety of data such as log files generated by customers using your mobile or web applications, ecommerce purchases, information from social networks.

There are a lot of streaming data available ( e.g. customer transactions, activities, website visits) and they will grow faster with IoT use cases ( all kind of sensors). Streaming is a much more natural model to think about and program those use cases.

Businesses with streaming architectures require powerful analytics tools for ingesting and processing information ,this data needs to be processed sequentially and incrementally on a record-by-record basis or over sliding time windows, and used for a wide variety of analytics including correlations, aggregations, filtering, and sampling.”

If you look at the above scenario we can pull out two terms “Publisher” and “Subscriber” , one publishes the Event/data and other consumes it.

This is the overview of Data Streaming and EDA(Event-Driven Architecture) and below diagram summarizes how Data Streaming looks in Event-Driven Architecture.

Data Streaming in EDA

When it comes to testing/Building an Automation suite around EDA following a few key points needs to be considered.

1. EcoSystem: Testing of EDA relies on complex test ecosystem, Automation framework which is built for EDA should be dynamic enough to generate different kinds events considering all kinds of scenarios which get consumed by subscriber and aggregates generated events which goes through different phases of order fulfilment cycle. Example for events: Product Price update, Product features update, Order Placement, Order Cancel, Order return, Transaction Failure and list goes on...

2. Test Data Preparation ,Data Ingestion and Validation: In E-commerce world there can be hundreds of data/metadata tagged to a single product,let’s take an example if you are ordering a“Smart TV” through any of your favourite E-commerce application then there will be ‘n’ number of information tagged to it like Brand, Price, Size, Model, Offers, Description etc..

If you look into the data of any product in Database then every single field is independent enough to get ingest into Database and gets tagged to each other with a common and global key called “productid”. When Data ingestion happens for anyone of the fields then “Event” gets triggered, it will get consumed , aggregates and if all mandatory fields are present then it comes out as a sellable product.

Test Automation suite should be well equipped enough to ingest plenty of data independently to trigger hundreds of “Events” continuously and Data validation should be at “subscriber” side. Once Event is successfully consumed by subscriber then “Aggregation” should be tested thoroughly.

3. Events Loss: When events get generated by Publisher through Data Pipeline there can be few scenarios where events get lost in the Data pipeline and may not gets consumed by Subscriber and loss of Events can be because of various reasons which may be valid/invalid. While building an Automation Suite for EDA QA should consider all negative scenarios and corner use cases to validate valid/invalid Event loss scenarios.

4. Order of Events(Latency): Sometimes in Data pipeline order of Events really matters a lot, assume that “Year End Sale” is sale is going on E-commerce Website and there are millions of price discount Events are ingested to Data Pipeline during Year End Sale duration,Business cannot afford price discount events get delayed in Data Pipeline and get consumed after discount sale is over. Below graph shows sample Events latency in Data Pipeline for one of the E-commerce application.

Events Latency in EDA

Automating Order Of Events and validating Aggregation on the correct order of Events becomes important use case for QA.

Below diagram shows overview of Automation Test Architecture for Data Streaming and it is self-explanatory, above four key points are summarized in this overview diagram, QA should write more Tests in highlighted modules.

There are more aspects which can be considered while building Test Automation for Event-Driven Architecture but above four key points plays important role.

Happy Reading….

--

--