Embedded Systems November 2000 Vol13_12

Issue link:

Contents of this Issue


Page 144 of 189

Error Prevention By Personal Rules by Adam Kolawa I have described how coding standards can decrease the time spent on testing and debugging during the development process. But here is another way coding standards can help developers. Typically during the development process a programmer writes the code, compiles it, debugs it, then goes back and fixes the bugs that were found in the code. Each programmer has a personal coding style comprised of their own preferences, techniques, skills, and quirks. Since we are human, we also have a tendency to make the same bug- causing mistakes over and over. You might ask, "Is there a way to keep myself from repeating the same mistakes?" Yes, there is. To see how this is possible, consider the following example: in an IF statement, say I happen to have the habit of dropping the second equal sign (a=b instead of a=b), which we know changes the meaning of the statement. While an assignment within an IF statement is "legal ," forgetting the second equal sign is almost always a typographical error. This can cause the code to function in ways not intended. If I have a tendency to make this mistake repeatedly, then I would want to be warned every time I made it. Performing this self-check manually is usually a very difficult and time-consuming process. So the next question is: "Does a technology exist that can automate this process?" The answer is: yes. There are tools now available which enable you to specify personal coding rules (in addition to company standards). While something like the warning for the IF statement can be an annoyance to someone who doesn't make this mistake, it can be a blessing to the person who does. So that warning won't be part of the company's general coding standards; it will be part of the rules specific to that developer. Once the developer rids himself of his bad habit, the rule can be discarded. By taking advantage of these new technologies and creating personalized coding rules, you can protect yourself from making mistakes and improve the code that you write. Adam Kolawa, Ph.D., is Chairman and CEO of ParaSolt. You can reach him at ParaS oft"' Im (C) 2000 ParaSolt Corporation, Monrovia, CA. USA. ParaSoft and CodeWizard are registered trademarks of ParaSoft Corporation. code wizard® ParaS oft® CodeWizard® prevents C/C++ errors and slashes your debugging time "Code Wizard is awesome. I am recommending our management to purchase at least 5 copies .... ParaSol/ has a lot to offer to the world of C++ development.· -Piyush Shaw, Arrowsmith Technologies, Inc. CodeWizard"' is a tool that helps you prevent errors by automatically performing static analysis on C!C++ code. The first thing you'll notice about CodeWizard is that it cuts down on the thing you hate the most: debugging. Preventing errors with CodeWizard is painless and saves you time in the long run . clicks, you can tell CodeWizard to enforce only the standards that are most important to you at a particular stage of your project. Using the RuleWizard feature , you can point and click to build your own sophisticated coding standards. RuleWizard guides you through the coding standard building process and lets you know when your coding standard is ready for enforcement by CodeWizard. :~::...~~-· C'*l-:.'.JJ~t:!. l'c.P II"" II ..... . -·- _ , ... ._, :!~:::: ::~ ::=::: ~ ~;:;.~:-u..•o (" ' ; • • • • 10\ ••• , '"""'~ .} 101 1 :;_;: !/ 1 - · VPf' u- n ~~~~=~~~~~~~==o:.~, or call (888)305- 0041 for more information. '"""'·"""""""""""'""""'"""',.....oo;rr./1 Code Wizard enforces over 120 sophisticated GIG+ coding standards. CodeWizard automatically enforces a sophisticated set of C!C++ coding standards. These language-specific rules are designed by industry experts such as Scott Meyers to help you avoid dangerous coding constructs. CodeWizard parses your code, clearly displays violations of the coding standards, and gives you all the information you need to make repairs, including suggestions on better coding constructs. Follow CodeWizard's coding suggestions, and you'll immediately begin to write cleaner, more reliable code. The key to CodeWizard is that you can customize the program to fit your development schedule. With a few .:o ' e::r. It- 1\ You won't have any problem adding CodeWizard to your arsenal of development tools, because it installs directly into Windows and UNIX development environments. In Microsoft Developer Studio, you'll begin testing with a single click of the CodeWizard icon. On UNIX platforms, CodeWizard is a wrapper around the compiler. Learn a few simple commands, and you'll be on your way to cleaner code. If you would like to prevent errors with a customizable tool that conforms to your development cycle, download CodeWizard today at

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems November 2000 Vol13_12