Embedded Systems October 2000 Vol13_11

Issue link:

Contents of this Issue


Page 176 of 181

BREAK POINTS tion/ exception handler, and for IFs nested five deep. Since post-compile erro r rates run around 5%1 (five bugs per 100 lines of code), even a small sys- tem with 10,000 lines of code might have 250 lurking bugs after it's com- pletely "tested. " Though devising bet- ler tests is surely a good idea, inspec- tions will bring most of these hidden problems lO light. fnslJecl approximately 100 10 200 lines of code per hour. There's a sweet-spot al 150 lin es of code per ho ur whe re inspections proceed very effi cie ntly yel unve il most o[ the d efects. 2 Monitor the inspection rate. These numbers, which come from da la I've been accumulating for a number of years, suggest that inspections cost (assuming the re's no benefit!) approximately $2 per lin e of code, or 10% of th e usual $15 to $30 per lin e cost for most comme rcial firmware. Track debugging lime. It sure i fun to crank code. But in many organizations a large portion of a project's time gets consumed in the debugging phase. This is a certain sign of dysfunctional developmen t. It indicates that the developers either wrile the code care- lessly or spend too li ttle time on speci- fication and design. Measure b-ugmles. A few ['unctions or mod- ules typically exhibit most of the prod- uct's defects. We've all been there. We've al l worked on a f"tmction so complex, so poorly understood, and so badly coded tllat we' re terrified of opening it in the editor. Change a single character in a comment and the code stops working. Ban), Boehm, the software estimation gum, has shown thal these elTor-prone ftJJ1ctions, which typical ly represent a small percentage of tile total code base, contain 60% to 80% ofthe elTors. More compellingly, his data indicate these problem-[unctions eat up four times more effort than uleir well-behaved brethren. It behooves us to take data to quantitatively figure out which are bad, and then toss bad code and start again. Debug proactively. Face it, you' re going to have problems. The code will be far from perfect. Plan for bugs and inStiLl- ment your code to find them quickly. Does your RTOS include a stack-over- flow checker? Leave it enabled whilst debuggin g. Or seed ule stack with a paltern , then stop the debugger from time to time to see if stacks are too big or too small. Why not fi ll unused ROM/ flash with nasly instructions, like software inlerrupts, that vector off to a debug routine? When code crashes il often just wanders off, perhaps in to your carefu lly seeded ROM area. The soft- ware interrupts and associated han- dier wi ll capture ule crash quickly, and in safety-crilical systems can bring the system to a known harmless state. Dinkumwace, Ltd. Genuine 5 rftware Dinkum C++ for GCC/Linux Includes the Dinkum C99 Library Comes ready to run with GCC 2.95.2 on either SPARC Solaris or PC Linux Dinkum® C99 Library A complete implementation of the ISO/ lEC 9899:1999 Standard C Library. The Dinkum C99 Library has rich math and locale support, and has ~ the extensive additions required '" . to conform to the C++ Standard. 9,9 *DinkulTlware & Dinkum are Registered Trademarks of Dinkumware, Ltd. Solaris & SPARe are Registered Trademarks of Sun Micorsystems , Jnc. Dinkum C++ for GCC / Solaris Custom C++ Code Compliance Analysis since 1984! CODECHECK® CODEFIX® Version 2.0 C++ CODE MAPPING CODEFIX Version 2.0 is a pro· grammable tool for modifying aI/ C and C++ source code on a file or project basis. • Obfuscation and shrouding for C++ programs. • I nsertion of code for dynamic runtime testing. • Database generation from C++ source code. PCYACC® Version 9.0 PROFESSIONAL LANGUAGE DEVELOPMENT TOOLKIT Includes "Drop In " Language Engines for SOL, dBASE, POSTSCRIPT, HYPERTALK, SMALLTALK-80, C++, C, PASCAL, PROLOG, FORTRAN, COBOL, BASIC, SGML, ASN, RPG, REXX, PL 1, SNA, RTF, VISUAL BASIC, SOL2, DB2, VHDL, HTML, VMRL, JAVA, ODMG·ODL/OOL, SOL3, MODULA·3, DELPHI, VBS, and ADA. , Version 9.0 SOURCE CODE ANALYST Includes "Drop-In" Rules for Compliance analysis, Adherence to specifications, Measures of complexity, Silent error detection, Code maintainability, and Portability. • Maintainability - CODECHECK identifies and measures complex, sloppy, and hard to maintain code. • Compliance - CodeCheck allows your corporate coding and project specification standards 10 be com· pletely automated for compliance validation. 30 day Money back guarantee! Free AIR Shipping anywhere in the world! ~ • Portable Object Orienled Classes for C++ and JAVA - Error, Symbol Table, Syntax Tree, Yacc, and Lex. ABRAXAS'· Software,Inc. 4726 S.E. Division SI. Portland, OR 97206 TEL (503) 232·0540 FAX (503) 232·0543 E·Mail: To Order Call 1-800-347-5214 DOS $495, MAC $495, LlNUX $495, WIN 2000 $995, UNIX $1995. Embedded Systems Programming oaOBER 2000 173

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems October 2000 Vol13_11