Pathway Analytics
  • Introduction
  • Blog
    • MMM Showdown: Google Meridian vs. PyMC Marketing
    • Drop Line Charts - Use Process Behavior Charts Instead!
    • Create a GitBook Data Science Portfolio
    • 5 Reasons I Chose Johns Hopkins Online AI Masters Program
  • Statistics
    • Google Lightweight MMM
    • Propensity Score Matching
    • Thompson Sampling
    • Basketball Free Throw Percentage App
  • Deep Learning
    • Classifying Medical Abstract Sentences
    • Predicting Bitcoin Prices
    • Food Image Classifying
  • Supervised Learning
    • Waiter Tips Multivariate Regression
    • Sleep Cycle - Analyzing My Own Sleep Data
  • Unsupervised Learning
    • Customer Segmentation using KMeans
    • Time Series Clustering
  • Dashboards, Reports, and Visualizations
    • Shiny Useful Code
    • R Markdown Reports
  • Mini Notes
    • Useful SQL Code
    • Testing Code
    • Correlation Plots
    • Docker - Jupyter Lab and R Studio Setup
    • Tensorflow GPU Setup
    • Object Oriented Programming
    • R and Python Together using Reticulate
    • Random Forests are Versatile
Powered by GitBook
On this page
  • Introduction
  • Benefits of Unit Testing
  • Useful Links:
  1. Mini Notes

Testing Code

Created by Chia, Jonathan on Apr 09, 2022

Introduction

You already test your code manually, so why not write a few more lines of code to document and automate your tests?

Benefits of Unit Testing

  • Detect bugs earlier: Running big data projects is time consuming. You don't want to get an unexpected output after 3-hours when you could have easily avoided it.

  • Easier to update code: You will no longer be afraid of changing your code because you know what to expect.

  • Push you to organize your code: You will write cleaner code and prefer to write in DAGs instead of linearly chaining functions when you keep in mind you are gonna test your codes with isolated pieces. (use d6tflow to build data science workflows easily)

  • Give you confidence on the outputs: Bad data leads to bad decisions. Running unit tests gives you confidence on data quality. You know your code outputs what you want it to output.

- Norman Niemer, Chief Data Scientist

Useful Links:

R

https://r-pkgs.org/tests.html

Shiny

https://mastering-shiny.org/scaling-testing.html

Python

https://towardsdatascience.com/unit-testing-for-data-scientists-dc5e0cd397fb

Unit Testing with SQL Developer 21.2 (PL/SQL)

https://docs.oracle.com/cd/E15846_01/doc.21/e15222/unit_testing.htm#RPTUG45000

Document generated by Confluence on Apr 09, 2022 16:54

Atlassian

PreviousUseful SQL CodeNextCorrelation Plots

Last updated 3 years ago