TL;DR
There's no single formula for determining how many tests a set of specifications will require. However, you can estimate level-of-effort and set quality targets based on your test plans, provided the people making the estimates are the ones who will be doing the actual work.
The Testing Pyramid and Its Effects on the "Iron Triangle"
There is no universal formula for how many tests you need for each specification. That will vary based on the product, the frameworks that you're using, the complexity of the specifications, and the criticality of each unit of functionality. However, you can get reasonable estimates by asking the actual task performers (e.g. the developers and testers who will be doing the work) to estimate the amount of testing they anticipate for each block of work on the project plan.
In general, you should expect that an agile shop will have many unit tests, and very few manual tests. For example:
Sliders and Trade-Offs
There are many variations of the testing pyramid, and the details of what belongs in each layer can vary based on your product, industry, and process. However, experienced developers and testers who are invited to collaborate with you on the planning and estimation of the project can often provide reasonably-accurate estimates regarding the level of effort involved for each phase or component of testing, and help you make the necessary trade-offs between:
- percentage of test coverage
- speed of test development
- speed of test execution
- speed of development
- speed of regression testing
- speed of defect reproduction/isolation
These factors, which are often complementary or opposing sliders, will impact your project's costs, schedule, and quality. It will also have a major impact on your technical debt and defect rates, depending on what the team and organization agree to.
Incorporate Test Metrics into the Definition of Done
Your Definition of Done should always include agreed-upon targets for test coverage. The rest of the testing details are likely to be more of a negotiation and a set of guidelines than a fixed percentage.
See Also