Thread: Evaluating C Code Quality without Build Enviroment

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    1

    Evaluating C Code Quality without Build Enviroment

    I have been hired to evaluate a 20 KLOC application in a non-life critical healthcare device. The evaluation is to determine the code quality. This is not a testing effort as other organizations have been hired to do that. I am being retained to view the actual code and determine the quality.

    The code is developed offshore from the US and I have no access to the developers and the actual build environment. There is no code documentation or any up development stream documentation, except for a end user user manual. The comments in the code is extremely limited and in another language that is translatable by Google Translate. I also have no access to the development process used to develop the application.

    I have attempted to use various static analysis tools that will run a lint type of check on the code.

    Besides for the static analysis does anybody have any additional paths I can take to evaluate the code.

    Thank you,

    hmeyers

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Lots of alcohol.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    On what skill set did you sell yourself as being able to undertake this task?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by HMeyers View Post
    I have been hired to evaluate a 20 KLOC application in a non-life critical healthcare device. The evaluation is to determine the code quality. This is not a testing effort as other organizations have been hired to do that. I am being retained to view the actual code and determine the quality.

    The code is developed offshore from the US and I have no access to the developers and the actual build environment. There is no code documentation or any up development stream documentation, except for a end user user manual. The comments in the code is extremely limited and in another language that is translatable by Google Translate. I also have no access to the development process used to develop the application.

    I have attempted to use various static analysis tools that will run a lint type of check on the code.

    Besides for the static analysis does anybody have any additional paths I can take to evaluate the code.

    Thank you,

    hmeyers
    Hmm. Tricky one, and for the most part I agree with quzah. I mean how qualitative can this be if they didn't bother to leave documentation for it?

    Also, what is this quality they speak of? What is the exact metric they are looking for? Efficiency? Code readability? Time that it takes to update or enhance code functionality? Or is it just some term coined by management? If the latter is true I would write a report containing one word: worthless.

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Sounds like you are to be one of a number of opinions. I guess you could do stuff like single step thru it to determine exactly what's going on, etc, and along the way (relative to other sources you have hacked) decide whether you are impressed by this, how comprehensible and maintainable it seems, etc.

    Quote Originally Posted by HMeyers View Post
    I also have no access to the development process used to develop the application.
    Who cares? It's done now. I can't imagine saying "Oh, well this is a great example of a _____ development method" unless ______ is "some deranged bunch of morons owning keyboards". The development process shouldn't have a bearing on the final product.
    Last edited by MK27; 04-26-2010 at 04:31 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    When I think of software quality, I think of:

    1) Documentation - sum of internal and external

    2) Functions: organized along functional lines: input, output, computations, etc., and appropriately sized.

    3) Transparency - ease of understanding it. Imagine you had to make an enhancement to it, and it was your first time seeing the code. How difficult would it be? Assume this programmer speaks only your country's language.

    I would not mark it down because it's from oversea's. I would mark it down if it didn't include English documentation and comments, if you're in an English speaking country. Hard to imagine that it doesn't have that, for you.

    Are the variable and function names, descriptive?

    4) Algorithmic efficiency. How are the big O numbers for it's algorithms? Is it sorting small numbers of values with Insertion sort? GOOD! Is it sorting a large number of values with Bubble sort? BAD! That type of thing.


    The project that has run into this a lot, is the Linux kernel project. If you check them out, they'll have a lot to say about code quality - they've been dealing with it for decades.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 'Type' Error on Build of Officially Released Source Code
    By Jedi_Mediator in forum C++ Programming
    Replies: 5
    Last Post: 07-07-2008, 05:28 PM
  2. EMFPrinter Sourceforge Project Build from Source Code
    By stanlvw in forum Windows Programming
    Replies: 3
    Last Post: 05-27-2008, 02:58 PM
  3. Proposal: Code colouring
    By Perspective in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 05-14-2007, 07:23 AM
  4. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 10:20 AM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM