Discover and Uncover
By rchrd on Feb 14, 2011
There are two new tools in the 12.2 release of Oracle Solaris Studio. Discover detects memory leaks, and Uncover measures code coverage in an application:
Memory-related errors in programs are notoriously difficult to find. Discover allows you to find such errors easily by pointing out the exact place where the problem exists in the source code. For example, if your program allocates an array and does not initialize it, then tries to read from one of the array locations, the program will probably behave erratically. Discover can catch this problem when you run the program in the normal way.
Other errors detected by Discover include:
- Reading from and writing to unallocated memory
- Accessing memory beyond allocated array bounds
- Incorrect use of freed memory
- Freeing the wrong memory blocks
- Memory leaks
Discover is simple to use. Any binary (even a fully optimized binary) that has been prepared by the compiler can be instrumented with a single command, then run in the normal way. During the run, Discover produces a report of the memory anomalies, which you can view as a text file, or as HTML in a web browser.
Complete documentation on Discover and Uncover is here.
Uncover is a simple and easy to use command-line tool for measuring code coverage of applications. Code coverage is an important part of software testing. It gives you information on which areas of your code are exercised in testing and which are not, enabling you to improve your test suites to test more of your code. The coverage information reported by Uncover can be at a function, statement, basic block, or instruction level.
Uncover provides a unique feature called uncoverage, which allows you to quickly find major functional areas that are not being tested. Other advantages of Uncover code coverage over other types of instrumentation are:
- The slowdown relative to uninstrumented code is fairly small.
- Since Uncover operates on binaries, it can work with any optimized binary.
- Measurements can be done by instrumenting the shipping binary. The application does not have to be built differently for coverage testing.
- Uncover provides a simple procedure for instrumenting the binary, running tests, and displaying the results.
- Uncover is multithread safe and multiprocess safe.