473,698 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automating C/C++ Coding Standards for any Operating System

pat
Abraxas Software
Understanding YOUR GOALS & Using CodeCheck Implementing Corporate
Source Code Guidelines C/C++ Source Code GuideLine Automation

The goals of CodeCheck are:

1 To create a standard which will enable you to provide the customer
with a quality product in a timely manner. 2 To promote standardization
of software development among programmers. 3 To act as a learning tool
for new programmers. 4 To act as a reference tool for all levels of
programmers. 5 To promote a team approach among programmers. 6 To help
programmers create readable, re-usable and maintainable

software. 7 To help programmers write portable software. 8 To improve
programmer productivity.
HOW TO ORGANIZE RULE FILE(S) for Corporate QA:

It's a bad idea to deliver too much information. Also normally the
simple comment checking can be ran & fixed by anyone, but the deep
control logic must only be done by your most expert programmer, its
best to split your rule into standard & advanced.

Normally rule files are broken into the following "families"

// STANDARD - Non expert code modification allowable

1.) environment // verify code is "ANSI" compliant?
2.) char sets // legal chars?
3.) comments // header checking
4.) identifiers // hungarian, & other naming
convention
5.) types // correct type checking
6.) constants // legal constant checking
7.) declaration & definitions // consistent decl/defn
8.) Initialization // legal intialization & formatting, ...

// ADVANCED - Requires careful code modification 9.) operators // mixed
operators & complexity 10.) conversion // casting and mixed type's 11.)
expression 12.) control flow 13.) function 14.) pre-processing 15.)
pointer & array 16.) structure & union [ class / template ] 17.)
standard library checking Each rule file should be written for each of
the above sections, and then each

family concatenated into std/adv. Most preferable is to check code by
family if the total number of rules exceeds 1/2 dozen per family.

** TECHNIQUE

Its best to organize rule files by whom is going to analyze the
results, normally the most number of errors will be in the most simple
areas, e.g. standard rules. The most complex problems are less
frequent.

It's best to organize by metrics so you can calculate the weight of all
rules by family, and generate the results as CSV or DBF or HTML files.
Then you can use a browser or database to view the hot-spots, then
apply the rules by family to generate the textual solution to the
problems.

So for the first pass you could have a total rule file that generated a
database enumerating all errors by module, author, error-number,
line-number. Then analyze the results to determine where the effort
should go, and apply the rules that help solve each problem.

CodeCheck is capable of producing most common metric algorithms which
are most useful for finding 'hotspots' in projects, and or modules.
Lastly quantifying programmers by product complexity and/or problem
generation.

** Standard Approach

CodeCheck-ing requires different approaches. 1.) repairing old code

a.) study the old code by family 2.) keeping new code clean

a.) have programmers run rules on their code daily to prevent the
errors 3.) help management understand both of the above

a.) management can have HTML or database data generated showing where
the problems are.

** PROJECTS

When looking at the #include problems you need to use the 'project'
approach, like make-files you need to look at everything. Anytime your
looking at 'global' data you apply the project mode of CodeCheck. All
other stuff is module based, you don't need to run by project.

Basically you need to break things down into three parts,

1.) Use database analysis of all rules on entire project to generate
visual data on entire problem. Then decide plan of attack.

2.) Have programmers run family rule file on each module and fix
problems in order of easiest to hardest.

3.) Have developers apply rules files daily for code enhancement & QA
controls.

** DEVELOPMENT

* Development/Test Procedurecheck file.c // make sure your code is
compilable check -rrule.cc // compile your rule file / develop - this
generates

rule.cco check -rrule.cc file.c // test your rule file on real code
check -rrule.cco file.c // turn your rule file over to production/QA -
they

don't need the source for the rule file .CCO file is an object file
just like a .obj file, CodeCheck doesn't use the .CC file when it runs
on CODE, it uses the .CCO

file, which is a OBJ-TREE.
GETTING TO WORK

If anything is not clear, if anything you can think of is not
available, please contact su*****@abraxas-software.com and we'll send
you what you need.

Dec 5 '06 #1
1 1767
>>>>"spammer" == pat <pa*@abxsoft.co mwrites:

spammerAbraxas Software Understanding YOUR GOALS & Using
spammerCodeChec k Implementing Corporate Source Code Guidelines
spammerC/C++ Source Code GuideLine Automation

spammerThe goals of CodeCheck are:

9. (inferred) To make damn sure I never buy their product.

Charlton
--
Charlton Wilbur
cw*****@chromat ico.net
Dec 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2053
by: ganesan | last post by:
Hi Guys, Could any one knows the best coding standards styles(with variable declarations for c#) . and if any links or site with the best coding standards for .NET send me those links regards Ganesan
4
2291
by: dotNetDave | last post by:
About three weeks ago I released the first .NET coding standards book titled "VSDN Tips & Tricks .NET Coding Standards". Here is what the famous author/ speaker Deborah Kurata says about it: "David McCarter once again demonstrates his knack for pulling best practices into one cohesive unit with his new book "VSDN Tips and Tricks: .NET Coding Standards". This book includes everything from how to set up your project to how to declare...
27
3482
by: Stuart Gerchick | last post by:
C++ Coding Standards : 101 Rules, Guidelines, and Best Practices by Herb Sutter, Andrei Alexandrescu is now a month or so away from release. What is people's opinion on this...is it going to be a seminal work or lackluster http://www.gotw.ca/resources/clcm.htm for info about ]
144
6860
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this initiative. Typically I find that coding standards are written by some guy in the company who has a way of coding that he likes and then tries to force everybody else to write code the way he likes it, not for any rational reason, but simply for the...
22
15339
by: Howard Kaikow | last post by:
There's a significant problem in automating Excel from VB .NET. Reminds me of a problem I encountered almost 3 years ago that was caused by the Norton Auntie Virus Office plug-in. Can anybody reproduce the behavior described below? For this example, I am using Excel 2002 and VS .NET 2002 and VB 6. MSFT KB article 304661 gives a trivial example of early and late binding to Excel from VB .NET. Note that there is a variable naming...
3
3344
by: ct-86 | last post by:
http://www.cdbook.cn/book.asp?id=2393 Organizational and Policy Issues 1 0. Don't sweat the small stuff. (Or: Know what not to standardize.) 2 1. Compile cleanly at high warning levels. 4 2. Use an automated build system. 7 3. Use a version control system.
7
4949
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already developed significant content for the C programming language that is available at: https://www.securecoding.cert.org/ by clicking on the "CERT C Programming Language Secure Coding Standard"
4
6695
by: AzizMandar | last post by:
C++ Event Coding Questions I have done some simple programs in C++ and read a lot of good C++ books (Including The C++ Programing Language, and C++ Primer) I am trying to understand and implement an Event based program and Message system. I have a very basic event engine that I'm feeling works a bit backwards. I'm looking for documents, source code, and books that may help me better understand how to implement this type of code. I am...
3
1776
by: editormt | last post by:
A recent poll asked if programming standards are used by development organisations... and if they are controlled. None: 20% Yes, but without control: 49% Yes, with control: 31% Participants: 369 Source: Methods & Tools (http://www.methodsandtools.com)
19
3966
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4. Framework-Specific Guidelines Naming Conventions and Styles
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.