After reading chapter 4 and 5 from Introduction to Software Testing, we were asked to answer these questions about TDD and test coverage criteria:
- What is “correctness” in agile processes?
Correctness for testing and software engineers has to do with the quantity of green tests, this means that our code is correct if it passes all the tests.
- Do TDD tests do a good job testing the software?
No, TDD tests are mainly to define the requirements and specifications of our code, but not really to evaluate the right behavior or to cover edge cases.
- Can we automate our tests without TDD?
Yes, automation can be done in test without following the TDD principles. Imagine writing first the code, then just executing the tests to validate it.
- Can we use TDD without automating our tests?
Yes, TDD consists on putting the tests first as a guide for the code to be written, automation can help to write tests and validate faster, but is not mandatory.
- What four structures do we use for test criteria?
1.- Test Requirement: A test requirement is a specific element of a software artifact that a test case must satisfy or cover.
2.- Coverage Criterion: A coverage criterion is a rule or a collection of rules that impose test requirements on a test set.
3.- Minimal Test Set: Test set T such that if a test was removed from T, it no longer satisfies all test requirements.
4.- Minimum Test Set: Smallest possible test set T that satisfies all test requirements.
- What usually prevents our tests from achieving 100% coverage?
- Some organizations in industry who adopt TDD report that it succeeds very well, and others report that it fails. Based on your knowledge of TDD and any experience you have, why do you think it succeeds sometimes but not all?
Companies does not use TDD well, that’s why they don’t succeed using it. It is hard for some engineers to follow TDD principles, some of us are not used to write the tests first before the code.
- A few software organizations use test criteria and report great success. However, most organizations do not currently use test criteria. Based on your knowledge and experience, why do you think test criteria are not used more?
We think that test criteria is very ambiguous, as we don’t have an exact default way of measuring test criteria, everyone does it differently. Maybe having a high test coverage is expensive and most of the times is not worth it, that’s why most companies decide to not focus on having heavy testing development.