counting lines of code | Needs Regular Fix | | Join Date: Jan 2007
Posts: 281
| | |
good day! I wanna check defect density of an open source tool. This tool can be used for creating a continuous build process. Most of the software is written in java, with a number of additional files written in html, css, html, javascript, xslt, jsp. This tool also has a web interface for users to view their work.
My questions are:
1. Are there possibilities of getting bugs in those additional files such as html, css etc?
2. Do I have to count lines of code of those files?
please feel free to give any comments. thank you.
|  | Moderator | | Join Date: Jul 2007 Location: Arkansas
Posts: 900
| | | re: counting lines of code
When you say "Bugs" are you referring to rendering issues or issues that might hinder the way the tool you are testing works / functions?
I am not clear as to why you would need to count lines of code for HTML/CSS.
Would you please explain your questions better.
--Kevin
| | Needs Regular Fix | | Join Date: Jan 2007
Posts: 281
| | | re: counting lines of code
I was thinking that, bugs may contain in html/css files as well. Let us say that users report some issues/bugs, and in order to fix it, developers have to do changes to the java code and maybe to the javascript, html, css etc. That's why I was confused, do i have to count lines of code of the java files only or all files too? Don't you think so....
Which files should I take to count lines of code of an open source tool, let's say from the SourceForge.net (usually the distribution comes with xml config files, css files, etc). Thank you.
|  | Moderator | | Join Date: Jul 2007 Location: Arkansas
Posts: 900
| | | re: counting lines of code
For more a general answer, I would say that if you know which line of code is causing issues then yes count the lines to get to the proper line to make the fix. If you only know that the HTML or CSS file is not rendering the way you expected, then I would not see where counting the lines of code would matter.
Moving to the Misc forum is this is not an HTML/CSS question, but rather more of a general question.
--Kevin
| | Needs Regular Fix | | Join Date: Jan 2007
Posts: 281
| | | re: counting lines of code
Alright. In this case, I was assuming developers have to change or add more lines to the html/css files too although not all the time.
Sorry, I'm unsure about the rendering thing that you have mentioned, in html and css, are they for visualization purposes only?
|  | Moderator | | Join Date: Jul 2007 Location: Arkansas
Posts: 900
| | | re: counting lines of code
The HTML is the markup for the structure of the page. The CSS is for the presentation / visualization of the page. Rendering would be more of how the browser displays the page.
--Kevin
| | Needs Regular Fix | | Join Date: Jan 2007
Posts: 281
| | | re: counting lines of code
Got it..so what do you think the best either counting or not the lines of code of the html and css files of a java tool that provides a web interface, for measuring defect density. feel free to comment.
| | Needs Regular Fix | | Join Date: Jan 2007
Posts: 281
| | | re: counting lines of code
Sorry one more thing, how about 'build.xml' file in each distribution package of an open source tool? Do you think should be counted or not...
|  | Moderator | | Join Date: Aug 2007 Location: Germany
Posts: 2,466
| | | re: counting lines of code
As far as I know the build.xml is a file for a tool called ant, which builds the java project. So if you want to count the lines of code needed to create the project, yes, count those lines too.
On the other hand, counting the lines of a project isn't very informative really - for example the code snippets - public int add(int a, int b)
-
{
-
int c;
-
c = a;
-
c += b;
-
return c;
-
}
and - public int add(int a, int b) { return a+b; }
have pretty much the same functionality, but the line count is quite different. So you can do it of course, but it doesn't necessarily make sense. You'll have to decide for yourself.
Greetings,
Nepomuk
| | Needs Regular Fix | | Join Date: Jan 2007
Posts: 281
| | | re: counting lines of code
I agree. LOC is not very informative when there are different styles of coding
I was about not to count LOC of build.xml, because my task here is related to defect density, what do you think? can the build.xml contain bugs?
|  | Moderator | | Join Date: Aug 2007 Location: Germany
Posts: 2,466
| | | re: counting lines of code
I'm no expert on ant, but I'd guess that theoretically a build.xml can contain errors just as well as any other file. In most cases however such errors should be detected when building the project - I would think. So, better count it as well, if you continue counting.
Greetings,
Nepomuk
| | Needs Regular Fix | | Join Date: Jan 2007
Posts: 281
| | | re: counting lines of code
You're right - 'errors should be detected when building the project'. So when measuring on delivered defect density, I think build.xml should not be counted, as most of the time it will work.
Thanks for the useful replies, all.
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,449 network members.
|