background image
<< DEFINE STUB | Testing Generic Compilation Units >>
<< DEFINE STUB | Testing Generic Compilation Units >>

Advanced Ada Testing

Test RealTime - User Guide
VAR a, init = 1, ev = init
VAR b, init = 3, ev = init
VAR c, init = 0, ev = 4
STUB printf("hello %s\n")12
#c = add(a,b);
END ELEMENT
END TEST
END SERVICE
Separate Body Stub
Under certain circumstances, it may be useful to define the body stub separately,
with a proprietary behavior.
To do this, declare the stub separately and then define a body for it.
Example
In the following example, Component Testing for Ada will not generate a body for
the service My_Procedure, but will expect you to do so:
DEFINE STUB <STUB NAME>
# procedure My_Procedure(...) is separate ;
END DEFINE
Advanced Ada Testing
Advanced Ada Testing
This section covers some of the more complex notions behind Component Testing for
Ada.
Testing Internal Procedures and Internal and Private Variables
Black box testing is not sufficient as soon as you want to test the following:
·
Internal procedures of packages
·
Internal variables of packages
·
Private type variables
For packages, you can test internal procedures via external procedures. However, it is
sometimes easier to test them directly.
You cannot modify or test internal variables with a black box approach. Internal
variables are generally tested via external procedures, but it is sometimes easier to
modify and test them directly also.
Private type variables are also a problem because their structure is not visible from
outside the package.
116