Elixir Mix

EMx 030: Writing Great Unit Tests with Devon Estes


Listen Later

Panel:
- Josh Adams
- Charles Max Wood
- Mark Ericksen
Special Guest: Devon Estes In this episode of Elixir Mix, the panel talks with https://twitter.com/devoncestes?lang=en who is a software developer who uses Elixir. He currently resides in Berlin, Germany and has been working there for the past four years. The panelists and the guest talk about https://elixir-lang.org, testing, and much more! Check it out! Show Topics: 0:00 – https://devchat.tv/get-a-coder-job/  0:49 – Chuck: I am starting a new show called http://thedevrev.com. Check it out http://thedevrev.com Our special guest today is Devon Estes. https://devchat.tv/elixir-mix/emx-018-devon-estes-all-in-on-elixir/ is a past episode you’ve been on – check it out https://devchat.tv/elixir-mix/emx-018-devon-estes-all-in-on-elixir/ 1:26 – Devon: I am American but live in Berlin, Germany for about 4 years now. I was a freelancer, but now I am at a “real” job now where I am a software developer using https://elixir-lang.org 1:50 – Chuck: Cool! 2:05 – Guest: Something to always talk about testing – it’s evergreen! 2:15 – Chuck: What are the benefits you get from testing and what is your approach? 2:24 – The guest answers the question. 3:53 – Panelist chimes in. 4:18 – Panel: I like playing around and I know when something is terrible. I have to poke around to figure out if I like it or not. I am an exploratory developer. I write a test and it looks great at first but the implementation is terrible or something. 5:54 – Mark comments on developers and how they interact with their code. 7:15 – Mark: How do you approach that? I heard you talking about tests, spikes and other things. 7:22 – Guest: If it is something that is small I will write the test first. If it’s larger I will usually do 2-3 spikes to figure out what is going on. The guest continues with this topic. 8:54 – Panel: I found that over the years I couldn’t do that. 9:21 – Guest: With the topic of testing inhttps://elixir-lang.org I have these “rules” but I break them all the time. Sometimes you get better, cleaner tests out of it if you were to break the rule(s.). Tests are only there for 90% of the time, in my own opinion. Sometimes you have to play around to see what’s going on. 10:36 – Panel: I agree a lot, especially with integrations. 10:49 – Guest. 12:18 – Panel: You have these guidelines or rules and you know when to break those rules. You talked about these specific rules and I thought it was interesting. I was reading through these and I have the same rules but you codified them with examples. Can you walk us through your guidelines? 13:00 – Guest: To be super clear I am talking about unit tests. When I think of testing there is this testing pyramid. 13:52 – Panel. 14:57 – Guest: Like I said, these rules are meant to be broken, if appropriate. 16:39 – Guest continues with unit testing and other types of testing. He talks about easier to more difficult kinds of tests. 17:42 – Guest (continues): Sometimes the tests are accurately true, and sometimes not. It can be easy to get into those traps. Hopefully they will tell you what is expected. 18:25 – Panel: In Ruby, there is a test that would modify your code and remove stuff? Was it Mutant? https://github.com/topics/mutation-testing 19:03 – Guest answers the question. 19:38 – Guest: I don’t know if https://elixir-lang.org has anything like that, yet, but it would be pretty cool. It would be a good idea for someone to take on! 20:00 – Chuck: I have had conversations with a colleague – they both pushed back and talked more about https://www.cypress.io and integrated tests. 21:04 – Chuck: I think it’s interesting to see the different approaches! 21:14 – Guest: We are lucky to have great tooling in https://elixir-lang.org The guest mentions https://wallabyjs.com 24:39 – The guest talks about unit levels. Check it out here! 26:35 – Panel. 26:48 – Chuck: How does it affect my workflow? I like end-to-end tests. The efficiency, if it’s repeating stuff – I don’t care – as long as it’s fast enough. If it ruins my workflow then it’s a problem. 27:22 – Panel. 28:12 – The topic “test coverage” is mentioned by Chuck. 28:25 – Panel. 29:02 – https://www.freshbooks.com 30:10 – Guest talks about Wallaby.js.  32:24 – Panel: We’ve had you on before, and the idea is that you are all into Elixir and its path. (https://devchat.tv/elixir-mix/emx-018-devon-estes-all-in-on-elixir/) 32:57 – Guest: I think testing in Elixir is simpler.  34:04 – Panel. 34:07 – Guest: You have commands and you have queries. The guest gives a hypothetical example! The guest also mentionshttps://elixir-lang.org/getting-started/mix-otp/genserver.html, too. 35:42 – Guest: There are two ways that you can interact with the process: command & queries. 37:00 – Guest talks about different libraries such as: https://github.com/mox-project/. 37:41 – Panel: Any tips on testing the servers; just any GenServer? 38:25 – Panelist shares his approach with this. 39:54 – Guest: I don’t test name servers b/c they are by definition global state. The guest goes into great detail about testing – check it out! 46:29 – Panel. 47:01 – https://github.com/devonestes I kind of hate the term dependency interjection in the functional context. 47:17 – Panel: I think it’s helpful, because... 47:28 – Guest. 47:49 – Panelists go back-and-forth! 48:20 – Panel: Sending a message to the testing process – this was something that was stated by Devon earlier. I find this really helpful. 49:00 – Chuck: Picks! 49:05 – https://www.lootcrate.com END – https://www.cachefly.com Links:
- https://www.ruby-lang.org/en/
- https://elixir-lang.org
- https://elixir-lang.org/getting-started/mix-otp/genserver.html
- https://elm-lang.org
- https://www.javascript.com
- https://code.visualstudio.com
- https://reactjs.org
- https://wallabyjs.com
- https://www.cypress.io
- https://github.com/topics/mutation-testing
- https://github.com/mox-project/
- https://devchat.tv/ruby-rogues/my-ruby-story-devon-c-estes/
- https://devchat.tv/ruby-rogues/rr-295-the-european-ruby-community-with-devon-c-estes/
- https://devchat.tv/ruby-rogues/rr-330-functions-vs-methods-devon-estes/
- https://devchat.tv/elixir-mix/emx-018-devon-estes-all-in-on-elixir/
- https://github.com/devonestes
- https://twitter.com/devoncestes?lang=en
Sponsors:
- https://www.lootcrate.com
- https://devchat.tv/get-a-coder-job/
- https://www.freshbooks.com
- https://www.cachefly.com
Picks: Mark
- https://brainlid.org/dev/2018/11/13/git-aliases.html
- Blog - Mox
Josh
- https://gitpitch.com
- Slide Deck by Josh
Charles
- Values
-

