---
layout: post
title: "Demonstration of test driven development in R with testthat (CC269)"
blurb: "TDD in R"
author: "PD Schloss"
date: 2024-03-28 11:00
comments: false
youtube: TaNvqwMmHus
start_hash: 2b630aa71177721611419c978d3da422d2f0fb41
end_hash: 088c275123b1f9a22fef78cad90fca0c63b9a68c
---

In test driven development you write the tests first, have them fail, and then write your code to pass the tests. In this episode, Pat provides a demonstration of TDD for two functions he's written to extract k-mers from a DNA sequence. This part of a larger effort to develop his phylotyper R package that will use kmer-based methods of classifying 16S rRNA gene sequences to their correct bacterial taxonomy. 

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Code

You can browse the state of the repository at the

* [beginning of the episode](https://github.com/riffomonas/phylotyper/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/drought_index/tree/{{page.end_hash}})
