Difference between revisions of "NA-MIC-kit-curriculum/Testing-Based Programming"
From NAMIC Wiki
(13 intermediate revisions by 2 users not shown) | |||
Line 17: | Line 17: | ||
− | : ''The national annual costs of an inadequate infrastructure for software testing is estimated to range from $22.2 to $59.5 billion.'' | + | : ''The national annual costs of an inadequate infrastructure for software testing is estimated to range from $22.2 to $59.5 billion (0.06% of GDP). Over half of these costs are borne by software users in the form of error avoidance and mitigation activities.'' |
Line 24: | Line 24: | ||
As a reference the annual budget of NIH is [http://www.nih.gov/about/almanac/appropriations/part2.htm $30 billion]. | As a reference the annual budget of NIH is [http://www.nih.gov/about/almanac/appropriations/part2.htm $30 billion]. | ||
+ | |||
+ | |||
+ | |||
+ | = Testing Practices = | ||
+ | |||
+ | This section describes the practices of a Testing-based software development methodology. | ||
+ | |||
+ | # Write tests '''before''' writing the code | ||
+ | # Test Continuously | ||
+ | # Test '''Everything''' | ||
+ | #* No feature is small enough to not deserve a test | ||
+ | # Compute Code Coverage | ||
+ | #* Number of lines of code exercised during testing | ||
+ | # Perform Dynamic Analysis | ||
+ | #* Checks for Memory leaks | ||
+ | #* Checks for Uninitialized variables | ||
+ | |||
+ | = How do do Testing = | ||
+ | |||
+ | == Tutorials == | ||
+ | |||
+ | * [[NA-MIC-kit-curriculum/Testing-Based Programming/How to add Tests in CMake|How to add Tests in CMake]] | ||
+ | * [[NA-MIC-kit-curriculum/Testing-Based Programming/How to send test results to the dashboard|How to send test results to the dashboard]] | ||
+ | * [[NA-MIC-kit-curriculum/Testing-Based Programming/How to run Code Coverage|How to run Code Coverage]] | ||
+ | * [[NA-MIC-kit-curriculum/Testing-Based Programming/How to run Dynamic Analysis|How to run Dynamic Analysis]] | ||
+ | |||
+ | == Reference Material == | ||
+ | |||
+ | * [http://www.itk.org/Wiki/CMake_Testing_With_CTest Testing Software with CTest] | ||
+ | * [[NA-MIC-kit-curriculum/Testing-Based Programming/Slicer3 Code Coverage|Slicer3 Code Coverage]] | ||
+ | * [[2009 Winter Project Week Command Line Program Testing]] | ||
+ | * [[Slicer3:Testing|Slicer3:Testing]] |
Latest revision as of 18:47, 5 January 2010
Home < NA-MIC-kit-curriculum < Testing-Based ProgrammingContents
Introduction
Testing-Based Programming is an software development methodology that relies on continuous and exhaustive testing as a scaffolding for facilitating rapid development.
The principle is very simple:
- If you have an extensive test-suite that exercises all the capabilities of your software, you can make both swift and large scale changes to the code, and rely on the testing-suite to reveal immediately if any bug has been introduced by the changes.
- In the absence of a testing-suite, every change in the code has the potential of introducing new defects that will go unnoticed for a long time.
As an illustration of what happens in a world without sufficient Testing:
- The national annual costs of an inadequate infrastructure for software testing is estimated to range from $22.2 to $59.5 billion (0.06% of GDP). Over half of these costs are borne by software users in the form of error avoidance and mitigation activities.
"The Economic Impacts of Inadequate Infrastructure for Software Testing" NIST Report
As a reference the annual budget of NIH is $30 billion.
Testing Practices
This section describes the practices of a Testing-based software development methodology.
- Write tests before writing the code
- Test Continuously
- Test Everything
- No feature is small enough to not deserve a test
- Compute Code Coverage
- Number of lines of code exercised during testing
- Perform Dynamic Analysis
- Checks for Memory leaks
- Checks for Uninitialized variables
How do do Testing
Tutorials
- How to add Tests in CMake
- How to send test results to the dashboard
- How to run Code Coverage
- How to run Dynamic Analysis