Parasoft C/C++test explained

Parasoft C/C++test
Developer:Parasoft
Latest Release Version:2023.2
Operating System:Cross-platform, Linux, Solaris, Windows
Platform:Windows, Linux, Solaris, Embedded, Cross-platform
Language:English, Chinese, Japanese
Genre:Testing
License:Proprietary commercial software

Parasoft C/C++test is an integrated set of tools for testing C and C++ source code that software developers use to analyze, test, find defects, and measure the quality and security of their applications. It supports software development practices that are part of development testing, including static code analysis, dynamic code analysis, unit test case generation and execution, code coverage analysis, regression testing, runtime error detection, requirements traceability, and code review.[1] It's a commercial tool that supports operation on Linux, Windows, and Solaris platforms as well as support for on-target embedded testing and cross compilers.

Overview

Parasoft C/C++test is a combined set of tools that helps developers test their software. It's delivered as a standalone application that runs from the command line, or as a plug-in to Eclipse or Microsoft Visual studio. Various modules in the set assist software developers in performing static and dynamic analysis, creating, executing and maintaining unit tests, measuring code coverage and other software metrics, and executing regression tests.

The errors that C/C++test discovers include uninitialized or invalid memory, null pointer dereferencing, array and buffer overflow, division by zero, memory and resource leaks, duplicate code, and various types of dead or unreachable code.

C/C++test customers include Samsung Electronics,[1] Wipro,[2] NEC,[3] and SELEX Sistemi Integrati.[4] It is also used by Lockheed Martin for the F-35 Joint Strike Fighter program (JSF) [5] Inomed uses it to achieve IEC 62304 certification for their medical device software.[6]

Basic functionality

Code coverage

When testing software code coverage is a measure of which parts of the code have been executed during a test, and which have not. There are many different methods for measuring coverage that have different criteria on how it's calculated. Depending on your needs you can choose which is the best fit for your application.

C/C++test includes options for line coverage, meaning has the line been executed, block coverage, statement coverage, path coverage, decision coverage, branch coverage, and simple condition coverage. It also supports modified condition/decision coverage or MCDC because projects that require safe reliable software such as aircraft and cars, tend to required this form of coverage as it's believed to be a better measure of whether or not the code has been thoroughly exercised.

Regression testing

Regression testing verifies that software continues to operate correctly, even as changes are made and new versions are released. C/C++test automatically generates tests that capture the current state of an applications behavior by recording what happens while the application is running. Later test runs are compared against stored results from earlier runs that help determine what problems changes in the code may have introduced. Having a robust regression test suite is especially critical in areas where there are short release cycles and high degrees of test automation such as agile software development or extreme programming, to help insure that changes aren't introducing bugs into the software.

Runtime error detection

C/C++test includes a lightweight form of runtime error detection that is suitable for use in embedded systems, including running on a target board or host. It helps find serious runtime defects such as memory leaks, null pointers, uninitialized memory, and buffer overflows.

Software metrics

Software metrics are used to help assess and improve software quality. Some metrics are used to help determine where bug-prone code might be, while others help understand maintainability and proper construction. C/C++test provides a variety of software metrics including traditional counting metrics of lines, files, comments, methods, etc. as well as industry standards like fan out, cyclomatic complexity, cohesion, and various Halstead metrics.

Users can configure which metrics they want to run and where applicable can set thresholds for what's an acceptable value for a particular metric. This allows users to flag code that is outside the expected range as an error to be reviewed or fixed. Graphic reports are provided to show values and trends in the metrics.

Static analysis

Static code analysis is the process of analyzing source code without executing the software. It helps developers to find bugs early, as well as code according to best practices.[7] This helps create code that is less susceptible to bugs by avoiding potentially dangerous code styles and constructs.[8] In industries where software performance is critical there are often requirements to run static analysis tools or even particular static analysis rules.

