Gabriel Ideas Written by Gabriel

When to Write Test Cases in Agile

By Gabriel Aug 06, 2026
How to write a test case
How to write a test case

In the dynamic world of Agile development, the question of when to write test cases often arises. This method brings flexibility and adaptability to the development process, but it also demands a well-planned testing strategy. In this article, we'll explore the ideal timing for composing test cases in an Agile environment.

How to write a test case
How to write a test case

Before diving into the specifics, let's clarify that testing is not an afterthought in Agile. It's integrated into each development cycle, known as a sprint. Now, let's delve into the optimal timing for writing test cases in Agile.

What is a Test Case? Test Case Examples | ArtOfTesting
What is a Test Case? Test Case Examples | ArtOfTesting

Writing Test Cases During Sprint Planning

Sprint planning is the phase where the team selects what to do in the upcoming sprint. This is an opportune moment to identify what needs to be tested and write initial test cases.

One-Page Agile Test Strategy For Software Project Template
One-Page Agile Test Strategy For Software Project Template

At this stage, test cases should be high-level and focus on the main functionality of the upcoming sprint's user stories. This helps in ensuring that the development process aligns with the testing strategy from the get-go.

Eliciting Test Cases from User Stories

the agile testing process is shown in purple and white, with an arrow pointing to it
the agile testing process is shown in purple and white, with an arrow pointing to it

User stories provide valuable insights for test cases. By analyzing user stories, testers can derive acceptance criteria, which form the basis of test cases. This converts user expectations into testable conditions.

For instance, a user story like "As a customer, I want to view my order history so that I can track my purchases" can translate into a test case like "Verify that all past orders are displayed in the 'Order History' section".

Writing Preliminary Test Cases

How To Write TEST CASES In Manual Testing | Software Testing
How To Write TEST CASES In Manual Testing | Software Testing

The test team may start drafting preliminary test cases during sprint planning. These cases should cover the happy path and main functionalities but can be refined later as more details emerge during sprint development.

These initial test cases serve as a starting point and help the development team understand what needs to be tested. They're not set in stone and will likely evolve throughout the sprint.

Writing and Refining Test Cases During Sprint Development

Better Quality Software with Agile testing in 2026 | Net Solutions
Better Quality Software with Agile testing in 2026 | Net Solutions

Once the sprint begins, test cases should be written, refined, and refined again as more details about the implementation emerge.

The Agile testing approach encourages continuous testing, known as test-driven development (TDD) and behavior-driven development (BDD). In these approaches, test cases are written before the code, promoting better understanding of the requirement and more effective testing.

Mastering Test Case Management in Agile: 10 Proven Tips
Mastering Test Case Management in Agile: 10 Proven Tips
Experiment Design Framework for A/B Testing
Experiment Design Framework for A/B Testing
How to Write Test Cases with Examples
How to Write Test Cases with Examples
Test Cases - High Level vs Low level Test Cases | EuroSTAR Huddle
Test Cases - High Level vs Low level Test Cases | EuroSTAR Huddle
The Test Framework I Want to Build: Fewer Lines, Fewer Seconds
The Test Framework I Want to Build: Fewer Lines, Fewer Seconds

Breaking Down Test Cases

As the sprint progresses, developers start working on individual tasks. This is when test cases can be broken down into smaller, more specific parts. This approach aids in understanding and testing complex features more efficiently.

For example, the test case "Verify the user can log in with valid credentials" can be broken down into "Verify the system accepts a valid username" and "Verify the system accepts a valid password".

Keeping Test Cases Up-to-Date

Throughout the sprint, it's crucial to keep test cases up-to-date. As the development team adds new features or makes changes to existing ones, test cases should reflect these changes.

Regularly reviewing and updating test cases ensures they remain relevant and effective. This can be done in collaboration with the developers, fostering a shared understanding of what needs to be tested.

Writing Test Cases During Sprint Review/Demo

The sprint review or demo is the final check before the product increment is delivered. This is a opportunity to finalize test cases, ensuring they cover all aspects of the new functionality.

During this phase, the team can also identify any gaps in testing and plan how to address them in future sprints.

Finalizing Test Cases

In this phase, test cases should be finalized, with clear steps, expected results, and any prerequisites or post-conditions clearly stated. They should be ready for execution.

For instance, a finalized test case might look like this: "TC001: Verify user login - Steps: 1. Open browser, 2. Navigate to login page, 3. Enter valid username and password, 4. Click 'Login'. Expected Result: The user should be directed to the dashboard".

Identifying Retrospect Test Cases

While finalizing test cases, it's also a good time to identify any retrospective test cases - test cases that cover improvements or changes from previous sprints. These can be written and added to the test suite for the next sprint.

For example, "TC002: Verify the user cannot login with an invalid password". This test case should be added to the test suite if password validation was improved in a previous sprint.

In the dynamic realm of Agile, writing test cases is an ongoing process that should take place throughout each sprint. It's about engaging in continuous improvement, refining test cases as new information becomes available, and always being prepared for the next sprint. By keeping this approach, you'll ensure your testing strategy is in sync with your Agile methodology, delivering high-quality software consistently.