Become a supporter of this podcast: https://www.spreaker.com/podcast/elixir-mix--6102049/support.
...more
View all episodesView all episodes
Download on the App Store

Elixir MixBy Charles M Wood

  • 4.8
  • 4.8
  • 4.8
  • 4.8
  • 4.8

4.8

13 ratings


More shows like Elixir Mix

View all
The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

285 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

629 Listeners

Soft Skills Engineering by Jamison Dance and Dave Smith

Soft Skills Engineering

271 Listeners

Python Bytes by Michael Kennedy and Brian Okken

Python Bytes

212 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

987 Listeners

REWORK by 37signals

REWORK

212 Listeners

CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

CoRecursive: Coding Stories

185 Listeners

Elixir Wizards by SmartLogic LLC

Elixir Wizards

22 Listeners

The Stack Overflow Podcast by The Stack Overflow Podcast

The Stack Overflow Podcast

63 Listeners

Thinking Elixir Podcast by ThinkingElixir.com

Thinking Elixir Podcast

31 Listeners

Beam Radio by Lars Wikman

Beam Radio

11 Listeners

Software Unscripted by Richard Feldman

Software Unscripted

26 Listeners

Oxide and Friends by Oxide Computer Company

Oxide and Friends

47 Listeners

Elixir Mentor by Jacob Luetzow

Elixir Mentor

2 Listeners

The Pragmatic Engineer by Gergely Orosz

The Pragmatic Engineer

48 Listeners