Concordion Concordion Integration and Best Practices 2 — Questions and Answers
Question 1: What is the recommended scope for Concordion acceptance tests versus unit tests?
- Acceptance tests at feature/behavior level; unit tests at method/class level (Correct answer)
- Acceptance tests replace all unit tests
- Unit tests replace acceptance tests for speed
- Both types test the same scenarios
Correct answer: Acceptance tests at feature/behavior level; unit tests at method/class level
Concordion acceptance tests verify high-level behavior from a user perspective, complementing low-level unit tests rather than replacing them.
Question 2: Why is it important to keep Concordion fixture methods free of assertion logic?
- Assertions belong in the spec; fixture methods should only compute and return values (Correct answer)
- JUnit assertions throw exceptions that break the Concordion runner
- Fixture assertions are not displayed in the HTML report
- Concordion prohibits assert statements in fixtures
Correct answer: Assertions belong in the spec; fixture methods should only compute and return values
Putting assertions in the spec rather than the fixture keeps the spec as the single source of truth for expected behavior.
Question 3: What is a good strategy for handling database setup in Concordion acceptance tests?
- Use @Before to set up known data and @After to clean it up in the fixture (Correct answer)
- Hard-code production database credentials in the spec
- Share state across all specs via a static database connection
- Allow tests to run against live production data
Correct answer: Use @Before to set up known data and @After to clean it up in the fixture
Using JUnit setup/teardown lifecycle methods in the fixture ensures each test starts with a known database state and cleans up after itself.
Question 4: How should Concordion specs handle environment-specific configuration such as base URLs?
- Read configuration from system properties or environment variables in the fixture (Correct answer)
- Hard-code configuration in the HTML spec
- Use a different spec file per environment
- Embed credentials in concordion: attributes
Correct answer: Read configuration from system properties or environment variables in the fixture
Fixture methods should read environment-specific values from system properties or environment variables, keeping specs environment-agnostic.
Question 5: What is the benefit of using Concordion's verifyRows command over multiple assertEquals calls for list verification?
- verifyRows checks the full collection in one command and handles missing/extra items (Correct answer)
- verifyRows is faster than looping assertEquals
- verifyRows does not require a fixture method
- verifyRows works only with sorted lists
Correct answer: verifyRows checks the full collection in one command and handles missing/extra items
concordion:verifyRows compares an entire collection at once, reporting missing, unexpected, and matched items clearly in the report.
Question 6: Why should Concordion acceptance tests not be used to replace exploratory or manual testing?
- Concordion only tests scenarios explicitly written in the spec, missing unknown unknowns (Correct answer)
- Concordion is too slow for regular use
- Manual tests are required by compliance standards
- Concordion cannot run against a UI
Correct answer: Concordion only tests scenarios explicitly written in the spec, missing unknown unknowns
Automated specs only verify the scenarios the team anticipated; exploratory testing discovers unexpected issues outside defined scenarios.
What is the recommended scope for Concordion acceptance tests versus unit tests?