Content deleted Content added
No edit summary Tag: Reverted |
→Approach: add content around test data management from TDD article as this applies generally to integration testing not just TDD. |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 3:
{{Software development process}}
'''Integration testing'''
Integration testing describes tests that are run at the integration-level to contrast testing at the [[unit testing|unit]] or [[system testing|system]] level.
Line 28:
Bing Bang Approach.png|Big bang approach
</gallery>
=== Test Data Management ===
Integration tests that alter any [[persistent storage|persistent store]] or database should always be designed carefully with consideration of the initial and final state of the files or database, even if any test fails. This is often achieved using some combination of the following techniques:
* The <code>TearDown</code> method, which is integral to many test frameworks.
* <code>try...catch...finally</code> [[exception handling]] structures where available.
* [[Database transactions]] where a transaction [[atomicity (database systems)|atomically]] includes perhaps a write, a read and a matching delete operation.
* Taking a "snapshot" of the database before running any tests and rolling back to the snapshot after each test run. This may be automated using a framework such as [[Apache Ant|Ant]] or [[NAnt]] or a [[continuous integration]] system such as [[CruiseControl]].
* Initialising the database to a clean state ''before'' tests, rather than cleaning up ''after'' them. This may be relevant where cleaning up may make it difficult to diagnose test failures by deleting the final state of the database before detailed diagnosis can be performed.
==See also==
|