Devchat.tv Episode Roundup
Devchat.tv Episode Roundup
Devchat.tv
RR 385: “Ruby/Rails Testing” with Jason Swett
1 hour 2 minutes Posted Oct 23, 2018 at 10:00 am.
– Sentry.IO – Advertisement!
– I am David Kimura and here is the panel! Tell us what is going on?
– Jason: I started my own podcast, and have been doing that for the past few months. That’s one thing. I started a new site with CodeWithJason.com.
– You released a course?
– Jason: Total flop and it doesn’t exist, but I am doing something else.
– I bet you learned a lot by creating the course?
– Jason: The endeavor of TEACHING it has helped me a lot.
– Tell us why we should drink the Koolaid?
– Jason: What IS testing? Good question. Whether is it is manual testing or automated testing. We might was well automate it.
– If we are testing our code what does that look like?
– Jason: Not sure what you mean, but I am doing tests at a fine grain vs. coarser grain.
– Show of hands who has...?
– What different tests are there?
– Jason: Good question. One term that one person uses is different to a different person. Let’s start with unit tests vs. integration tests.
– What tests are THE best?
– Jason: Good question. The kind of tests you are writing depends on what type of coverage you are going for.
– What anti-patterns are you seeing? What is your narrative in teaching people how to use them?
– Jason talks first about his background and his interaction with one of his colleagues.
– Question.
– Jason continues with his answers from 8:07.
– Jason: Feel free to chime-in. What have you done?
– I often ignore it until I feel bad and then I say: wait-a-minute I am a professional. Then I realize I ignored the problem because I was acting cowardly.
– For me it depends on the test that it is.
– Jason: The test is flapping because of something is wrong with the database or something else. Since you asked about anti-patterns let’s talk about that!
– Do you find that you back off of your unit testing when you are using integration?
– Jason: It depends on the context we are talking about.
– What is your view on using MOCKS or FAKES. What should we be doing there?
– Jason: Going to the Angular world I understand Mocks better than now. There was a parable that I think is applicable here about the young and the old fish.
– Jason continues talking about testing things in isolation.
– Question. 
– I have been looking for an area to specialize in and I wrote an eBook. (Check out here to see the articles and books that Jason has authored.)
– In your course you have how to choose a framework.
– Jason: There are 2 factors to consider.
– Panelist: I had a conversation with a beginner and we were talking about the different tests. He said the DSL really appealed to him. The surface area of the AI made it approachable for him.
– Jason: I wished I had figured out DSL out a little better. Understanding the concept of a block. The IT is just a function and you can put parentheses in different areas and...
– That makes sense. Let’s revisit the Tweet you wrote.
– Jason: There are certain use cases where it makes sense. Where Gmail was the thing out there. At some point the Internet formed the opinion that...
– Old saying: Nobody gets fired for using Microsoft and then it was IBM. Nothing wrong with those things if that’s what you are trying to do. Sometimes we make decisions to not be criticized. We try to grab big frameworks and big codes so we are not criticized for.
– Jason: I think developers have this idea that OLD is OUTDATED. Not so. I think it’s mature, not necessarily outdated. I think it’s a pervasive idea.
– I think it suffers a bit when all the mind shares get lumped into one thing.
– Jason: I don’t know if I like this analogy.
– I agree with that sentiment. It’s crazy that the complexity has become so pervasive.
– I think of SPAs as...
– Jason: Going back to the Tweet I wrote, I am pulling in JavaScript but I am preferring to sprinkle Java into Rails.
– Absolutely. I think that’s where we agree on. Late in 2017 we had the guest...
– Panelist chimes-in.
– Jason: That make sense. Use your preexisting...
– Have you found that Java sparkle approach is easy to test?
– Jason: I think it’s easier. Client server architecture...
– Advertisement: Get A Coder Job!
– Shout-out to the Rails team! What other testing frameworks are there? What if you are not the developer but you are the Quality Assurance (QA) person. They have been given the task of testing on the application.
– Jason: So someone who is not a developer and they want to test the application. I don’t want to get out of my role of expertise. I did talk to a QA engineer and I asked them: What do you do? All of his tests are manual. He does the same stuff as a Rails developer would do.
– Panelist talks about pseudo code.
– Jason: I am curious, Dave, about the non-programmer helping with tests what is the team structure?
– Dave: You will have one QA per three developers.
– Jason: If you have a QA person he is integrated within the team – that’s what has been the case for me.
– Dave: It’s a nice thing to have because we need to crank out some features and we have a good idea what is wrong with the app. We can go in there and see if our application is good, but they are combining different scenarios to do the unit tests and see what they are lacking. They are uncovering different problems that we hadn’t thought of.
– The organization has to have the right culture for that to work.
– If it’s a small team then it will help to see what everyone is doing – it’s that engagement level. If the team is too large then it could be a problem.
– Jason: Engagement between whom?
– Both.
– Jason: Yeah that’s a tough thing.
– It’s interesting to see the things that are being created. Testing seems to help that out. We are getting bugs in that area or se didn’t design it well there...
– Jason: Continuous deployment – let’s segue into this topic.
– Panelist: Do you have recommendations on how often we should be deploying in that system per day/week?
– Jason: We would deploy several times a day, which was great. The more the better because the more frequently you are deploying the fewer things will go wrong.
– More frequently the better and more people involved.
– Jason continues this conversation.
– Panelist: Continuous integration – any time you were say to forgo tests or being less rigid?
– Jason: I don’t test everything. I don’t write tests for things that have little risks.
– I think it is a good segue into how you write your code. If you write a code that is like spaghetti then it will be a mess. Making things easier to test.
– Jason: This is fresh in my mind because I am writing an app called Green Field.
– Uniqueness Validations, is mentioned by Jason.
– Anything else to add to testing a Rails application?
– Jason: Let’s talk about 2 things: walking skeleton and small stories.
– I am in favor of small stories, too. Makes you feel more productive, too.
– Work tends to lend itself to these types of stories and running a sprint.
– You don’t have to carry that burden when you go home. You might have too big of a chunk – it carries too much weight to it.
– Book the Phoenix Project. Work in progress is a bad thing. That makes sense. You want to have fewer balls in the air.
– Anything else?
– Jason: You can find me at: CodewithJason.com also Twitter! 
– Advertisement – Fresh Books!
– Cache Fly!
0:00
1:02:03
Download MP3
Show notes
Panel:
Dave Kimura
Eric Berry
Nathan Hopkins
David Richards
Special Guest: Jason Swett
In this episode of Ruby Rogues, the panel talks with Jason Swett who is a host of the podcast show, Ruby Testing! Jason also teaches Rails testing at CodeWithJason.com. He currently resides in the Michigan area and works for Ben Franklin Labs. Check-out today’s episode where the panelists and the guest discuss testing topics.
Show Topics:
0:00 – Sentry.IO – Advertisement!
Check out the code: DEVCHAT @ Sentry.io.
Jason dives into the similarities and differences between these 2 tests (see above).
There are different tests, such as: featured tests, acceptance tests, etc.
If I had a sign-up page for a user, I would...
One gem that I found is: RSpec RETRY.
Rails and Angular are mentioned.
Jason talks about featured testing, model-level testing, and more.
14:10 – Jason: Going to the Angular world I understand Mocks better than now. There was a parable that I think is applicable here about the young and the old fish.
16:39 – I have been looking for an area to specialize in and I wrote an eBook. (Check out here to see the articles and books that Jason has authored.)
Then I was looking around and I wanted to see what people’s issues are with Rails? They have a hard time with testing. I wanted to help them feel competent with it.
I know Ruby has several options on that front – how do you choose?
Jason tells us what those two factors are.
Jason: Angular, React and Vue.
23:48 – Jason: I think developers have this idea that OLD is OUTDATED. Not so. I think it’s mature, not necessarily outdated. I think it’s a pervasive idea.
The panelist continues...
26:18 – I think of SPAs as...
“Use JavaScript sprinkles.”
I am afraid of committing to a single framework. I don’t have anything against JavaScript but I am afraid of using only one thing when something else becomes fashionable.
30:10 – Advertisement: Get A Coder Job!
30:41 – Shout-out to the Rails team! What other testing frameworks are there? What if you are not the developer but you are the Quality Assurance (QA) person. They have been given the task of testing on the application.
31:30 – Jason: So someone who is not a developer and they want to test the application. I don’t want to get out of my role of expertise. I did talk to a QA engineer and I asked them: What do you do? All of his tests are manual. He does the same stuff as a Rails developer would do.
32:52 – Panelist talks about pseudo code.
Panelist goes into detail about different engagement levels throughout the team.
We see that we need some flexibility and getting that input and having a way to solve the problems.
44:48 – Jason: This is fresh in my mind because I am writing an app called Green Field.
This book is a great resource for automated testing.
Last point that I want to talk about is small stories: continues deployment and continuous delivery. If you make your stories smaller then you are making your stories crisply defined. Have some bullet points to make it really easy to answer the question. Answer the question: is this story done or not done? Someone should be able to run through the bullet points and answer that question.
52:45 – Advertisement – Fresh Books!
1:01:50 – Cache Fly!
Links:
Get a Coder Job Course
Erlang
Ruby
Ruby Motion
Ruby on Rails
Angular
Single Page Application (SPA)
RSpec – Retry
Ruby Testing Podcast
The Feynman Technique Model
Book: Growing Object-Oriented Software, Guided by Tests (1st edition)
Jason Swett’s Twitter
Jason Swett’s LinkedIn
Parable: Young Fish and Old Fish – What is Water?
Jason’s articles and eBook
Jason’s Website
Sponsors:
Sentry
Get a Coder Job Course
Fresh Books
Cache Fly
Picks:
David
This is Water
The Feynman Technique Model
Nate
Taking some time off
Pry Test
Eric
Fake App
Ruby Hack Conference
Dave
Brooks Shoes
Jason
The Food Lab
Growing Object-Oriented Software