IBM Research

Center for Software Engineering

Function Test Automation via SALT :

Topics

Center for Software Engineering Home

Orthogonal Defect Classification

Testing

Software Data Analysis

University Partnerships

Publications

Conferences & Workshops

Write Us

Specification & Abstraction Language for Testing (SALT)

Concepts and background:

Current practice of test generation for function testing of Application Programming Interfaces (APIs) involves the following steps performed manually:

  1. Read the informal specifications for functions under test.
  2. Develop the set of test variations that would "adequately" cover the test requirements.
  3. Convert these variations into executable test cases.

There are several drawbacks in these steps due to their manual nature.

  • It is less efficient.
  • It does not lead to measurable test coverage.
  • It does not promote effective reuse and cooperation among testers.

To automate the current process, we have proposed a new sequence of steps. These steps are:

  1. Capture testers' mental model (State/context variables for the component under test, logical Input/Output partitions for each function under test, result relationships among these input/output partitions including updates to context variables) using SALT (Specification and Abstraction Language for Testing), a language developed at Research.
  2. Compile the test model to perform consistency and completeness checks
  3. Use Heuristics for combinatorial optimization of input parameters in generated test variations for each function based on fault models for boolean expressions.
  4. Use Algorithms based on Dataflow dependency analyses to combine test variations from different functions into a test sequence.
  5. Minimize the number of test sequences using the data values for logical partitions.
  6. Generate executable Test case using the tester specified code template fragments.

Characteristics of APIs which are suited for application of current SALT technology:

  • Set up of the input and environment variables is simple and does not require invocation of a sequence of APIs under test.
  • The relationship between Context, Input, Environment, and
    Output variables of the API is simple. For example, the context variables are assumed to be independent of each other and are linear functions of input/ environment variables.
  • Concrete data values associated with the logical partitions have finite cardinality.
  • Expected output can be verified through comparison with actual
    output explicitly within the test case itself (Test cases for verification
    of asynchronous events, timed response etc. cannot be generated
    automatically).
  • Test cases corresponding to the APIs under test can be
    represented in a "Template" format that can be specified by the
    tester. Complete test case can be generated through appropriate
    substitution of input/environment/output variables in this template.

Inputs to SALT compiler:

Currently, the following information is captured by the user in the SALT language in the form of a text file created with any text editor.

  1. Logical Partitions of all input variables for API under Test.
  2. Logical Partitions of all Environment variables affecting the API
    under test.
  3. Logical Partitions of all Output variables produced by API under
    test.
  4. Context variables to "remember" execution history of API invocations.
  5. Relationship among context variables; output, environment, and input partitions expressed as Boolean conditions.
  6. Updates to context variables as a result of function invocations.
  7. Data values corresponding to the logical partitions to be used in test cases.
  8. In addition, the user also gives a template for the test cases to be
    generated.

Outputs from SALT Compiler:

  • List of Test Variations which cover the relationships specified in 5.
    above.
  • A list of test variations which cover sequences of function invocations.
  • Actual test cases corresponding to these test variations

For more information on SALT, please read "SALT - An Integrated Environment to Automate Generation of Function Tests for APIs" by Amit Paradkar.

 

IBMIBM ResearchComputer ScienceCenter for Software EngineeringLegalPrivacySearch IBM

Last revised on February 1, 2002.