1 / 12

SPI Software Process & Infrastructure

SPI Software Process & Infrastructure. QA http://spi.cern.ch/qa Gcov presentation - 03 June 2005 Johanne BENARD johanne.benard@cern.ch. GCOV presentation. What is Gcov ? Code Analysis principle Coverage tool Other utilities Application on ROOT Compilation Test running Result.

nealmary
Download Presentation

SPI Software Process & Infrastructure

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SPI Software Process & Infrastructure QA http://spi.cern.ch/qa Gcov presentation - 03 June 2005 Johanne BENARD johanne.benard@cern.ch

  2. GCOV presentation What is Gcov ? • Code Analysis principle • Coverage tool • Other utilities Application on ROOT • Compilation • Test running • Result SPI - Software Process & Infrastructure

  3. Code analysis principle • Aim at showing what percentage of an application has been executed by the test process. • Two different principles in gcov: Statement coverage analysis which breaks the code down into basic blocs. Then by construction, if a line is executed a given number of times, every instruction line within the basic block would have been executed the same number of times. Branch coverage analysis which rather than focusing on a basic blocks, will look at possible paths a conditional can take and how often each path through the conditional is taken. Then knowledge of how many times each line of code was executed can be derived by knowing how many times each conditional was evaluated for each possible outcome. SPI - Software Process & Infrastructure

  4. Coverage tool • Code instrumentation during compilation: • GCC must be used to compile the program with the flags -fprofile-arcs -ftest-coverage • GCC generates two output files for each Sourcefile.c compiled: • Sourcefile.bb: list of source files and functions within those files and line numbers corresponding to basic blocks in the source file ) • Sourcefile.bbg: list of the program flow arcs for each function • Data collection during code execution: • Counter vector entries are incremented every time an instrumented basic block is entered SPI - Software Process & Infrastructure

  5. Coverage tool • Data extraction at program exit time: • Creates a file sourcefile.da and populates the file with the size of the vector and the counters of the vector itself • Coverage analysis and presentation: • GCOV utility integrates and relates the information of the "*.bbg", "*.bb" and the "*.da" to produce the "*.gcov" files containing per line coverage output Compilation time Runtime Coverage analysis File.bb File.c File.da File.gcov File.bbg SPI - Software Process & Infrastructure

  6. Other utilities • Genhtml: • Creates an HTML view from coverage data found in INFOFILE • Geninfo: • Converts .da files into .info files • Genpgn: • Creates an overview image for a given source code file of either plain text or .gcov file format • Gendesc: • Converts a test case description file into a format as understood by genhtml INPUTFILE SPI - Software Process & Infrastructure

  7. Application to ROOT • Compilation: • Edition of MyConfig.mk in $ROOTSYS • Link the shared libraries with libgcc.a • Test running: • In $ROOTSYS/test • In roottest • Results: SPI - Software Process & Infrastructure

  8. ROOT test coverage report SPI - Software Process & Infrastructure

  9. ROOT test coverage report SPI - Software Process & Infrastructure

  10. SPI - Software Process & Infrastructure

  11. More information • Please visit our web site: http://spi.cern.ch/qa/gcov • Proposed next actions: • Publication of test coverage for ROOT • at a given frequency? • Addressed to a QA person? • Run it on CVS tagged or HEAD source • Add a section on SPI/QA web site dedicated to test coverage for ROOT • Produce automatically a list of files that have less than 80% test coverage SPI - Software Process & Infrastructure

  12. Conclusion Thank you for your attention! Question? SPI - Software Process & Infrastructure

More Related