Knowledge base

A knowledge base is a repository of information about how functions interact in a software system. This information lets Klocwork assess apparent code issues in context to determine if they are true code issues. With this knowledge, the engine is able to find code issues that would otherwise go undetected or to eliminate a specific kind of false positive.

For example, knowledge base entries can help identify how a function uses parameters passed to it, or whether a function is a part of a memory allocation/deallocation pair.

The engine automatically generates and updates these knowledge bases with each analysis run--on the desktop and for the integration build analysis. Native system function behavior is specified in the automatically-generated knowledge bases.

You can also create your own knowledge bases to tune Klocwork issue detection to reduce false positives or false negatives in your C/C++ and Java results. You use the traceback feature in Klocwork Static Code Analysis, Klocwork Desktop or your IDE to pinpoint the source to include in your knowledge-base files in order to achieve your objective.

There are two kinds of knowledge bases: one for C/C++ and one for Java (called Java knowledge bases or JKBs). C/C++ knowledge base files have the .kb extension, while Java knowledge bases have the .jkb extension.

JKBs are written in JKB format, which is a Java-like declarative language for knowledge base specification.