Static analysis in C/C++test includes different types of analysis including pattern-based, abstract interpretation, flow analysis, and metrics. This helps detect code responsible for memory leaks, erratic behavior, crashes, deadlocks, and security vulnerabilities.

C/C++test comes with pre-configured templates to assist enforcing static analysis rules for a variety of industry standards such as:[9]

Traceability

When working in industries where there are strict coding requirements or regulatory standards, it is necessary to be able to prove that an application was developed according to the required steps. traceability is having all the information necessary to prove in a software audit that you've done the proper process. Commonly this means being able to prove what code belongs to a particular requirement as well as who reviewed it and what the outcome of such a review was. It also encompasses any tests and analysis performed on the code and what was done for any tests that failed. C/C++test keeps track of your testing and links it back to the requirement system, source control system, and bug tracking systems. This provides full traceability into each step of the software development process.

Unit testing

The purpose of unit testing is to make sure that all of the individual pieces of a software application work properly by themselves before integration. In programming languages like C and C++ this usually consists of a single file, or a small number of files that all perform a related function. Unit testing encompasses the creation of tests, execution of tests to see the results, and maintenance of tests for long term use. Because unit testing is often associated with code coverage which shows exactly what lines of code were executed by a test, both functionalities are included in C/C++test.

C++test helps you create unit tests that are compatible with xUnit testing frameworks. It also provides tracing functionality that lets you monitor a system under test and generate test cases based on actual paths and data used during the execution. It also provides functionality to handle isolating the code necessary to allow it to function without the rest of the application, also called stubbing, as well as an object repository to store, share, and reuse software objects initialized with the necessary test data. Stubs allow you to remove dependent parts of the full application such as a database or API but still run the application as if the component were still there. C/C++test allows you to create the necessary stubs to run your code in isolation.

The capability to alter and extend test data is provided through a variety of means such as a data source interface that allows you to read test inputs from files, spreadsheets, and databases. Tests can also be run simultaneous with runtime error detection turned on so as to find serious programming flaw that won't necessarily cause assertion failures during testing but are likely to cause software instability when deployed. Execution on embedded systems is support, whether it's a host, target, or simulator, including cross-compilation, loading tests to the target, and loading results from a remote execution back in the GUI.

History

Parasoft C/C++test was originally introduced in 1995 as a static analysis tool based on guidelines found in the book Effective C++ by Scott Meyers.[10] Later when unit test creation and execution was added the product was renamed to C++test.[11] Eventually the product name was modified to include both C and C++ to reflect what languages are actually covered.[12]

Parasoft C/C++test won Software Test and Performances’ 2008 Testers Choice Award in the best embedded/mobile test/performance category.[13] It was selected as VDC's Software Embeddy "Best in Show" award winner in 2012.[14]

Parasoft received TUV certification as an automotive functional safety tool in 2011 according to IEC 61508 and ISO 26262 standards.[15]

Supported systems

Supported compilers

Compiler type (OS)Compiler name / target
WindowsMicrosoft Visual C++
WindowsGNU and MingW gcc/g++
WindowsGNU gcc/g++
WindowsGreen Hills MULTI for Windows
LinuxGNU gcc/g++
LinuxGreen Hills MULTI for Linux
SolarisSun ONE Studio
SolarisGNU gcc/g++
SolarisGreen Hills MULTI for SPARC Solaris
Target/CrossAltera NIOS GCC
Target/CrossADS (ARM Development Suite)
Target/CrossARM for Keil μVision
Target/CrossARM RVCT
Target/CrossARM DS-5 GNU Compilation Tools
Target/CrossCosmic Software 68HC08
Target/CrosseCosCentric GCC
Target/CrossFreescale CodeWarrior C/C++ for HC12
Target/CrossFujitsu FR Family SOFTUNE
Target/CrossGCC (GNU Compiler Collection)
Target/CrossGreen Hills MULTI for V800
Target/CrossIAR C/C++ for ARM
Target/CrossIAR C/C++ for MSP430
Target/CrossKeil C51
Target/CrossMicrosoft Visual C++ for Windows Mobile
Target/CrossMicrosoft Embedded Visual C++
Target/CrossNational Instruments LavWindows/CVI 2015 Clang C/C++ Compiler
Target/CrossQCC (QNX GCC)
Target/CrossRenesas RX C/C++
Target/CrossRenesas SH SERIES C/C++
Target/CrossSTMicroelectronics ST20
Target/CrossSTMicroelectronics ST40
Target/CrossTASKING 80C196 C
Target/CrossTASKING TriCore VX-toolset C/C++
Target/CrossTI TMS320C2x/C2xx/C5x
Target/CrossTI TMS320C2000 C/C++
Target/CrossTI TMS320C54x C/C++
Target/CrossTI TMS320C55x C/C++
Target/CrossTI TMS320C6x C/C++
Target/CrossTI MSP430 C/C++
Target/CrossWind River GCC
Target/CrossWind River DIAB

