-
Notifications
You must be signed in to change notification settings - Fork 8
Analysis of developing and testing software that depends on a database
Elena Bondareva edited this page Aug 7, 2018
·
8 revisions
xUnit is a collective name for several unit testing frameworks (JUnit for Java, RUnit for R, etc.). All xUnit frameworks share basic component architecture:
- Test Runner - an application that instantiates a Test Suite Object and executes all the Testcase Objects it contains.
- Test Case - a procedure, whether manually executed or automated, that can be used to verify that the system under test (SUT) is behaving as expected. Often called a test case.
- Test Fixture - all the things we need to have in place to run a test and expect a particular outcome (i.e., the test context). Some variants of xUnit keep the concept of the test context separate from the Testcase Class that creates it; JUnit and its direct ports fall into this camp.
- Test Suit - a way to name a collection of tests that we want to run together.
- Test Run - a test or test suite can be run many times, each time yielding a different test result. Some commercial test automation tools record the results of each test run for prosperity.
- Assertions - a statement that something should be true. In xUnit-style Test Automation Frameworks, an assertion takes the form of an Assertion Method that fails when the actual outcome passed to it does not match the expected outcome.
//TODO:...
//TODO:...
spring-test-dbunit comprises Junit, DbUnit
It uses one of xUnit patterns Four-Phase Test answering the question: How do we structure our test logic to make what we are testing obvious?
Each test has four distinct phases that are executed in sequence: fixture setup, exercise SUT, result verification, and fixture teardown. Why? The test reader must be able to quickly determine what behavior the test is verifying.
- Fixture setup establishes the SUT’s state prior to the test, which is an important input to the test.
- The exercise SUT phase is where we actually run the software we are testing.
- The result verification phase of the test is where we specify the expected outcome.
- The final phase, fixture teardown, is all about housekeeping.