spi software process infrastructure
play

SPI Software Process & Infrastructure QA http://spi.cern.ch/qa - PowerPoint PPT Presentation

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


  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 J.Benard 2

  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 Branch coverage analysis which breaks the code down which rather than focusing on a into basic blocs. Then by basic blocks, will look at construction, if a line is possible paths a conditional can executed a given number of take and how often each path times, every instruction line through the conditional is taken. within the basic block would Then knowledge of how many have been executed the same times each line of code was number of times. executed can be derived by knowing how many times each conditional was evaluated for each possible outcome. SPI - Software Process & Infrastructure J.Benard 3

  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 J.Benard 4

  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 Runtime Coverage time File.bb analysis File.c File.da File.gcov File.bbg SPI - Software Process & Infrastructure J.Benard 5

  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 J.Benard 6

  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 J.Benard 7

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

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

  10. SPI - Software Process & Infrastructure J.Benard 10

  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 J.Benard 11

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

Recommend


More recommend