Supported IDEs

See also

External links

Notes and References

  1. Yoon. JunHo. Code Quality Improvement. Dr. Dobb's Journal. 2006-06-16. 16 June 2006. https://web.archive.org/web/20221005231915/https://www.drdobbs.com/tools/code-quality-improvement/189401916 . 2022-10-05.
  2. Web site: Wipro Meets Exacting Software Quality Standards and Fuels Global Growth through Parasoft's Development Testing Platform. 2017-04-25.
  3. Web site: NEC Telecom Software Philippines Streamlines Internal Quality Initiatives with Parasoft C++test . 2017-04-25.
  4. Web site: SELEX Increases Efficiency with Automated Defect Prevention. 2017-04-25.
  5. http://www.militaryaerospace.com/articles/2013/10/software-code-f-35.html F-35 Joint Strike Fighter benefits from modern software testing, quality assurance
  6. Web site: Inomed Streamlines IEC 62304 Medical Device Software Certification. 2017-04-25.
  7. Web site: JOINT STRIKE FIGHTER AIR VEHICLE C++ CODING STANDARDS FOR THE SYSTEM DEVELOPMENT AND DEMONSTRATION PROGRAM . 2005-12-01 . 2017-04-25 . employ good programming style and proven programming practices leading to safe, reliable, testable, and maintainable code .
  8. Book: MISRA C:2012 - Guidelines for the use of C language in critical systems. MIRA Limited on behalf of the MISRA consortium. 2013-03-01. 978-1-906400-10-1. The MISRA C Guidelines define a subset of the C language in which the opportunity to make mistakes is either removed or reduced. Many standards for the development of safety-related software require, or recommend, the use of a language subset.
  9. Ramel. David. New Agile Project Management Tools Announced. Application Development Trends. 2010-05-28. 7 September 2010.
  10. Web site: New Static Code Analysis tool by Parasoft. 1996-05-05. Parasoft . 2017-04-25. CodeWizard is essentially a software rendition of this book that enforces Meyers' list of ways to achieve effective C++ programming.
  11. Web site: Parasoft Releases New Upgrade of C++test. 2001-04-30. Parasoft. 2017-04-25.
  12. Web site: Parasoft C/C++test Wins Testers Choice Award 2008. 2008-11-04. 2017-04-25.
  13. http://www.embeddedtechnology.com/doc.mvc/Parasoft-Embedded-Wins-2008-Testers-Choice-0001 Parasoft Embedded Wins 2008 Testers Choice Award
  14. http://blog.vdcresearch.com/embedded_sw/2012/09/announcing-the-winner-of-vdcs-software-embeddy-for-the-2012-design-east-show.html Announcing the winner of VDC’s Software Embeddy for the 2012 DESIGN East show!
  15. Web site: Parasoft TUV SUD Certified. 2011-02-24. 2017-04-25. TÜV SÜD certified the latest version of Parasoft C/C++test to be qualified for safety-related software development according to IEC 61508 and ISO 26262 standards..