I’m a big fan of test-driven development for lots of reasons. In addition to helping you clearly define your goals in advance and encouraging you to write as little code as possible, I love the documenting nature of tests. If your project is well tested, you don’t need documentation (at least for other developers) — they can simply look at the tests and observe the enforced behavior of the code.
Unfortunately, testing SQL (or any logic that works on data in a tabular format) is very difficult. There are a lot of reasons for this, but the two I think about most are:
- because tabular data tends to represent lots of complicated concepts bound together, it takes a lot of work to generate realistic test-cases
- the logic expressed in SQL tends to be much more complicated than what is normally expressed in a small function amenable to unit-tests, so every test ends up being an “integration” test.
I work a lot in (and am a huge proponent of) the extract-load-transform (ELT) framework which involves writing complex data transformations in SQL that are then run against raw data stored in the data warehouse (generally via tool like dbt). dbt really improved the ability to test ELT pipelines by allowing developers to specify assertions about the transformed data. Most commonly things like “uniqueness” and “not-nullness” of certain columns, but dbt also allows the developer to specify arbitrarily complex assertions about the transformed data. This is a huge boon, but in almost all implementations I’ve seen, the tests are run against production data after the transformations have been applied rather than against a dedicated test database.
In this paradigm, checking to see if a new transformation obeys the tests often means running the transformation against the full production database in order to validate it. This can be slow and tedious if your transformations take a long time to run. Even on small projects, executing a pipeline and testing it can take upwards of 10 minutes — this is way too slow for doing real test-driven development where ideally you’d like feedback on the order of seconds.
In order to support a more test-driven development workflow for data warehouse development, I believe we need a tool for better generating useful test data. These test data should have the following properties:
- Match the production database schema exactly
- Contain the minimum volume of data required for the tests (so that everything runs as fast as possible)
- Not contain sensitive production data
Most importantly, it should be easy to generate useful “test cases” for doing test-driven development — having to write tedious insert statements to generate the test data for a database just isn’t going to cut it. (If you’ve ever tried doing this, you know that it is extremely tedious and error-prone and not conducive to an efficient developer workflow.)
So, how should we generate these test cases? In my experience, when I’m working on an ELT pipeline, my workflow looks something like:
- Identify a bug because some report “looks wrong”.
- Track down a certain user that exhibits some weird pathological data problem (“oh dang I didn’t know you could have one order shipped to two different addresses”)
- Write ELT code, run it against the production database, repeatedly query the tables filtered to that pathological user to see if the code actually fixes the issue.
- Finally deploy the code, ideally with at least a commit message that references the pathological user id.
Of course, this workflow is not the best! Ideally, we’d have a test case for that pathological data case, but because the overhead of generating data that matches the case is so high, in general, it doesn’t happen.
In my ideal tool, we’d be able to quickly generate test data based on a pathological example from the production database. So the workflow would look something like:
- Identify the pathological user/order
- Tell the tool to copy and anonymize all of the relevant production data for that user into the test database
- Write an assertion that specifies the expected behavior of the data for that user post-transformation
- Run proposed ELT code against the minimal test database, and run all assertions
- Once all of those tests pass, we can push the code to our CI tool which can run the assertions against the full production database
The critical feature here is how we identify and copy pathological test data from the production database in an anonymized way that will allow for using it as a test case. This hooks directly into the current developer workflow, adds the benefits of a true test-driven development workflow, and also builds up the test suite so that it more fully covers all of the potential logical regressions we want to guard against.
Are you doing TDD in ELT? Know of a tool that can generate test data in the way I’ve outlined? I’d love to chat.
does cialis keep you hard after coming
does cialis keep you hard after coming
cialis once a day
cialis once a day
cialis commercial bathtub
cialis commercial bathtub
cialis online no prescription
cialis online no prescription
can i buy codeine in a pharmacy
can i buy codeine in a pharmacy
best viagra pills
best viagra pills
generic viagra online mastercard
generic viagra online mastercard
cialis 5mg daily how long before it works
cialis 5mg daily how long before it works
cialis genetic
cialis genetic
cialis back pain
cialis back pain
flagyl lyfja
flagyl lyfja
valtrex handbags
valtrex handbags
pregabalin and hair loss
pregabalin and hair loss
metformin kag
metformin kag
furosemide guidelines
furosemide guidelines
lisinopril sotalol
lisinopril sotalol
can rybelsus be used for weight loss
can rybelsus be used for weight loss
rx cephalexin
rx cephalexin
does zoloft make you high
does zoloft make you high
escitalopram online prescription
escitalopram online prescription
gabapentin ciprofloxacin
gabapentin ciprofloxacin
can you take amoxicillin and keflex together
can you take amoxicillin and keflex together
what is the best time of day to take duloxetine
what is the best time of day to take duloxetine
sudafed and lexapro
sudafed and lexapro
TDD for ELT
https://www.guideitech.com/come-creare-infografiche-facilmente/
TDD for ELT
https://zolfshop.com/en/braga-recebe-nova-loja-fisica-da-zolf/
TDD for ELT
https://hot256ug.com/2023/08/02/vanessa-and-lwasa-reunited-after-dna-test-revealed-the-children-werent-his/
TDD for ELT
http://www.perfosoccer.com/2017/10/16/a-four-year-plan-focused-on-your-future/
ciprofloxacin warnings
ciprofloxacin warnings
side effects of bactrim antibiotic
side effects of bactrim antibiotic
bactrim vs bactrim ds
bactrim vs bactrim ds
TDD for ELT
https://www.micromail.com/?URL=https://cheapcamshows.com/en/events/jeniffer/
neurontin for sleep disorders
neurontin for sleep disorders
flomax per dolori mestruali
flomax per dolori mestruali
ezetimibe slides
ezetimibe slides
augmentin pregnancy category
augmentin pregnancy category
cozaar generic name
cozaar generic name
minirin ddavp compresse bambini
minirin ddavp compresse bambini
does flexeril cause constipation
does flexeril cause constipation
depakote vs valproic acid
depakote vs valproic acid
aspirin overdose
aspirin overdose
what are the side effects of amitriptyline
what are the side effects of amitriptyline
intrathecal baclofen pump
intrathecal baclofen pump
where to buy ashwagandha
where to buy ashwagandha
bupropion vs buspirone
bupropion vs buspirone
does diltiazem cause constipation
does diltiazem cause constipation
repaglinide nice guidelines
repaglinide nice guidelines
TDD for ELT
http://www.strike-games.com/WP/2021/05/11/ya-esta-disponible-la-actualizacion-de-mayo-para-xbox-series-xs-y-xbox-one/
robaxin for sciatica
robaxin for sciatica
abilify assistance programs
abilify assistance programs
is voltaren 1 percent gel the same medication diclofenac gel
is voltaren 1 percent gel the same medication diclofenac gel
actos vidal
actos vidal
tamsulosin pharmacopeia
tamsulosin pharmacopeia
is tizanidine like xanax
is tizanidine like xanax
protonix side effects long term use
protonix side effects long term use
jamp sitagliptin
jamp sitagliptin
TDD for ELT
https://integrimievropian.rks-gov.net/sr/diskutovao-o-radu-misije-za-prikupljanje-cinjenica-za-liberalizaciju-viza/
TDD for ELT
https://saquedemeta.co/estas-son-las-armas-de-los-leones-del-atlas/
TDD for ELT
https://www.biomedicaservice.com/nuovo-sito-online/
TDD for ELT
https://www.blog.engineersconnect.com/what-engineering-has-taught-me-naisargi-doshi/
cialis online pills
cialis online pills
can i take sildenafil daily
can i take sildenafil daily
sildenafil tadalafil vardenafil comparison
sildenafil tadalafil vardenafil comparison
TDD for ELT
https://shopessentials.dk/shop/dame/styling-dame/lyxo-haarelastik/
us online pharmacy generic viagra
us online pharmacy generic viagra
ivermectin lotion cost
ivermectin lotion cost
blue sky peptide tadalafil review
blue sky peptide tadalafil review
ivermectin 3mg tablets
ivermectin 3mg tablets
ivermectin 5 mg price
ivermectin 5 mg price
what question should the nurse ask when assessing for therapeutic effects of vardenafil?
what question should the nurse ask when assessing for therapeutic effects of vardenafil?
TDD for ELT
https://web.siamsite.com/8-little-known-side-effects-of-too-much-fish-oil/
TDD for ELT
https://amthucsaigon.info/com-luon-nhat-ban-bieu-tuong-am-thuc-nhat/
TDD for ELT
https://juprimaulana.com/penyebab-dan-solusi-praktis-jika-pin-adsense-tidak-kunjung-datang/
TDD for ELT
https://main.gazetakorrekte.com/blerina-bo-mbaj-ne-qoftese-ju-do-te-hani-keto-ushqime-te-pakten-1-here-kurre-nuk-do-te-vuani-nga-sem-undjet-e-melcise/
amoxicillin for tooth infection
amoxicillin for tooth infection
can i take an extra metformin if my sugar is high
can i take an extra metformin if my sugar is high
how long does it take for keflex to work
how long does it take for keflex to work
is ampicillin compatible with potassium chloride
is ampicillin compatible with potassium chloride
how long does pregabalin take to kick in
how long does pregabalin take to kick in
trazodone generic name
trazodone generic name
TDD for ELT
https://delsuecho.com/2023/08/02/just-in-efcc-raids-abraka-arrests-52-internet-fraud-suspects/
TDD for ELT
https://mhtt.sa/portfolio/the-field/
TDD for ELT
http://svarasoft.com/revolutionize-your-business-with-our-cutting-edge/
TDD for ELT
http://sykkelsor.no/2017/06/03/santa-cruz-forhandler/
TDD for ELT
https://7ballvip.net/dang-ky-tai-khoan-7ball/
TDD for ELT
https://ondreville-sur-essonne.fr/visite-du-moulin-de-chatillon-dans-le-cadre-des-journees-du-patrimoine/
nolvadex pct where to buy
nolvadex pct where to buy
TDD for ELT
https://10milesseo.com/seo-for-moving-companies/
TDD for ELT
https://www.help-my-business-plan.fr/logiciel-business-plan-usa/un-jeune-sur-deux-souhaite-creer-son-entreprise-des-la-sortie-de-lecole/
TDD for ELT
https://foodiefavs.com/best-flavoursome-irish-breakfast-recipes-to-try-2023/
TDD for ELT
https://martinsimoveisijui.com.br/produtos/serum-anti-sinais-intensive-care-30ml
TDD for ELT
http://allrenewableenergy.co.uk/a-nice-entry/
TDD for ELT
https://namyab.com/چهارمردان/
TDD for ELT
https://humprojectlinus.org/blanket-chronicles/february-blankets-and-smiling-faces/
TDD for ELT
http://echelon-education.com/review-tanida/
TDD for ELT
https://elankashop.com/product/special-pack-2/
TDD for ELT
https://docsa.com.au/index.php/about-docsa/constitution/item/688-home-page?start=80
TDD for ELT
https://dcnacivt.com/posts/the-76th-will-be-hosted-in-baltimore-md/
TDD for ELT
https://emersonmigrationlaw.com.au/tennis-star-novak-djokovic-swaps-battles-on-the-court-for-battles-in-court/
TDD for ELT
https://buddybeds.com/do-your-dog-and-cat-get-into-m/
TDD for ELT
https://caythuocviet.com.vn/phieu-phan-tich-lan-gam-gold-2014/
TDD for ELT
https://www.imprespelli.it/en/catalog/digital-uv-print/item/84-app-carte-lav-6?start=15780
TDD for ELT
https://webmill.co.uk/how-can-i-tell-if-i-have-been-hacked/
TDD for ELT
https://trzebnickiklubpsa.pl/2021/10/27/poznaj-pokochaj-adoptuj-odslona-pierwsza/
TDD for ELT
http://metagirlontheroad.com/day-9-friday-august-6-2021/
TDD for ELT
https://validulich.vn/vali-chong-soc/
TDD for ELT
https://meetingfamouspeople.com/2018/03/30/elton-john-episode-1/
TDD for ELT
https://www.afjvv.fr/le-jour-ou-ma-vie-sest-arretee/
TDD for ELT
http://www.transbideak.com/en/berriak/nola-egin-zuzeneko-emisioa-google-hangouts-bidez/
TDD for ELT
https://zij-barneveld.nl/van-buurvrouwen-tot-hechte-vriendschap
TDD for ELT
https://asianculturevulture.com/portfolios/the-man-who-knew-infinity-review-dev-patel-and-a-great-nobility-of-soul/
TDD for ELT
https://pialundceramics.com/july-trending-items/
TDD for ELT
https://www.mlwebtechnologies.com/autohuur-reykjavik/reykjavik-autohuur79/
TDD for ELT
https://www.languageforlife.es/2023/02/01/cursos-nuevos-examenes-oficiales/
track phone location
This phone locator app is a lifesaver. Found my phone in minutes after leaving it in a taxi.
Konya SEO Hizmeti
Backlink değil, sırtlink! Konya SEO uzmanı yeni trendleri belirliyor.
buy followers instagram
The followers stayed longer than expected. Better than other services I’ve tried.
Web Sitesi Kurma
Internet sitesi kurma sureci biraz uzun surdu ama sonuc harika oldu.
football skills
football skills hello i am a football skiller
cristiano ronaldo skills
cristiano ronaldo skills hi i am a football skiller
TDD for ELT
https://misteruniverse.tv/uncategorized/hello-world/
TDD for ELT
https://goodbear.co.za/short-term-loans-blacklisted/
TDD for ELT
https://www.waltergarrodesign.com/2016/10/26/gallery-blog-post-example/
TDD for ELT
https://cifar.it/ut-ornare-convallis-metus-vel/
TDD for ELT
https://schwa-fire.com/hr-forecasting-framework-for-the-rise-and-evolution-of-the-human-resources-in-an-organization/
TDD for ELT
https://istqblearning.com/2022/10/28/pict-tools-user-guide-2/
TDD for ELT
https://enthaarung-mit-sugaring.ch/hello-world/
TDD for ELT
https://allthingscoms.com/all-things-coms-launches-delta-corporate-campaign-cheers-to-designated-drivers/
TDD for ELT
https://optiongmatdubai.com/integrated-reasoning/
TDD for ELT
https://gsotirelis.gr/2022/11/ο-μητσοτάκης-όσο-δεν-παραιτείται-είν/
TDD for ELT
https://backpackclan.com/top-10-places-to-visit-in-spiti-valley/