Parasoft (formally Parasoft Organization) is an autonomous computer program merchant specializing in robotized computer program testing and application security with a base camp in Monrovia, California. It was established in 1987 by four graduates of the California Established of Technology[1] who arranged to commercialize the parallel computing computer program devices they had been working on for the Caltech Enormous Cube [2][3], which was the primary working hypercube computer built.[4] During the 90s, Parasoft utilized innovation in their parallel program toolkit to make computer program test computerization apparatuses for conventional computer program improvement as well as parallel. Beginning with runtime blunder location for C and C++ with their Safeguarded++ item, they too included capabilities for inactive code examination and unit testing and eventually extended to incorporate application security, functional testing, and benefit virtualization.

Delivering software fast is good. Providing software fast with confidence is even better. Whether performing static code analysis during development or web UI testing before releasing to production, keep going. Increase code and test coverage with unit testing and API testing. Use service virtualization to simulate traffic and endpoints for continuous testing and validate the application works reliably with load and performance testing. Verify test results meet expectations and identify gaps in the reporting and analytics dashboard.

• One of the supported compilers must be installed on a supported platform.

Some lessons have additional prerequisites, which are explained at the beginning of the study.

Proper Compiler Configuration is Critical

In most cases, C/C++test must invoke the compiler and linker to perform static analysis and runtime testing tasks, which commonly involve preprocessing, compiling, and linking programs.

To access C/C++test’s full functionality, the machine where C/C++test is run must have the complete development environment and compiler toolchain.

Sample ATM Application

The lessons in this tutorial demonstrate how to test the code for a sample ATM application. This application is a straightforward model of an Automated Teller Machine. It allows access to bank accounts to deposit/withdraw funds and check balances.

The ATM application includes the following files:

  • Account.[hc]xx – Models a client account
  • Bank.[hc]xx – Models a bank containing a set of accounts
  • BaseDisplay.[hc]xx – Defines a simplistic user interface and provides a generic implementation
  • ATM.[hc]xx – Client interface to ATM

The UML model of the application’s design is as follows:

 

The master source for the ATM project is located in <C/C++test install directory>/examples/ATM. This directory contains source files, a Makefile (using GNU GCC), and prepared Visual C++ projects. We will demonstrate how to create a C++test project for this source code in Tutorial – Creating a C++test Project.

 Before starting the tutorial, make a copy of the original examples directory. This ensures that the actual examples in the installation directory are kept intact as you modify the source files.

C/C++test GUI

The following image is the general view of the C/C++test standalone version. The standalone version and the Eclipse plugin version both have the same layout. Project files are displayed in the left pane. The right pane contains the editor. There are several tabs or views on the lower third of the screen; these tabs show information specifically related to each of the labelled tabs. 

The Navigator (a.k.a. “the project tree”) is where you can view projects and select the resource(s) that you want to test.

Configuring and Customizing Perspectives and Views

C/C++test allows you to configure the default layout of the user interface. This is achieved using perspectives and views. 

  1. Choose Window> Open Perspective> Other. The Open Perspective dialogue will open.
  2. From the Open Perspective dialogue, select Parasoft C/C++test, then click OK. Following these steps will change the user interface. The view tabs at the bottom third of the screen can also be manipulated separately for each perspective. Specifically, they can be closed or reopened when desired.

To customize which “views” are available:

  1. If the Quality Tasks view is not already open, open it by choosing Parasoft> Show View> Quality Tasks.
  2. To open the Coverage view, choose Parasoft> Show View> Coverage.

 

    3. To open the Test Case Explorer view, choose Parasoft> Show View> Test Case Explorer.

Create the Generate Unit Tests configuration

  1. Choose Parasoft> Test Configurations to open the Test Configurations dialogue.
  2. From the test configuration tree, choose Builtin> Unit Testing and right-click Generate Unit Tests
  3. Choose Duplicate from the shortcut menu to copy the configuration to the User-defined category.
  4. Select the duplicate configuration and click the Generation tab
  5. In the General tab, confirm the following default settings are selected or enabled:

·    

    • Without test suites.
    • With out-of-date test suites.
    • With up-to-date test suites.

·        Public/global access functions.

  • Set the Max. Several generated test cases (per function) to 2. The default for this setting is 10, but you should develop a few test cases per function to begin.
    • This is to reduce the number of test cases that need to be reviewed until you become familiar with the unit tests in the C++ test.

6. In the Generation> Test suite tab, confirm that the following default settings are selected or enabled:

·         

    • Test suite output file and layout should generate unit tests in a tests/autogenerated directory: ${project_loc}/tests/autogenerated/${file_loc_rel}/TestSuite_${file_base_name}_${file_ext}.${test_ext}.
    • Add tests for functions without tests.
    • Use full project path.

7. In the Generation> Test case tab, confirm that the following default settings are selected or enabled:

·         

    • Initialize global variables as test pre-conditions.
    • Use heuristics for input values.
    • Use non-public class members in pre/post-conditions.
    • Use null values for pointers.
    • Use factory functions.
    • Create an object on Stack.
    • Insert code to report test case outcomes
    • Display the first element of a simple type pointer allocation.

8. Rename the configuration. Generate Unit Tests – 2 tests.

9. Click Apply to save any changes and click Close.

Unit test generation is only applicable to source files. Test suites will be generated for header files only if they are referenced by a source file in the scope of the Test Configuration execution. However, if the header files referenced are not in the scope of the test case generation, no tests will be generated for the header files.

Run and review the test generation configuration

  1. Click ATM.cxx in the file tree to set the file as the test scope.
  2. Choose Parasoft> Test Using> User-Defined> Generate Unit Tests – 2 tests to generate a test suite for ATM.cxx.
  3. Click the Generate Unit Tests – 2 tab (Test Progress tab) and review the summary of the test configuration execution.
  4. Expand the Scope and Generation sections to view additional summary information. We recommend dragging the Test Progress tab to the far right side of the GUI.

 

a. Choose Window> Show view> Other> General> Project Explorer to open the project file tree (if not already open)

b. Expand the newly created ATM> tests> autogenerated directory.

 

 

c. Double-click TestSuite_ATM_cxx.cpp to open the associated test suite’s source file in the editor window. See Extending and Modifying the Test Suite for complete details about test suites.

 

To conclude, the software overall does a great job, with smooth deployment, excellent on-site training and all-around unique collaboration

We are in the early stage of adopting Parasoft VS as part of the CI/CD cycle. The deployment and on-site training were smooth. The people we worked with were very knowledgeable, and the team worked with us to accommodate our specific environment requests.

 

Visits: 67

Picture1
Picture3
Picture4
Picture5
Picture2