Episode 11: Test Driven Development (feat. Sarah Dayan)
Enjoy the Vue - A podcast by The Enjoy the Vue Team
Categories:
This week we are joined by Sarah Dayan. Sarah currently works for Algolia as a Staff Software Engineer as a Tech Lead of the Doc Squad. If you’ve ever gone on the Vue.js documentation, than you’ve used Algolia. You may have seen Sarah speak about Test Driven Development (TDD) at VueConf in Toronto or Vue.js Amsterdam. In this episode we get to pick Sarah’s brain about TDD. Where do you start, what do you test, what don’t you test?
[00:02:37] Sarah was on the docket to speak at VueConfUS. Since it got cancelled, she shares those of us Stateside all about testing in Vue and why TDD is great.
[00:05:25] Ari asks Sarah about what a contract in a component and what it means. Sarah breaks this down with a very simple example, a button.
[00:09:50] Ben gets Sarah’s thoughts on end to end testing. She makes a case for Test Driven Development applying to more than just unit tests.
[00:15:51] Tessa who saw one of Sarah’s presentations on TDD, asks her about her “tip” on when to test and when not to test. Sarah puts it simply, the question to ask is: “Do I care about it if it changes?”.
[00:21:40] Sarah give us some good practices that you may want to implement when testing. Whether you are doing unit or end to end testing.
[00:24:51] After Tessa asks Sarah about Snapshot Tests and whether a link text fits in a Unit Test. Sarah believes Snapshot Tests are better when you want to test logs or code. She feels they should not be used in place of Unit Tests, since they cannot test behaviour.
[00:28:33] Ben talks about how some Dev’s have an obsession with getting 100’s on Code Coverage Reports. Sarah goes into how not to get caught up in the “vanity metrics”. The group joke around how it that obsession may originate from gaming and how we have to collect every coin and badge.
[00:34:23] Tessa enquires about testing for accessibility.
[00:39:34] Ari gives an example of working at a fast paced start-up, and whether or not TDD can reconcile when you don’t have clear cut requirements. Is it even possible? Sarah shows how it can save money since everything won’t need to be retested by hand.
About our guest: Sarah Dyan
Sarah's picks
- XState (state machines/statecharts library)
- Vuex ORM (object-relational mapping access to the Vuex store)
- The 100 on Netflix
- Master of None on Netflix
Tessa's picks
- The Good Place - NBC/Netflix
- Anne with an E - Netflix
- Dispatches from Elsewhere - AMC
- We Should Get Together (Kat Vellos) - Book (DRM-free via her website and her preferred method to purchase iirc https://weshouldgettogether.com/products/epub-we-should-get-together-the-secret-to-cultivating-better-friendships)
- Animal Crossing - Switch
- Vue DC remote meetup
Other resources mentioned
Special Guest: Sarah Dayan.