018 RR What Not to Test




The Ruby Rogues show

Summary: Panel Charles Max Wood (twitter github Teach Me To Code) David Brady (blog twitter github ADDcasts) James Edward Gray (blog twitter github) Josh Susser (twitter github blog) Ryan Bates (twitter github RailsCasts) Discussed in this Episode When not to test: In a new startup trying to get funding It’s too hard to write the test It’ll take too long What is a test? Verifies code functionality Automated testing Manual tests Only run the tests you need to run. Guard Autotest Timecop Redis Testing myths: It’s too hard to test this. This is usually a design flaw. Forked processes are hard to test. Complicated User Interface stuff. It’s better/easier to fix it first. You can’t test code in Rake Tasks. Testing is hard or Writing code and tests is harder than writing code. Is this code for “Testing requires discipline?” Don’t test “One shot code.” - You’re only going to run it once, until you need to run it again. You don’t have to test migrations. TDD gives you a regression test suite and better design. Do you not test because of ROI: Routine tasks are diminished ROI in design. Duplicate code Low Risk code Testing Javascript from Rails: Jasmine Vows Jasmine Headless Webkit Zombie The clock is a global variable. Code coverage: Ryan likes to have 100% code confidence. Coverage means exercise, not correct functionality. Rails’ migration code didn’t get covered and then got crufty. Code that is difficult to test is difficult to refactor, reuse, extract, and modularize. It’s a “meta-code smell.” Picks Moleskine notebooks (David) A notebook (David) Pry (on Railscasts)(Josh) Showing appreciation for your friends (Josh) Ruby Weekly (James) RailsCasts (James) Harvest (Chuck) Netflix App (Chuck) Audible.com (Chuck) Go board game (Ryan) Foreman (Ryan)