First impressions of Ruby branch coverage with DeepCover

Branch coverage for Ruby is finally on the horizon! The built-in coverage library is expected to ship in Ruby 2.5 with branch and method coverage options.

And a pure-Ruby gem is in development, too: DeepCover.

I gave DeepCover a try with my main project, the Wiki Education Dashboard, and the coverage of the Ruby portions of the app dropped from 100% to 96.75%. Most of that is just one-line guard clauses like this:

[ruby]return unless Features.wiki_ed?[/ruby]

But there are a few really useful things that DeepCover revealed. First off, unused scopes on Rails ActiveRecord models:

[ruby]
class Revision < ActiveRecord::Base
scope :after_date, ->(date) { where(‘date > ?’, date) }
end
[/ruby]

Unlike default line coverage, DeepCover showed that this lambda wasn’t ever actually used. It was dead code that I removed today.

Similarly, DeepCover shows where default arguments in a method definition are never used, like this:
[ruby]
class Article < ActiveRecord::Base
def update(data={}, save=true)
self.attributes = data
self.save if save
end
end
[/ruby]

This method was overriding the ActiveRecord update method, adding an option to update without saving. But we no longer use that second argument anywhere in the codebase, meaning I could delete the whole method and rely on the standard version of update.

168 thoughts on “First impressions of Ruby branch coverage with DeepCover”

  1. DeepCover co-author here. Thanks for the great examples. The unused scope is probably fairly typical. You mention unused default arguments (which DeepCover can detect), but in the update case, I imagine that the default argument was always used (which we should detect) and that it’s actually DeepCover’s branch coverage that alerted you to the face that `if save` was always true, right?

    1. I think it’s that the default argument was always used, but it was detecting that nothing *except* the default argument was used. I’m not completely sure, though.

      The `def` line is the one that was marked as uncovered. (I did this via simplecov, so I didn’t get the visualization of the uncovered parts within the line.)

    1. Lobo EP, Delic NC, Richardson A, Raviraj V, Halliday GM, Di Girolamo N, Myerscough MR, Lyons JG cialis no prescription Conclusions Patients with claudication are at high risk for adverse limb events and cardiovascular events after undergoing revascularization, with a rate of 18 at 3 years, driven by acute limb ischemia

  2. Thank you, I’ve recently been searching for information about this subject for a while and yours is the best I have discovered till now. However, what concerning the bottom line? Are you certain concerning the supply?

  3. Мы рекомендуем ознакомиться с отзывами о “Спивакъ Масло для бровей и ресниц “Аргана”, 12 мл (Спивакъ, Масла)” перед тем как сделать заказ. После постарайтесь написать комментарий к товару. Нам важно знать ваше мнение. Возврат/обмен возможен в течение 14 дней после совершения покупки в том случае, если товар не был в употреблении, сохранены его потребительские свойства, товарный вид, оригинальная фабричная упаковка, ярлыки.
    https://www.thenaturalnouveau.com/forum/profile/stevefernandez8/
    Добиться того, чтобы ваши ресницы были красивыми и пышными, не так сложно. Достаточно всего нескольких минут ухода в день для того, чтобы забыть о ломкости и выпадении. Уверена, любой из вас это по силам. Уже второй раз беру масло для ресниц Эльфарма – очень удобно, что оно уже с кисточкой, и не надо от старой туши все время брать. И само масло хорошее! Можете попробовать каждое из этих масел, но лучше всего сначала поэкспериментировать только с одним. Масло усьмы имеет удобную щеточку для нанесения, продукт GLOSSY GOLD Nikk Mole oil – специальный дозатор – средства легко и быстро наносить (рекомендуется каждый вечер перед сном). Остальными маслами можно пользоваться так:

  4. Die besten, ausstГ¤ndigen Zahlen Wir wissen, dass es durchaus eine Strategie vieler Lottospieler ist, auf die Gewinnzahlen von zuvor erfolgreichen Kombinationen zu setzen. In diesem Sinne sind die ersten gezogenen Lotto 6aus49 Gewinnzahlen 13, 41, 3, 23, 12, 16 vom 09. Oktober 1955 immer noch sehr beliebt. Haftungsausschluss: Der Betrieb dieser Seite und deren Inhalte werden nicht von Camelot UK Lotteries Limited, der National Lottery Commission oder SLE anerkannt und befürwortet. EuroMillions Zahlen – Ziehung 1543 Am Anfang der seine Karriere er hat die Texte für Fernsehshow “Your Show of Shows” geschrieben. Woody Allen hat auch solche Texte für berühmte Stars wie zum Beispiel Ed Sullivan, Sid Caesar oder Art Carney geschrieben. Im Jahr 1961 er hat selber als Komiker aufgetreten und wurde schnell sehr Populär. Sein Debut im Kino passierte im Jahr 1965. Seines Debüt nach Maß als ein Schauspieler und Regisseur war mit einem Film “What’s Up, Tiger Lily?“ (Wie läuft’s, Tiger Lily). Ein Jahr später hat er seiner Debüt auf Broadway mit dem Spiel “Don’t drink the water” (Trink keines Wasser).
    https://charliebbyw520758.tinyblogging.com/online-geldspielautomat-57892024
    Die ersten 3 Monate um nur 0,99 Euro pro Monat. Die Seite bietet eine beeindruckende Vielfalt an Spielen, von Slots bis hin zu einem Live-Casino. Um die Dinge auf dem neuesten Stand zu halten, hat das Magic Red Casino auch dafГјr gesorgt, dass seine Website Гјber jedes mobile GerГ¤t in einem Sofortspielformat zugГ¤nglich ist, so dass Sie, egal wo Sie sind, in der Lage sein werden, online zu gehen und eines Ihrer Lieblingsspiele zu spielen. Monster Casino Promo Code – Die top spielautomaten anbieter 2019 Der Merkur-Klassiker aus der Spielothek macht online noch viel mehr Spaß. DAS JUBILГ„UMSPROGRAMM:   Ab 18:00 Uhr: Feierlicher Sektempfang am Casino Vorplatz mit Walking Acts  oder logge Dich ein mit: Kostenlose Freispiele oder Bonusgelder geben Ihnen einige Extra-Drehs und zusГ¤tzlichen SpielspaГџ. Achten Sie aber auf die Bonusbedingungen: besonders darauf, ob Sie den gewГјnschten Slot spielen dГјrfen und welchen Umsatz Sie erfГјllen mГјssen.

  5. Normally, however. You can use a plated-through hole to mount it, the player loses a particular battle. Most of these are offered for new players, this usually means that he or she has hit a normal koatari and the machine will then enter into jitan mode. At 188clubs Singapore our approach has always been to put the customer front and centre, medical transcription is a growing industry. You can tell a lot about how the software before you even start to play blackjack just by seeing the name of the company developer. The best software developers know how to make classic blackjack look and feel entertaining. So much so that blackjack online becomes even more exciting than being dealt two cards at a real blackjack table. Here are the best software developers thanks to which you can play blackjack online:
    https://koniecczasow.pl/community/profile/malorie72b96895/
    Earn Casino Cash rewards while you play! Use your card when you play slots or table games to earn points. You can qualify for a monthly Casino Cash offer in either slots or table games. Play & Earn More Gold – You can start earning your rewards and benefits today! It’s easy! Our reviewers report positive experiences with Gold Club Casino customer services. Gold Club members will be automatically archived after 13 months of inactivity. Visit the Gold Club desk and one of our guest representatives will be happy to help you reactivate your card. (306) 825-3777 Highlights: Gold Club Hotel & Casino offers the following activities/services (charges may apply): Bicycle rental (additional charge)CasinoBicycle rental All Player’s Club Members have access to:

  6. Thank you, I’ve recently been looking for information about this subject for ages and yours is the best I have discovered till now. But, what about the bottom line? Are you sure about the source?

  7. I do not even know the way I ended up right here, however I assumed this post used to be good. I don’t recognise who you are however definitely you are going to a well-known blogger in the event you are not already 😉 Cheers!

  8. Attractive element of content. I just stumbled upon your weblog and in accession capital to assert that I acquire actually enjoyed account your weblog posts. Anyway I’ll be subscribing in your augment and even I achievement you get right of entry to consistently fast.

  9. I have been surfing on-line more than three hours nowadays, yet I by no means discovered any attention-grabbing article like yours. It’s pretty value enough for me. Personally, if all webmasters and bloggers made just right content as you probably did, the net shall be much more useful than ever before. “Baseball is 90 percent mental. The other half is physical.” by Lawrence Peter Berra.

  10. “I like working with small to medium size brushes because you are able to get a more precise application,” says Tricome. “I find when you are using larger brushes you can’t reach the smaller areas of the face as well and you end up getting foundation in your hairline or brows, or have to go back in with more product for those areas that didn’t cover as well. The smaller size brush also allows you to focus product on areas that need it, which also results in a more natural and flawless skin look.” But, what does the best foundation brush look like? Well, this varies depending on your skin type, aesthetic and budget. That’s why we couldn’t just decide on one foundation brush, but why we’ve collated a whole list of them! Pairs well with bareMinerals Loose Powder Matte Foundation SPF 15.
    https://shanelefq022369.blogstival.com/37656148/rimmel-exaggerate-eyeliner-waterproof
    This mascara is paraben- and fragrance-free, as well as dermatologist- and allergy-tested, making it suitable for even the most sensitive eyes. It instantly lengthens and thickens from root to tip for smudge-free definition. “If you have sensitive eyes, this mascara is for you,” writes one happy reviewer. “I am allergic to most mascaras and I am able to wear this mascara all day and even into the evening with no problems at all.” Be the first to know what’s trending, straight from Elite Daily Why we love it: This mascara offers separate lengthening and volumising formulas and wands tripling the options in your eyelash wardrobe. You can wear one, or the other, or combine the two, depending on what look you want to create that day. “The comb applicator that comes with this mascara makes it virtually impossible to get clumps. Also, it layers and layers so you can build full volume, and it’s the only mascara I’ve ever used that keeps my curl throughout the day — I especially love the waterproof version!” — makeup artist Sharon L. Gjieli

  11. Woah! I’m really enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between user friendliness and visual appearance. I must say that you’ve done a amazing job with this. In addition, the blog loads extremely fast for me on Safari. Outstanding Blog!

  12. Hiya, I am really glad I’ve found this information. Nowadays bloggers publish only about gossips and web and this is actually annoying. A good web site with interesting content, that is what I need. Thank you for keeping this website, I will be visiting it. Do you do newsletters? Can not find it.

  13. What i don’t realize is in fact how you’re now not actually a lot more neatly-preferred than you may be right now. You’re so intelligent. You recognize therefore significantly with regards to this subject, made me in my view imagine it from so many varied angles. Its like men and women don’t seem to be involved until it¦s one thing to do with Girl gaga! Your personal stuffs nice. Always care for it up!

  14. Good ?V I should definitely pronounce, impressed with your web site. I had no trouble navigating through all the tabs and related info ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Reasonably unusual. Is likely to appreciate it for those who add forums or anything, site theme . a tones way for your client to communicate. Excellent task..

  15. Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.

  16. Appreciating the time and energy you put into your website and detailed information you offer. It’s awesome to come across a blog every once in a while that isn’t the same unwanted rehashed information. Great read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.

  17. Hey, I think your site might be having browser compatibility issues. When I look at your blog site in Opera, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!

  18. An interesting discussion is worth comment. I think that you should write more on this topic, it might not be a taboo subject but generally people are not enough to speak on such topics. To the next. Cheers

  19. After examine a number of of the weblog posts in your website now, and I actually like your way of blogging. I bookmarked it to my bookmark website checklist and will be checking back soon. Pls try my site as nicely and let me know what you think.

  20. I have read your article carefully and I agree with you very much. This has provided a great help for my thesis writing, and I will seriously improve it. However, I don’t know much about a certain place. Can you help me?

  21. Do not use consecutive free bonuses, or if your last transaction was with a no deposit bonus or free spins. All you have to do is make a deposit before claim this bonus code, otherwise your winnings will be considered invalid and you will not be able to cash out your money. Claim your Royal Ace Casino no deposit bonus now! Players who want to get the most out of their time and money will want to check out the VIP Program at Royal Ace Casino. The program currently has 5 Levels that start with Jack (Level 1) and end with Royal Ace (Level 5). In order for you to increase your VIP level, you can simply earn Comp Points. Comp Points are earned the instant you start wagering on games with real money and it will grow from there. As the VIP level gradually increases, the wagering requirement for Comp Points decreases giving you more for less. Aside from these, VIP players get access to plenty of exclusive bonuses and promotions in addition to monthly casino bonus insurance and specialized gifts whenever a new level is reached.
    https://wiki-triod.win/index.php?title=Bitcoin_casino_uk_jackpots
    He is no slouch in poker tournaments either – he has won over $1 million in live poker tournaments including a fourth-place finish in the 2019 World Series of Poker Monster Stack event, cashing him $344,079 for his initial $1,500 buy-in. Bart Hanson has been coaching poker for almost as long as he has played professionally, always possessing a analytical mind to No-Limit Hold’em. He has commentated on poker since 2005, first starting at Live at the Bike! And then moving onto his current role at Hustler Casino LIVE. Hanson is such a relied and trusted cash game poker coach that he has even flown out to Macau to help coach business men who have played in the nosebleed cash games that are famously held there.  “I’m super stoked that Steffen @RunGo0seRun Sontheimer will join @_pokercode as Head Coach for Cashgame. He’s the player I probably learned from the most in my career, so I’m very excited to have him on our team. The price stays the same, but the value just doubled,” Holz tweeted Tuesday.

  22. Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across. It extremely helps make reading your blog significantly easier.

  23. Hiya, I am really glad I’ve found this info. Nowadays bloggers publish only about gossips and web and this is actually irritating. A good blog with interesting content, that is what I need. Thank you for keeping this site, I will be visiting it. Do you do newsletters? Can’t find it.

  24. I’m truly enjoying the design and layout of your site. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Excellent work!

  25. Valuable info. Lucky me I found your web site by accident, and I am shocked why this accident did not happened earlier! I bookmarked it.

  26. In this great pattern of things you’ll get a B- with regard to effort and hard work. Where exactly you actually confused everybody ended up being in all the details. You know, it is said, details make or break the argument.. And it couldn’t be more correct here. Having said that, permit me reveal to you what did do the job. The text is incredibly powerful and that is probably the reason why I am taking the effort in order to comment. I do not make it a regular habit of doing that. 2nd, while I can notice a jumps in reason you make, I am definitely not sure of how you seem to connect your details which produce the final result. For now I will subscribe to your position however hope in the foreseeable future you connect your dots better.

  27. Howdy very cool site!! Man .. Beautiful .. Amazing .. I will bookmark your web site and take the feeds also…I’m glad to seek out numerous useful information here in the submit, we want work out more techniques on this regard, thanks for sharing.

  28. With havin so much written content do you ever run into any problems of plagorism or copyright infringement? My site has a lot of exclusive content I’ve either created myself or outsourced but it looks like a lot of it is popping it up all over the web without my permission. Do you know any solutions to help reduce content from being ripped off? I’d genuinely appreciate it.

  29. I have been surfing online more than three hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. Personally, if all site owners and bloggers made good content as you did, the net will be much more useful than ever before.

  30. We are a group of volunteers and starting a new scheme in our community. Your site offered us with valuable information to work on. You have done a formidable job and our whole community will be grateful to you.

  31. Thank you for sharing excellent informations. Your web site is very cool. I am impressed by the details that you have on this web site. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, my friend, ROCK! I found just the information I already searched everywhere and simply could not come across. What a perfect web site.

  32. I?¦ve been exploring for a little for any high quality articles or blog posts on this sort of area . Exploring in Yahoo I ultimately stumbled upon this site. Reading this information So i am glad to convey that I’ve a very just right uncanny feeling I discovered just what I needed. I so much indisputably will make sure to do not put out of your mind this website and give it a look regularly.

  33. It?¦s really a great and helpful piece of info. I am glad that you simply shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

  34. Having read this I thought it was very informative. I appreciate you taking the time and effort to put this article together. I once again find myself spending way to much time both reading and commenting. But so what, it was still worth it!

  35. You could certainly see your skills in the work you write. The world hopes for even more passionate writers like you who aren’t afraid to say how they believe. Always go after your heart.

  36. Pretty section of content. I just stumbled upon your site and in accession capital to assert that I get actually enjoyed account your blog posts. Any way I will be subscribing to your augment and even I achievement you access consistently quickly.

  37. I like what you guys are up also. Such clever work and reporting! Keep up the excellent works guys I have incorporated you guys to my blogroll. I think it will improve the value of my web site :).

  38. It?¦s actually a nice and useful piece of information. I?¦m glad that you shared this useful information with us. Please keep us up to date like this. Thank you for sharing.

  39. Thanks for some other great post. Where else may just anyone get that type of info in such an ideal manner of writing? I’ve a presentation next week, and I’m on the search for such information.

  40. Hi, Neat post. There’s a problem with your web site in web explorer, would test this?K IE still is the marketplace chief and a large section of people will leave out your excellent writing due to this problem.

  41. Hi, i think that i noticed you visited my blog so i got here to “return the favor”.I am attempting to find things to improve my site!I guess its adequate to make use of some of your ideas!!

  42. Hi, Neat post. There’s an issue with your web site in internet explorer, may check this?K IE nonetheless is the marketplace chief and a good component to folks will pass over your wonderful writing due to this problem.

  43. You can definitely see your expertise within the paintings you write. The world hopes for more passionate writers like you who aren’t afraid to mention how they believe. All the time go after your heart. “There are only two industries that refer to their customers as users.” by Edward Tufte.

  44. I have been exploring for a little for any high quality articles or blog posts in this kind of area . Exploring in Yahoo I eventually stumbled upon this site. Studying this information So i?¦m happy to express that I have a very good uncanny feeling I came upon just what I needed. I such a lot for sure will make certain to don?¦t fail to remember this website and give it a look regularly.

  45. I like what you guys are up also. Such intelligent work and reporting! Carry on the excellent works guys I’ve incorporated you guys to my blogroll. I think it will improve the value of my web site :).

Leave a Reply

Your email address will not be published. Required fields are marked *