all groups > vj# > december 2003 >
You're in the

vj#

group:

j# Code Quality


j# Code Quality Abc
12/30/2003 4:44:46 AM
vj#:
Hi,

Is there any tool which tests the j# code quality?
If anybody knows please help me out.

Thanks
Re: j# Code Quality Abc
12/30/2003 7:48:35 PM
Check altogether quality of code.
It may be algorithms,or programming errors etc.

In short given an input file , it should give the quality
of code like if any unused variables or memory leaks etc.

Thanks,


[quoted text, click to view]
Re: j# Code Quality Lars-Inge Tønnessen
12/30/2003 7:53:39 PM

Test what kind of code (algorithms?) ?

Do you have any tool samples for any other languages so we know what to look
for?


Lars-Inge

[quoted text, click to view]

Re: j# Code Quality Lars-Inge Tønnessen
1/2/2004 12:43:39 AM
Inline.

[quoted text, click to view]

This would be nearly impossible to do. What is quality? How should a program
know what good code quality is? How does a program know what you want to
achieve with your code? There may be no simple answers to these questions.
They are ment to be philosophical.


[quoted text, click to view]

You can do this in MS Visual Studio.
Open a new project.
"project" + "properties" + "Configuration Properties" + "Build" + "Errors
and warnings"
Here you can select an warning level and treat warnings as errors.

There are no memory leaks in any plain vanilla .net languages (and Sun
Java). Your .net application is running in an environmet that takes care of
all the memory management for you.

Try to run your code for houres or days with both normal and weird input.
Read a lot of theoretical algorithm books. Do performance studies (with a
"stop watch") on your algorithms. I beleive we also sould take security as
an important issue in this evil world of hackers.


Lars-Inge
http://www.larsinge.com
http://emailme.larsige.com


Re: j# Code Quality Bruno Jouhier [MVP]
1/2/2004 11:19:02 AM
I agree with Lars-Inge: there is no magic tool that will rate your code and
detect bad algorithms or bugs automatically. If there was such a program, it
would be a real star. But there won't be one because there are some
theoretical issues here: for example, no program will ever be able to
analyze *any* algorithm and say if it terminates or not (some programs may
be able to give answers in special cases, but no program will be able to
give an answer in all cases -- this is called the "halting problem").

On the other hand, there are some tools that will help you:

* For easy stuff like unused variables, you don't need any special tool
because the compiler does it if you turn on the appropriate warning level.

* You should not worry too much about memory leaks in the "classical" sense
because the memory is managed automatically. On the other hand, you may
encounter situations where memory is not released because objects are
maintained alive through some references that you have difficulty tracking
down. In this case, a memory profiler like Borland's OptimizeIt may be
helpful (Rational has some tools in this area too). Note: you don't need to
worry about memory corruption (buffer overruns) in managed languages like
Java or C#.

* A tool like FxCop (http://www.gotdotnet.com/team/fxcop) may be interesting
if you want to enforce the Microsoft coding conventions in your libraries.
Unfortunately, some of these rules clash with the Java conventions, and the
J# compiler does not always emit code that keeps FxCop happy. So, this tool
works better with C# than with J#, but you can give it a try.

And the best tool is probably you: read good books, learn about good
programming practices (use assertions, write small methods, use clear and
consistent naming, etc.). Don't rely too much on tools, rely on good coding
practices in the first place.

Bruno.



"Abc" <anonymous@discussions.microsoft.com> a écrit dans le message de
news:05af01c3cf50$f7b28130$a401280a@phx.gbl...
[quoted text, click to view]

Re: j# Code Quality Alexandre Kozlov
2/5/2004 12:17:20 PM
One tool, which come to my mind is Borland Together Control Center.
If supports Audit and Metrics, which is close to what the original poster
wanted.
However, as others pinpointed, there are really no magic tool.


[quoted text, click to view]

AddThis Social Bookmark Button