473,657 Members | 2,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code coverage tool

ev
Hello,
We are looking for any testing tool that is capable of checking code
coverage for C,C ++ and Java code. Or at least for C and C++. We want
to know how much (percentage) of our code written on C/C++ is covered
in terms of function calls and line calls. We tried Rational
PureCoverage. It's excellent but has some limitations in our case.
Any idea would be greatly appreciated.
Feb 4 '08 #1
5 4275
On 4 Feb, 03:17, ev <evold...@gmail .comwrote:
Hello,
We are looking for any testing tool that is capable of checking code
coverage for C,C ++ and Java code. Or at least for C and C++. We want
to know how much (percentage) of our code written on C/C++ is covered
in terms of function calls and line calls. We tried Rational
PureCoverage. It's excellent but has some limitations in our case.
Any idea would be greatly appreciated.
I have tried the following:

Cantata++ (www.ipl.com/products)
DevPartner (http://www.compuware.com/products/de...enterprise.htm)

Both worked for me. If you specify, in some more detail, what the
limitations of your case is, I could perhaps provide some more detail
on how well they would work for you.
Feb 4 '08 #2
ev wrote:
Hello,
We are looking for any testing tool that is capable of checking code
coverage for C,C ++ and Java code. Or at least for C and C++. We want
to know how much (percentage) of our code written on C/C++ is covered
in terms of function calls and line calls. We tried Rational
PureCoverage. It's excellent but has some limitations in our case.
Any idea would be greatly appreciated.
Write the tests first, that way nothing gets written that isn't tested.

--
Ian Collins.
Feb 4 '08 #3
On 2008-02-04 06:55:35, Ian Collins wrote:
ev wrote:
>We are looking for any testing tool that is capable of checking code
coverage for C,C ++ and Java code. Or at least for C and C++. We want
to know how much (percentage) of our code written on C/C++ is covered
in terms of function calls and line calls. We tried Rational
PureCoverage . It's excellent but has some limitations in our case. Any
idea would be greatly appreciated.

Write the tests first, that way nothing gets written that isn't tested.
How do you know whether every branch/condition in a function gets executed
when you run the tests that you wrote (independently of whether you wrote
them before or after you wrote the function)?

Gerhard
Feb 4 '08 #4
REH
On Feb 6, 5:21 am, James Kanze <james.ka...@gm ail.comwrote:
100% full path coverage probably isn't always possible. But if
a tool reports path coverage, it should be as a per cent of path
coverage.
If you are only look for statement coverage (or even MCDC),
you tool is correct.

And what use is statement coverage? What does knowing that your
tests have exercised 95% of the statements in the code buy you?
Where I work any code that has never been executed is considered a
bomb, and unreachable code is not allowed. What use is it? I'm not
arguing its merits. My customer requires it in safety critical code,
so I do it.

REH
Feb 6 '08 #5
On Feb 6, 3:20 pm, REH <spamj...@stny. rr.comwrote:
On Feb 6, 5:21 am, James Kanze <james.ka...@gm ail.comwrote:
100% full path coverage probably isn't always possible. But if
a tool reports path coverage, it should be as a per cent of path
coverage.
If you are only look for statement coverage (or even MCDC),
you tool is correct.
And what use is statement coverage? What does knowing that your
tests have exercised 95% of the statements in the code buy you?
Where I work any code that has never been executed is considered a
bomb, and unreachable code is not allowed. What use is it? I'm not
arguing its merits. My customer requires it in safety critical code,
so I do it.
Any code which has never been executed is a bomb; I'm not
arguing about that. But code which has only been executed with
one set of pre-conditions, but is reachable with a different
set, is also a bomb. 100% statement coverage is a necessary
condition, but it is far from sufficient.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Feb 7 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2777
by: John J. Lee | last post by:
Anybody know of one? Actually, I have a feeling that emacs understands a standard format for errors, which would make it really easy to implement this by having the coverage tool print results in that format -- anybody know where to find the details? I also wonder if some kind of graphical display might be useful somehow, having been inspired by this:
6
2366
by: tjm | last post by:
Pure coverage from Rational is the only coverage tool I've been able to find for C#, and I don't really want to pay what Rational charges for something as simple as a coverage tool. So, I'd like to try to write my own, but I'm having trouble getting started. The way I see it, I need to do the following… 1) Create a debugger object or something similar that will allow me to step through my code. 2) Start a process to run through my...
4
2325
by: O. Zimmermann | last post by:
Hello, I am looking for a tool to process torough UNIT and COVERAGE testing over 60 and more functions of a "critical" embedded application written in C. I found IPL's Cantata++ but we don't seem to really need all the power of this software. I think some other tool out there could provide me with the basic testing I want with less expense. Ease of use (ie. time) is important.
1
1286
by: Vinay | last post by:
Hi Have any one idea of any popular code coverage tools for .Net application? Is there any such tool for Java also?? Thanks, -Vinu
5
4867
by: Nikhil | last post by:
Hi, I have a set of C source files and I need a tool which can add probes and then dynamically trace the execution and print the results (The C source code does not have any printf statements). The purpose of the tool is to add test cases for unit testing and then see the statement/branch coverage for them. Thanks,
1
2027
by: =?UTF-8?B?TWFydGluIFDDtnBwaW5n?= | last post by:
Hello, I am searching for a good profiling tool for C# which can be easily embedded into Visual Studio. My objective is to measure the times and counts of every method in my program. If used the Coverage Tool of TestDriven.Net (http://www.testdriven.net/) which worked fine if I have defined any Unit test-cases.
7
2811
by: Kai Zhu | last post by:
Can anybody show me a list of such tools so that I can pick up the tools match my requirement.
1
1221
by: Steven W. Orr | last post by:
Lots of code, calls to, calls by, inheritance, multiple tasks, etc. What do people use to figure out what's happening? TIA -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
24
2515
by: David | last post by:
Hi list. What strategies do you use to ensure correctness of new code? Specifically, if you've just written 100 new lines of Python code, then: 1) How do you test the new code? 2) How do you ensure that the code will work correctly in the future? Short version:
0
8425
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8845
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1736
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.