Home    Bloggers    Messages    Resources
Tw  |  Fb  |  In  |  Rss
Aubrey Kagan

Addressing the Issues of Validation & Verification

Aubrey Kagan
Newest First   Oldest First   Threaded View
Page 1 / 2   >   >>
jkvasan
jkvasan
11/22/2012 10:42:01 AM
User Rank
Blogger
Re: Lines of Code
I understand the situation.

We cannot go to a level of telling them that we use a RISC controller with less nuber of instruction set, which when written over and over contributes to these many lines of code, bla, bla.

It is quite sticky.

I am sure our community would be definitely coming up with something more helpful than what we just discussed. Best of luck!

50%
50%
antedeluvian
antedeluvian
11/22/2012 10:25:45 AM
User Rank
Blogger
Re: Lines of Code
jkvasan

I may make them understand that all code is not critical sections by way of categorising into

I think you are working from the premise that the auditors are logical and understand what they are doing. In my experience (and certainly in this case) auditors are not familiar with the level of detail which they require. They simply follow the path, and make sure they have an answer to their questions, whether or not the answer makes sense. They are simply covering their backsides in case something goes wrong down the road.

There is a saying in English: "there are none so blind as those that will not see." You can try to make them understand all you want, if the rules say "lines of code" then that's what they want whether it makes sense or not.

50%
50%
jkvasan
jkvasan
11/22/2012 10:15:39 AM
User Rank
Blogger
Re: Lines of Code
It occurs to me that they are interested more in the flow of code than the code itself.

I may make them understand that all code is not critical sections by way of categorising into 

Configuration code, library or driver code and application code which may be critical and non-critical. This way they would be looking for the critical section as the main code section. In essence, this would reduce the lines of code barrier.

This may be helpful. There is a saying in my mother tongue

"Milk the dancing cow by dancing along and the singing cow by singing along".

I do not know if I am translating it properly in english but the essence is clear, I guess.

50%
50%
antedeluvian
antedeluvian
11/22/2012 9:09:32 AM
User Rank
Blogger
Re: Lines of Code
jkvasan

 

You are quite right. No doubt that was the intention of the experts who came up with the definitions- but I don't think the auditors have the same level of understanding and so there is no definitive answer to any clarification I request.

The problem is how to answer their questions, especially when I am trying to minimise the time I waste on it.

50%
50%
jkvasan
jkvasan
11/22/2012 9:02:39 AM
User Rank
Blogger
Re: Lines of Code
Guess they are meaning by 'modules', the divisions based on the algorithms. We designers modularise our programs based on peripheral drivers and libraries whereas for the auditors who may be more concerned with overall product quality could ask for modules such as motor control, temperature sensing, rpm measurement etc, the modality could be based on the application and its functionality.

100%
0%
antedeluvian
antedeluvian
11/22/2012 8:45:20 AM
User Rank
Blogger
Re: Lines of Code
jkvasan

Your concerns are certainly valid. The whole product is owned by the customer and I have explicit authorization to give the auditors any information they ask for. In turn our customer is protected by a Non Disclosure Agreement with the auditors.

As far as the lines of code are concerned, we are simply being asked for numbers, the question being how relevant the number of lines in a source document is. After all, there are many blank lines and comments. Everyone documents differently. How can you compare a source document from a verbose programmer to one from a taciturn engineer and use that number as a meaningful measure of software complexity?

This program translates to ~5500 words (the PIC uses a 14 bit "word")of machine code. By that number and the definitions that the auditors use, this is a medium complexity level, even though based on my experience and the drift in the electronics industry to much larger programs, this is a low complexity product. There are ~10500 lines of code in the source documents changing the complexity definition to High.

The auditors are working with a document from the Canadian Standards Association (although they are US based and the project is a US project) so I assume there is no US equivalent. The software complexity levels are:

<1000 lines of code: low complexity

1000-9999: medium

10000-99999: High

>100000: Very High

but there is no definition of "lines of code". Another factor is also "Internal Modules", but again no definition. Are these the source modules that make up the source program, or is it refrerring to possible library modules that are linked in?

50%
50%
jkvasan
jkvasan
11/22/2012 5:21:00 AM
User Rank
Blogger
Re: Lines of Code
Is giving important part of code just like that, advisable? If you had already transferred all technology to customer, this doesn't matter. In case you are OEM supplying or providing only the hex file, it would be important to understand how this model will work.

We normally have several models of tech transfer which include

  1. Wholesome tech transfer with high-level/asm code
  2. Hardware tech transfer with only hex code.
  3. Supply as OEM product till certain quantity is met and do tech transfer
and so on. Above is in the descending order with respect to charges.

I am sure you must have secured your interests accordingly.




 

50%
50%
antedeluvian
antedeluvian
11/21/2012 5:24:55 PM
User Rank
Blogger
Re: Lines of Code
Rich

you might ask them if they mean physical lines of code (which does include comments) or logical lines of code (which only includes things the compiler needs). You might also ask them if comments are to be counted separately.

I did ask- one auditor understood, the other didn't. I got conflicting answers.


Or, just provide all three - physical lines, logical lines, and comment lines. That way you'll be sure to give them what they need.

I did- fortunately since a PIC 16F series has a one-to-one correlation between flash memory usage and code producing lines of code (except for sting definitions, of which I have none) the answer was quite simple by reviewing the hex file or even better, in my case reading it into the PROM programmer and noting where the flash had data.


50%
50%
Rich Quinnell
Rich Quinnell
11/21/2012 3:55:31 PM
User Rank
Blogger
Re: Lines of Code
AD, you might ask them if they mean physical lines of code (which does include comments) or logical lines of code (which only includes things the compiler needs). You might also ask them if comments are to be counted separately.

Or, just provide all three - physical lines, logical lines, and comment lines. That way you'll be sure to give them what they need.

50%
50%
antedeluvian
antedeluvian
11/21/2012 11:01:39 AM
User Rank
Blogger
Lines of Code
Now I am being asked for lines of code as a measure of complexity. Do comments, memory allocation, macro definitions and processor definitions count as "lines of code"?

Anybody got any experience?

50%
50%
Page 1 / 2   >   >>
More Blogs from Aubrey Kagan
Aubrey concludes his ongoing Bluetooth/Android design project with a bit of a twist.
Concluding his series on temperature sensing using MCUs, Aubrey talks about mounting, calibration, and other considerations.
In the third of four parts, Aubrey talks about semiconductor sensors and software issues.
In part two of a four-part series on temperature sensing, Aubrey talks about getting the sensor's signal into the MCU.
First in a four-part series, Aubrey's blog sets the stage for talking about temperature measurement.
flash poll
MC on twitter
like us on facebook
Microcontroller Central    About Us     Contact Us     Help     Register     Twitter     Facebook     RSS