automating software communications architecture (sca) testing with spectra cx

Download Automating Software Communications Architecture (SCA) Testing with Spectra CX

Post on 10-May-2015

928 views

Category:

Education

2 download

Embed Size (px)

DESCRIPTION

Testing early on and throughout the development cycle reduces the risks that affect time to market, cost and software quality. By exercising components (application components, devices and services) at the beginning of the development cycle in a runtime environment, and by continuing to test, as components are refined, developers can be assured of continuous Software Communications Architecture (SCA) compliance up to development cycle completion. Spectra CX SCA Test can be used to test the software aspects that have been hand written, generated automatically using a Spectra CX Code Generator, or generated automatically using a 3rd party tool. Developers benefit from fully automated testing of all aspects of the SCA specified interfaces for each component.These slides will demonstrate the steps for unit testing the standard SCA interfaces of an SCA component with Spectra CX SCA Test. Topics will include: introduction to the Spectra CX unit testing framework; generation of standard unit tests; execution of unit tests on-host and on-target; and creating custom test cases.

TRANSCRIPT

  • 1.March 3, 2011 Automating SCA Testing with Spectra CX

2. INTRODUCTION

  • Spectra CX isa model-driven development tool that forms the backbone of the Software Communications Architecture (SCA) development process.
  • Spectra CX(SCX)reduces development risk, accelerates development and improves the software quality of SCA applications and platforms through SCA validation and automatic generation of SCA artefacts.
  • The SCA Test feature facilitates a key element in this development process by providing industrial strength SCA component test code generation, execution of tests on host or target systems, and detailed reporting of test results.

3. AGENDA

  • Overview of the SCA Test feature
  • Benefits of SCA Test
  • How it works
  • How you use SCA Test
    • Workflow
    • Demonstration
  • Customization and Extensibility

4. Validation versus Testing XML Descriptors Binaries Validation (Static) Test (Dynamic) Validation Report Test Cases Validation Rules Test Report SCA Model 5. Spectra CX SCA Test

  • Model-based testing framework for the SCA
    • Plug-in feature for Spectra CX 3.2.X
  • Provides radio developers with a standalone capability for unit testing SCA components
    • On-host or on-target using TargetLoader
    • Implementation independent, black box, testing using JUnits and CORBA
  • Includes test cases for the Component Lifecycle interface
  • Supports user-defined test cases

6. Tests Base Application Interfaces 7. Tests Base Device Interfaces 8. Benefits of Unit Testing

  • By automating the process of testing SCA components and applications, SCA Test significantly accelerates the testing cycle, improves user productivity and establishes high quality software from the very beginning of the development cycle
    • SCA Test can be used to test the compliance of software that may have been hand written, generated automatically using a Spectra CX Code Generator, or generated using a 3rd party tool.
  • Testing early on and throughout the development cycle reduces the risks that affect time to market, cost and software quality.
    • By exercising components at the beginning of the development cycle in a runtime environment, and by continuing to test as components are refined, developers can be assured continuous SCA compliance up to development cycle completion.

9. Benefits of SCA Test

  • SDR/SCA-specific model-based testing
    • Provides a test capability that is optimized for SDR/SCA
    • Testing based on the current design and implementation
  • Completely integrated with the Spectra CX development environment,
    • All SCA Test compile, build and execute actions can be initiated from the Spectra CX environment.
    • Users can prepare the runtime environment for execution and observe their code running on host and/or target.
    • Developers benefit from the simplicity of using only one tool for modeling, validation, code generation, execution, and test.
  • Tests can be executed on host or target
    • Unit testing can even begin with only a basic CORBA connection to the component allowing testing to begin before a full platform with a live SCA operating environment is available.
    • Multiple implementations of a component can be tested to ensure proper operation on all defined implementation platforms.

10. How it Works SCA Test Feature Eclipse JUnit Framework (Java) SCA Test Target Loader (C++) Component Under Test Communicates with via CORBA Instantiates Generates JUnits Instantiates & Terminates Component Host Host or Target 11. TargetLoader

  • In an SCA system typically the operating environment and more specifically the platform elements take care of instantiating components and or devices.
  • Since it is desirable to test components before this may be available or without the overhead of the SCA operating environment we provide TargetLoader software.
    • TargetLoader is responsible for loading the component under test into the appropriate environment.
  • Typically there will be one TargetLoader for each target environment
    • A TargetLoader can be referenced by multiple component implementations -- dont have to model the TargetLoader for each component implementation
    • Once a TargetLoader is running, it can be reused for multiple test executions

12. SCA Test Workflow Generate Compile Execute Evaluate Prepare For each component to be tested Create test project(s)/model(s) Build the TargetLoader(s) Run the TargetLoader(s) Model the TargetLoader(s) 13. Generating Component Tests

  • SCA Test generates aJUnit test for a components LifeCycle, PortSupplier, PropertySet, ResourceFactory, Resource and Device interfaces
  • Any component implementation can be designated for automatic testing.
  • A comprehensive suite of tests will be automatically generated for each component.
  • The generated test harness includes all the code needed for connecting to and exercising, through CORBA, the resource interface on the component under test -- anSCA Core Framework is not required .

14. Compiling Component Tests

  • The target may be an actual SDR platform or the host development environment, depending on the compiler and CORBA tooling that is available for the test harness.
  • The generated testing software can be fully integrated into the projects build process.
  • Spectra CX can be directed to automatically build the generated test harness into an executable, ready to run on host or target.

15. Executing Component Tests

  • SCA Test generates the JUnits which interact with the Target Loader
  • Target Loader deploys and instantiates the component implementation and test harness binaries on the host or target platform
  • Users simply initiate the test from Spectra CX
    • Once initiated, execution of the tests defined for SCA resource compliance is carried out by the JUnit through the CORBA environment, without need for an SCA Core Framework to be present
  • Results of the tests are recorded by the JUnit

16. Evaluating Test Results

  • Upon completion of the tests, a unified report is presented in the SCX user interface
  • This report can then be used to correct any issues identified and/or prove compliance with the SCA standard for components that support theLifeCycle, PortSupplier, PropertySet, ResourceFactory, Resource or Device interfaces
  • A standard JUnit report (xml) is also generated
    • This can be converted into HTML and other formats

17. DEMONSTRATION 18. Customization and Extensibility

  • Spectra CX uses open standards to translate model information to test code and gives users full access to the code template.
    • Users can modify tests
    • Engineering teams can optimize the template to accommodate their environment if they need to.
  • Provide customer extensible framework for unit testing a component
    • Generate empty tests for all provides ports methods
    • Customers can add their own JUnit tests
  • Generate Target Loaders from the tool using build configurations
    • Provides support for the customers target platform(s)

19. Adding Unit Tests for an SCA Component

  • Create a new Java Project
  • Create a new class for the test cases
  • Configure the build path for the project
  • Add a JUnit library
  • Add a default constructor to the test class
  • Add test cases

20. Create a new Java Project

  • Select File > New >Java Project while in the Java Perspective.
  • In the New Java Project wizard set the Project Name. Leave the other values as their defaults. Click the Next button.

21. Set the project parameters

  • On the Java Settings page switch to the Project page.
  • Click the Add button and add the project that contains your generated test code.

22. Create a new class for the test cases

  • Right-click on the src folder in the new Java project and select New > Class.

23. Set the class fields

  • In the New Java Class wizard set the Package, Name and Superclass fields.
  • The Superclass field should be set to the implementation test class from the generated test code.

24. Configure the build path for the project

  • Configure the build path for the project so that the class will not have compilation errors.
  • Select the new Java project and right-click, then select Build Path > Configure Build Path