The Artima Developer Community
Sponsored Link

Agile Buzz Forum
SUnitToo Code Coverage Refactoring Browser

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
SUnitToo Code Coverage Refactoring Browser Posted: Jan 19, 2007 1:46 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: SUnitToo Code Coverage Refactoring Browser
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

I posted a sneak piccie of this a few days ago. I've just published it to public store. There are a couple of coverage tools around so I'm going to take a moment to explain why this one is different from the others.

The most well known coverage tool is called Zork-Analysis. It was built with categories in mind - you can add/remove wrappers en-masse via categories. It was also built when there were no wacky syntax extensions in VW - such as pragmas and other interesting things. As a result, this package sometimes works and sometimes doesn't. One of the nice things about this package was that it would gather up type information as it collected coverage information. It also knew which branches of your program had executed or not.

This was a big step up from the coverage tool I used to use in VisualAge Smalltalk, which only told you what had been run - and nothing more. So neither of these are state of the art any more. Kritic, really, is the state of the art code coverage tool for VisualWorks. Unfortunately, it is not finished nor released yet - but keep an eye out for when it does. It uses debugging probes to monitor what's going on. Like Zork, it knows which branches of code you've actually executed. It also has a UI that is designed around the idea of 'marking' code to be monitored.

So when I started the SUnitToo(verage) I wanted to break out of the mold of "mark code, run code". Instead, my coverage tool works virally. It starts with a unit test that you're running and wraps up any method that you're going to call (unless said method is a bad method to wrap up).

This avoids the classic UI pattern of "wrap up some code - do something - unwrap up the code". It also has the potential to capture type information - but I decided against doing that for now, since it was noise to what I was trying to achieve. The UI is also integrated in to SUnitToo(ls) such that you click "coverage on" before running your tests. The results will appear inline in the Refactoring Browser as red text giving you a percentage of coverage against classes and methods.

Methods themselves know what percentage of their execution pathways were executed. This is highly useful. Simple methods such as getters, setters, subclassResponsibility callers etc don't actually get counted in the coverage either. We're aiming for behavior here, not 100% coverage of everything even the smallest and most obvious of things.

To give this a go, load SUnitToo 39 and SUnitToo(ls) 34 + coverage. There's a button in the toolbar that looks like an eraser that 'resets' the coverage statistics whenever you want. Simply find some SUnitToo tests, click "coverage" on and run the tests.

Enjoy.

Read: SUnitToo Code Coverage Refactoring Browser

Topic: Smalltalk Daily 1/16/07: A Simple Seaside App Previous Topic   Next Topic Topic: Cleaning up the Code

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use