Measure of Code Quality.

Mainframe Application Testing, Offline testing and Tools. Xpediter, IBM Debugger.
Post Reply
Fiizal Khan
New Member
Posts: 6
Joined: Sat Jul 19, 2014 10:00 pm

Measure of Code Quality.

Post by Fiizal Khan »

How do you folks measure the quality of code in your projects? For simplicity, lets assume we are talking about coding in COBOL. What are the things you pay attention to i.e. collect as metrics?

Irrespective of whether the code base is small, medium or large; code is code. What then are the commonalities in measuring quality of code? Deep research has already been done in this area. McCabe's study provides large number of metrics to capture the quality of code. What are the top 10 code quality metrics that you rely on in your projects? How do you capture them? How do you interpret these metrics? What are some of the lead or lag indicators that tell you that the code is good or bad? How do you use them to prevent or solve a problem?
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Measure of Code Quality.

Post by Anuj Dhawan »

I think it's a complex question to answer - possibly such a measure can easily be applied to open system technologies however for a mainframe, for example, COBOL program, it's tough to define a universal rule for programs which in turn are dependent on Business rules. A review of code by someone with Business and technology acumen had been the key - though I'm open to listen to if other mainframe shops had been following something different.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 825
Joined: Wed Sep 11, 2013 3:57 pm

Re: Measure of Code Quality.

Post by enrico-sorichetti »

How do you folks measure the quality of code in your projects?
define quality of code first :mrgreen:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Measure of Code Quality.

Post by Robert Sample »

Irrespective of whether the code base is small, medium or large; code is code
This statement completely ignores the reality that as the code base grows, the intercommunication between modules becomes more important and more complex. Writing a 500-line COBOL program is pretty simple since there's not a lot that needs to be done (or can be done). Writing a 15000-line COBOL program requires a lot more effort and thought since there will be a lot more happening in that program. And as programs communicate more, the interfaces between them become more important.

Furthermore, what is "quality" in code? You may have a system that runs without an ABEND for months but the user interface is so bad that the users do everything they can to avoid using the system. Is that a quality system? On the other hand, if you have a CICS system that averages 3 ABEND transactions a day (or hour) but the system perfectly handles the business logic and the users love using the system -- is that a quality system?
Fiizal Khan
New Member
Posts: 6
Joined: Sat Jul 19, 2014 10:00 pm

Re: Measure of Code Quality.

Post by Fiizal Khan »

I agree with all the statements made here. Though these question do come up in our weekly/monthly meetings and some times from the clients too and then I don't know if we can have such a thing in place. Now with the statements posted here so far should I say the 'quality of code' can not be measured??
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Measure of Code Quality.

Post by Robert Sample »

should I say the 'quality of code' can not be measured??
I think you would be better off saying that "quality of code" is not a measurable metric. You can count fixes per thousand lines of code per year (or month), you can count ABENDs per year (or month) per thousand lines of code, you can count user complaints per thousand lines of code per time period .... If you cannot come up with a way to count something to measure "quality of code", how could you possibly use "quality of code" -- especially to compare one application to another? However, if you determine what you need to measure, that can become a quality of code metric.

This whole issue is called "software metrics" and there is a pretty substantial body of work about it (Google software metrics and you get about 21,600,000 hits back).
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 825
Joined: Wed Sep 11, 2013 3:57 pm

Re: Measure of Code Quality.

Post by enrico-sorichetti »

Now with the statements posted here so far should I say the 'quality of code' can not be measured??
You can measure something that can be defined

quality on the other side is a very abstract concept ...

how far is <far away> ? :mrgreen:

the only thing that might be measured is the compliance of the product with the standards ( once You have defined them )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Rajiv Nagpur
New Member
Posts: 4
Joined: Wed Aug 20, 2014 11:09 am

Re: Measure of Code Quality.

Post by Rajiv Nagpur »

We do peer review and a senior review some times. If they see some improvement can be done, they help with that. Apart from this we do not follow any rules for the quality of the code. But can there be such rules which a programmer can follow?
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Measure of Code Quality.

Post by Anuj Dhawan »

There are rules on how to make the code more "readable for the next programmer" though I've observed different programmer follow different styles. One programmer might/might not like the style of the other one, however, as long as the style makes it easy for the other programmer, it should be fine. So in general, there are guidelines but not rules, as such, which are abide by some penalties. Having said that - a specific shop, however, might have some rules and the penalties associated with them for this but I've rarely seen such rules.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Testing Tools, Mainframe Application Testing, Abends Solution & QA.”