Home > debugging, lint, profiling, security, testing > Tools for C development

Tools for C development

This post collects free and open source software tools that are useful when you do software development in C. For a survey of software development tools for scientific computation, see A Survey of C and C++ Software Tools for Computational Science by D.J. Worth, C. Greenough and L.S. Chin. See The Art, Science, and Engineering of Software Development by Steve McConnell for some best practices.

Lint tools

  • Cppcheck: A tool for static C/C++ code analysis.
  • Splint: Annotation-assisted lightweight static checking.

Documentation generators

  • Natural Docs: documentation generator for multiple programming languages.
  • ROBODoc
  • Sphinx: A tool that makes it easy to create intelligent and beautiful documentation.

Testing tools

See A Survey of Software Testing Tools for Computational Science by L.S. Chin, D.J. Worth and C. Greenough.

  • CUnit: Unit testing framework for C.
  • gcov: A test coverage program. See ggcov for a GUI replacement of gcov.

Profiling & debugging tools

  • DDD: Graphical front-end for command-line debuggers such as GDB, etc.
  • GDB: The GNU Project debugger.
  • google-perftools: Fast, multi-threaded malloc() and nifty performance analysis tools.
  • gprof: The GNU profiler. For a tutorial on this tool, see Profiling Tutorial: A simple program by DJ Worth, LS Chin, and C Greenough.
  • OProfile: Profiler for Linux systems, capable of profiling all running code at low overhead.
  • RATS: Rough Auditing Tool for Security.
  • Solaris Studio: Formerly Sun Studio, but is now called Oracle Solaris Studio.
  • Valgrind: Instrumentation framework for building dynamic analysis tools.
About these ads
  1. Fidel
    24 October 2010 at 4:13 am | #1

    Hello Minh,

    Very nice post. I have a question about testing tools. Which testing tool would you recommend as the easiest one to use?

    I have been working on a small C++ project and I am using gtest
    [http://code.google.com/p/googletest/]

    Regarding documentation, what do you think about doxygen?

    Best Regards,
    Fidel

  2. mvngu
    25 October 2010 at 8:09 am | #2

    > Which testing tool would you recommend as the easiest one to use?
    > I have been working on a small C++ project and I am using gtest
    > [http://code.google.com/p/googletest/]

    That’s difficult to say. Different tools pick up different things, even though they may overlap in a number of things they pick up. I don’t like to exclusively use gtest. For C++, I would consider using gtest together with CppUnit (http://sourceforge.net/apps/mediawiki/cppunit/), gcov and gprof (http://gcc.gnu.org/onlinedocs/gcc/Gcov-Intro.html). But if you’re comfortable with gtest, that’s OK. Just be aware of other ways to test your C++ program, e.g. use a profiler like Valgrind or a debugger like GDB.

    > Regarding documentation, what do you think about doxygen?

    I don’t mind using doxygen as long as it supports LaTeX typesetting of (complicated) math expressions. I like to use math expressions in my documentation typeset in the manner of LaTeX. Currently, the closest thing to my ideal documentation tool is Sphinx. It was originally developed for Python documentation, but it now also supports extraction and generation of documentation for other languages as well, e.g. C, C++, JavaScript. See this URL for more information:

    http://sphinx.pocoo.org/domains.html

  3. Fidel
    28 October 2010 at 2:25 am | #3

    Thanks for the reply Minh. I am looking forward to try CppUnit to test and Sphinx to document my code.

  4. fbc
    19 November 2010 at 11:05 pm | #4

    Hello Minh,

    I have been looking at sphinx, as you mentioned, I have seen it has a C++ domain. You mention sphinx supports extraction and generation of documentation for C++. I have been looking around, in the manual and some forums, but have not been able to figure it out. For Python, you can use the autodoc extension to include documentation from docstrings. Do you know how to configure sphinx to extract and generate the documentation from C++ source files?

    Thanks!

  5. 4 December 2013 at 7:30 pm | #5

    Hello, Neat post. There’s a problem along with your web site in internet explorer, could check this?
    IE still is the market chief and a good element of other
    folks will leave out your great writing because of this problem.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: