How to Test Graphs and Charts (Sample Test Cases)

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated March 10, 2024

How to Test Graphs and Charts: Learn with sample test cases

A chart is a graphical representation of data. Graphs and Charts can be used for easy data interpretation.

Humans are wired for visuals. Half of the brain is dedicated to visual functions and 90% of the information transmitted to the brain is visual. And hence, data visualization becomes of great importance in the corporate world, primarily in the area of business intelligence.

Graph And Chart Testing

Introduction to Graph and Chart Testing

Graphs and charts are very much helpful for businesses for presenting and understanding the data. These graphs and charts are congregated under different business dashboards.

These dashboards aid in conveying data-driven messages effectively through easily understandable combination charts. They let you highlight trends, relationships, and outliers.

There is a wide variety of graphs and charts available for different industrial functions. Some most common types include line graphs, bar graphs and histograms, pie charts and cartesian graphs. Also, the selection of the type of chart will depend upon the kind of visualization you want to achieve.

Data Visualization

Generally, the visualization is divided into four categories:

#1) Relationships

If you want to highlight relationships, you can use a scatter chart, bubble chart.

An example of a scatter chart is shown below:

Relationships

[image source]

#2) Comparisons

For comparisons, you can use the table, bar charts, column charts, line charts, etc.

Below is an example of a bar chart:

Comparisons

[image source]

#3) Distribution

For showing distribution, scatter charts, line histograms, and column histograms can be used.

Below is an example of a histogram:

3.Distribution

[image source

#4) Composition

For highlighting the compositions, stacked column charts and pie charts can be used.

Below is an example of a pie chart:

4. Composition

[image source]

Having had enough idea about the charts & graphs and their significance in the business world, let us now move to the testing of graphs and charts.

As we have seen that the charts and graphs represent critical business-related information, so their testing is equally important. A wrong chart or graphs can lead to misleading interpretations and can hamper decision making, business results, and brand image. So, it is very important that the information presented through graphs or charts is correct.

Sample Test Cases for Testing Graphs and Charts

1) No data found message should be displayed when there is no data in the graph.
2) Waiting cursor or Progress bar should be given on Graph Load
3) Correct values displayed with respect to its Pivot table (values of the graph x-axis & y-axis matches its table values)
4) If the Graph is hyperlinked (on click, navigates to some other page), it should redirect to the expected page
5) Graph Report should be Printable or downloadable
6) Color combinations Should be according to your Application Standards
7) you should test how the data variation affects the graph. The chart has to respond immediately to the data changes
8) you need to check with all possible combinations of data
9) Tool-tip should be available on Graph values which contains basic information about the value
10) Information Icon should available which gives the basic information about the graph to User
11) Check the Graph with various filters if any
12) Position and color of Legends must be proper
13) Plotting range should be dynamic and logical
14) Values in Graph should be in Proper culture
15) Check the Graph with less and more data, small & large Date Rang
16) Test the Graph for Boundary values by using boundary value analysis
17) Use equivalence class partitioning to minimize input data
18) Test the Performance of Graph load with different amount of data
19) Scroll-bar need to be available to see the entire graph
20) Export the Graph in Excel or PDF and see how it looks
21) Test the Graph report in all supported browsers.
22) Must use Standard Font Size and Font Style at Graph Dashboard
23) Graph or chart name should be meaningful

Dashboard Test cases

When a BI dashboard is developed for customers, it is vital to do some checks to validate the data and design of incorporated reports.

For example, if a dashboard is created with too many reports and prompts on the same page, it can make it difficult for the user to gain insights clearly. Or, say if the default selection of the prompt ‘month’ had to be the current month as per design specification, but the developer has hardcoded it to some month of the year.

Another example could be that when data accuracy test was done to compare the data on the dashboard against the result of queries on the source system, a lot of discrepancies was found. So, in order to avoid such scenarios, we need proper testing of BI dashboards.

Test cases for Dashboard Design Check

  • Ensure that the title of the dashboard page matches the contents of the report.
  • Verify that the axis of the charts is labeled properly.
  • The aggregation level of data on the BI dashboard should be as per the requirements.
  • The dashboard page design should follow the design standards and best practices.
  • Verify that the download and print options are working fine.
  • Wherever applicable, verify that the dashboard help text is present and is correct as per the dashboard contents.
  • Verify the presence of any mandatory static display of text on the dashboard.

Test cases for Prompts Check

  • Check if all the required prompts are available on the dashboard and they conform to the design specification.
  • Validate the label and list of values displayed for each prompt.
  • Apply each prompt and check that the data in the dashboard report is getting filtered accordingly.
  • The default prompt selection should be as per the dashboard page design specification.

Test cases for Report Data accuracy checks

  • Corresponding to the information displayed on the dashboard report, write an equivalent database query for source and target databases. Execute this query and compare the results against what is displayed on the dashboard.
  • Check if the database query generated by the report is having any issues.

Test cases for Drill down report checks

For every link to the drill-down report, you need to review the following things:

  • Counts should match between the summary and detailed report.
  • If the summary report is having a link to the detailed report, verify that these links are working the charts, tables, table headings.
  • Prompts from the summary report should get apply to the detailed report.
  • Check that the database SQL query for the drill down report is as required.

Test cases for Dashboard performance checks

  • Check that the reports and dashboard page rendering times are within SLA limits.
  • Test the performance of various prompt selections.

Test cases for Browser checks

  • Check the browser compatibility of the report or dashboard page. This often depends upon the BI tool used for the creation of the dashboard.

Tools for Testing Charts

#1) Chart Testing:

Chart Testing is an open source and free command line interface tool for testing helm charts.

It automatically discovers charts modified against the target branch.

A helm chart is comprised of many kubernetes resources and components that work collectively. When the chart is installed, you may want to test if it is working as expected.

Example tests:

  • Verify that the configuration from values.yaml file is properly injected.
  • Check that your services are up and properly load balanced.

Website: Chart Testing

#2) Ocular:

You can use the tool ocular for automated validation of charts and graphs based on the image comparisons.

Conclusion

In this article, we have seen the importance of data visualizations (charts, graphs, dashboards, etc.) in the business.

Since data visualization is very important and so is the testing of the same. We went through some general sample test cases for testing graphs, charts, and dashboards.

Hope this was a useful read!

Was this helpful?

Thanks for your feedback!

Leave a Comment