Identify control statements in source code
Joel Sherrill
joel.sherrill at oarcorp.com
Thu Aug 13 23:29:37 UTC 2015
On August 13, 2015 5:38:24 PM CDT, Daniel Gutson <daniel.gutson at tallertechnologies.com> wrote:
>
>El 13/8/2015 19:35, "Joel Sherrill" <joel.sherrill at oarcorp.com>
>escribió:
>>
>>
>>
>> On August 13, 2015 3:34:12 PM CDT, Daniel Gutson
><daniel.gutson at tallertechnologies.com> wrote:
>> >I'd recommend a gcc plugin that generates your annotations;
>otherwise,
>> >dig into gcov in order to parse a .gcno file.
>>
>> Covoar already produces gcov files. A previous gsoc student did that.
>This was a bonus task and we were never 100% confident in the gcov
>files produced.
>
>He needs a static analysis tool. Is covoar the case?
Covoar takes the execution trace/logs from something like a simulator and determines what the source and assembly coverage of the test run is.
But you can get instruction and statement coverage from covoar. Without more information about the conditional expressions, you can't do decision or modified decision coverage. At least I don't have proof you can.
I am pretty sure (without proof) that when we have 100% assembly statement and branch statement path coverage, we have met the goal but modified decision coverage says we can get by with less test cases than this.
So this is coverage
>>
>> I would recommend pulling this thread. Produce the normal gcc
>coverage files, use covoar to produce gcov files, and then run gcov on
>the results. Compare to what covoar reports and address discrepancies.
>>
>> >On Thu, Aug 13, 2015 at 5:09 PM, Hermann Felbinger
>> ><hermann19829 at gmail.com> wrote:
>> >> I am looking for something that processes the source code at
>compile
>> >time. I
>> >> need this information to map branches from execution traces to
>> >conditions
>> >> within the source code. With this information it will be possible
>to
>> >analyze
>> >> source coverage metrics as decision coverage or MCDC.
>> >>
>> >>
>> >> Daniel Gutson <daniel.gutson at tallertechnologies.com> schrieb am
>Do.,
>> >13.
>> >> Aug. 2015 um 21:50 Uhr:
>> >>>
>> >>> 1) Are you looking for something statically processed (i.e. at
>> >compile
>> >>> time) or at runtime? (such as gcov)
>> >>> 2) Are you looking for a way to add _your_ annotations, or a way
>to
>> >>> _extract_ information?
>> >>>
>> >>> In any case, the best way I can think of is with a gcc plugin.
>> >>>
>> >>> Have you seen gcc's -ftest-coverage option?
>> >>>
>> >>> Daniel.
>> >>>
>> >>> On Thu, Aug 13, 2015 at 4:06 PM, Hermann Felbinger
>> >>> <hermann19829 at gmail.com> wrote:
>> >>> > Hi all!
>> >>> >
>> >>> > I am working on a tool to analyze source code coverage for
>RTEMS.
>> >>> > Currently I am looking for a tool to annotate source code such
>> >that I
>> >>> > can
>> >>> > extract information about statements and conditions that affect
>> >the
>> >>> > control
>> >>> > flow of a program.
>> >>> > A similar tool exists for Ada programs. They call this
>information
>> >>> > 'Source
>> >>> > Coverage Obligations'. Some information about SCOs can be found
>in
>> >[1].
>> >>> > I attached a program triangle.c which contains some
>if-statements.
>> >Each
>> >>> > of
>> >>> > these statements contains two or more conditions. The second
>> >attached
>> >>> > file
>> >>> > is the output of compiling triangle.c with
>> >>> > gcc -O1 -fdump-tree-cfg -o triangle triangle.c
>> >>> > This output is almost what I am looking for, but I think that
>> >there has
>> >>> > to
>> >>> > be something better out there.
>> >>> >
>> >>> > Does anybody of you know a tool which I can use to annotate
>source
>> >code?
>> >>> >
>> >>> > Best,
>> >>> > Hermann
>> >>> >
>> >>> > [1]
>http://docs.adacore.com/gnatcoverage-docs/html/cov_source.html
>> >>> >
>> >>> > _______________________________________________
>> >>> > devel mailing list
>> >>> > devel at rtems.org
>> >>> > http://lists.rtems.org/mailman/listinfo/devel
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>>
>> >>> Daniel F. Gutson
>> >>> Chief Engineering Officer, SPD
>> >>>
>> >>> San Lorenzo 47, 3rd Floor, Office 5
>> >>> Córdoba, Argentina
>> >>>
>> >>> Phone: +54 351 4217888 / +54 351 4218211
>> >>> Skype: dgutson
>> >>> LinkedIn: http://ar.linkedin.com/in/danielgutson
>> >
>> >
>> >
>> >--
>> >
>> >Daniel F. Gutson
>> >Chief Engineering Officer, SPD
>> >
>> >San Lorenzo 47, 3rd Floor, Office 5
>> >Córdoba, Argentina
>> >
>> >Phone: +54 351 4217888 / +54 351 4218211
>> >Skype: dgutson
>> >LinkedIn: http://ar.linkedin.com/in/danielgutson
>> >_______________________________________________
>> >devel mailing list
>> >devel at rtems.org
>> >http://lists.rtems.org/mailman/listinfo/devel
>>
>> --joel
--joel
More information about the devel
mailing list