Instrumentation (computer programming)

With instrumentation of the source code is enriching with additional information referred to can investigate the behavior of a computer program in software development. Instrumentation is used in software testing to determine the test coverage and profilers are used. The instrumentation is done automatically through special programs.

To illustrate, a section of code in the Java programming language before and after instrumentation.

Public bool ISEVEN (int number ) {    if ( number % 2 == 0)    {       return true;    }    else    {       return false;    } } Through instrumentation code is added to the following form:

[ ... ]   private void protokolliereIstGeradeBetreten () {    Increment / / counter " istGeradeBetreten " in a log file    [ ... ] }   private void protokolliereIfBetreten () {    Increment / / counter " ifBetreten " in a log file    [ ... ] }   private void protokolliereElseBetreten () {    Increment / / counter "else enter " in a log file    [ ... ] }   [ ... ]   public bool ISEVEN (int number ) {    protokolliereIstGeradeBetreten ();    if ( number % 2 == 0)    {       protokolliereIfBetreten ();       return true;    }    else    {       protokolliereElseBetreten ();       return false;    } } The program is then compiled and executed. After execution, the log file can be analyzed and determined, for example, if all three points have been increased.

  • Software Engineering
414174
de