Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do code coverage tools work in different languages?
    text
    copied!<p>Most established languages have solid test coverage tools available for them, but the depth of functionality differs significantly from one to another.</p> <p>Also, all the various VMs and compilers have such heterogeneous structure that writing a code coverage tool must be a very different job in C than in Lisp, for example.</p> <ul> <li>Python has <code>sys.settrace</code> to tell you directly which lines are executing</li> <li><a href="http://www.atlassian.com/software/clover/" rel="noreferrer">Clover</a> (for Java) uses its own compiler and adds debug metadata (last time I used it, anyway)</li> <li><a href="http://emma.sourceforge.net/" rel="noreferrer">Emma</a> (for Java) has a ClassLoader which re-writes bytecode on the fly</li> <li><a href="http://www-2.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/testing/cover/0.html" rel="noreferrer">COVER</a> (for Lisp) has an annotation pass to instrument the code</li> </ul> <p>I'm interested in the implementation of code coverage for different languages:</p> <ol> <li><p>What are the main approaches to get to <a href="http://eigenclass.org/hiki.rb?rcov#l15" rel="noreferrer">C0</a> coverage, where you can track which lines of code have been executed? I mention native VM introspection and static and dynamic code instrumentation above - are there other methods?</p></li> <li><p>Getting to more enlightened coverage data, like <a href="http://eigenclass.org/hiki.rb?rcov#l15" rel="noreferrer">C1 or C2</a>, seems like a language agnostic task compared with C0. Is smacks of big <a href="http://en.wikipedia.org/wiki/Karnaugh_map" rel="noreferrer">Karnaugh map</a> manipulation to me; are there best practices on how to actually do it? Do more modern logic techniques like <a href="http://en.wikipedia.org/wiki/Fuzzy_logic" rel="noreferrer">fuzziness</a> play a role?</p></li> <li><p>A much overlooked aspect of test coverage is displaying the results back to the programmer, which gets increasingly hard with C1 and C2 data. Frankly, although they get the job done for C0, I'm underwhelmed by most test coverage interfaces; what novel and intuitive interfaces have you seen for coverage data?</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload