Thursday, April 03, 2008

Free Symbian code verification tools

Automatic code verification tools are a great help to increase the production quality of software and also increase the probability to pass certification. They offer a quick and powerful way to get your code at a professional level.

Below an overview of the available tools:

1. The Symbian C++ compiler

The compiler is of course the first verification tool for your code, though at the most basic level to get your code working. However, warnings often are not taken seriously although they are an important indicator for the cleanliness of your code.

2.SymScan

SymScan is a free command line tool scanning for deprecated literal macro (“_L()”) , correct usage of the Cleanup stack , opening and closing of ‘R’ classes, functions marked as non-leaving which can leave and correct use of descriptors in function calls. It is available for download at the offical Symbian site.

This utility is installed in the C:\Program Files\Common Files\Symbian\Tools\ directory.

To scan single files, type from a Windows command prompt:

symscan “filename.cpp” where filename.cpp is the name of the file you want to scan.

To save the results you can pipe the output to a file e.g. symscan myfile.cpp > output.txt

There are several command line options, to limit the scanning to look for specific warnings.

-H : Display help on available commands
-C : Scan for CleanupStack violations
-D : Scan for misuse of descriptors
-S : Scan for standards violations i.e. deprecated _L()
-L : LeaveScan will be executed when SymScan has completed parsing of the source file.
-A : Perform all scans

e.g. to scan for misuse of descriptors use the following: symscan -D t1.cpp >output.txt

Symscan can also be run from the command line to scan whole directories and output to a file. Use the Windows “for” command to scan directories, eg:

for /R %i in (*.cpp) do SymScan “%i” >> SymScan.txt

SymScan guarantees your code is compliant with the basic Symbian guidelines.

3.Review-X

The trial version of Review-X available at the website of Tieto-X is limited to checks on Leaving function naming, class naming and function parameter naming. The price of the registered version is 500 Euros per license and includes:

• constant naming
• delete without reassignment
• standard C++ construction
• member variable destruction
• leave with KErrNone
• T-class member variable types
• member variable naming
• multiple inclusion
• member variable cleanup
• standard C++ types
• NewLC used in a trap

The full version also offers access to the command line interface, which can be integrated into your build scripts. Review-X features an easy to use graphical interface and html based reporting.

4. LowMem

Although strictly speaking LowMem is not a code verification tool, it indirectly points to badly written Symbian code. LowMem checks the start-up behaviour under simulated low-memory conditions by systematically increasing the available memory at startup by 1 kbyte, starting at 40 kbyte.
Although this test is often described as “strange” it is very effective at exposing code which is not compliant with the Symbian code idioms. LowMem also reports the number of memory leaks. To pass the test a score of at least 90 % is required (less than 10 % failed startups).

5. AppTest Lite

As LowMem, not a code verification tool. AppTest Lite for Symbian OS pre-v9 from SysOpen Digia aims at fully testing against the Symbian Signed Test citeria:

PKG-01: ACS PUBLISHER ID
PKG-02: INSTALLATION AND START UP
PKG-03: FILE CREATION LOCATION
PKG-04: UNINSTALL
PKG-05: INSTALLATION TO ALL MEMORY DEVICES
PKG-06: REINSTALL
PKG-07: UID
GEN-01: SYSTEM FEATURES AND OS FRIENDLY
GEN-02: STRESS TEST
MEM-02: LOW STORAGE MEMORY DURING EXECUTION
PHN-01: SERVICE INTERRUPTION
PHN-02: UNEXPECTED REBOOT
CON-01: TASK LIST
CON-03: BILLABLE EVENTS
MEM-01: LOW MEMORY START-UP

When your application passes all of the above tests you can submit it for certification with some confidence (but no guarantee of passing).

LowMem and AppTest Lite are available at the SymbianSigned website.
Note: At the time of writing there is no avaliable LowMem tool for Symbian v9.x.

Conclusion

Code verification tools and related utilities are becoming very important in Symbian mobile development. They allow to quickly verify if your code is compliant with the Symbian guidelines and increase the likelyhood to pass certification tests. They highlight the importance of the quality and robustness of mobile software in the constrained and demanding environment of mobile devices.

No comments:

stats counter