Parasoft Logo Register | Log in  /  Contact us  /  Blog  /  Support  /  Downloads  /  info@parasoft.com  /  888-305-0041  /  Language »

Unit Testing

 

As software applications evolve into increasingly complex, distributed, n-tier applications, the difficulty in testing them for quality, security, and reliability increases. To resolve and prevent errors throughout all software projects, you must be able to isolate and test the structure and function of individual units of code, or perform unit testing.

Many people use the term “unit testing” to mean functionality testing at the component level, but unit testing is much more than this. Unit testing involves testing software code at its smallest functional point, which is typically a single class. Each individual class should be tested in isolation before it is tested with other units or as part of a module or application. By testing every unit individually, most of the errors that might be introduced into the code over the course of a project can be detected or prevented entirely.

The objective of unit testing is to test not only the functionality of the code, but also to ensure that the code is structurally sound and robust, and able to respond appropriately in all conditions. If code in these systems is not tested appropriately, its vulnerabilities can be used to break into the code and lead to a security risk (a memory leak or stolen pointer, for example) as well as performance issues.

Performing thorough unit testing reduces the amount of work you will need do at the application level, and drastically reduces the potential for errors. However, unit testing can be quite labor intensive if performed manually. The key to conducting effective unit testing is automation. Parasoft provides tools and best practices to automate unit testing and ensure quality throughout the software lifecycle.

Integrating Automatic Unit Testing Into Your Development Cycle

There two modes for integrating automatic unit testing into your development cycle:

Interactive mode

  • As soon as a developer completes and compiles a unit
  • Runs all automated tests
  • Fixes all errors
  • Then checks code into source code repository

Batch mode (via Command Line Interface)

  • Interface that allows unit testing to be integrated into nightly builds
  • All appropriate tests can automatically be re-run at night
  • Developers can immediately determine if modifications caused undesired functionality changes or construction problems

Benefits of Automated Unit Testing

  • Allows developers to impact their development cycle
  • Is the easiest, cheapest, and fastest way of testing is with automated technology
  • Reduces your development time and cost WHILE improving quality


See also:


Read following Parasoft's whitepapers:


Read the following Parasoft technical white papers:

 
  • Best Practices for Bulletproofing C/C++ Code

  • The Yin and Yang of Software Development: 5 Best Practices that Allow Efficiency and Creativity to Productively Coexist

  • Best Practices for Improving the Functionality, Reliability, Security, and Performance of a Large and Complex Java Code Base - 85 KB PDF

  • Bulletproof Java Code: A Practical Strategy for Developing Functional, Reliable, and Secure Java Code - 85 KB PDF

  • Google+RSSBlogTwitterFacebookWikipediaLinked In Copyright © 1996-2014 Parasoft   |  Privacy Policy |  Site Map