The Palos Publishing Company

Follow Us On The X Platform @PalosPublishing
Categories We Write About

Extract time estimates from user stories

Extracting time estimates from user stories typically involves identifying and interpreting any expressions related to time, effort, or complexity. These estimates can be explicitly stated (e.g., “5 hours”, “2 days”, “3 story points”) or implied. Here’s a step-by-step approach you can follow to extract time estimates from user stories:


1. Identify Estimate Keywords

Look for common keywords and formats used in user stories, such as:

  • Time-based: hour(s), day(s), week(s)

  • Effort-based: story points, SP, t-shirt sizes (e.g., XS, S, M, L, XL)

  • Numeric formats: 2h, 3d, 5 SP, 4 hrs


2. Use Pattern Matching (Regex)

Apply regex to extract these patterns. Some examples:

regex
bd+(.d+)?s*(hours?|hrs?|h|days?|d|weeks?|w|SP|storys?points?)b b(XS|S|M|L|XL|XXL)b

3. Parse the User Story

For example:

User Story:
“As a user, I want to reset my password so that I can regain access to my account. (Estimate: 2 SP)”

Extracted Estimate: 2 SP


4. Convert to a Uniform Format (Optional)

To compare or aggregate estimates, you might normalize:

  • 1 SP = ~4 hours (or any internal metric)

  • XS = 1 SP, S = 2 SP, etc.


5. Handle Stories Without Estimates

If a story lacks an estimate:

  • Flag it for review

  • Optionally apply historical average estimates from similar stories


Example Workflow in Pseudocode

python
import re def extract_estimates(text): pattern = r'bd+(.d+)?s*(hours?|hrs?|h|days?|d|weeks?|w|SP|storys?points?)b|b(XS|S|M|L|XL|XXL)b' return re.findall(pattern, text)

Example Outputs

User StoryExtracted Estimate
“Implement login feature (Estimate: 3 SP)”3 SP
“Fix password reset bug – should take 2 hours max.”2 hours
“Add dark mode (L)”L
“Set up CI/CD pipeline”None found

Tools That Support Extraction

You can automate this process using:

  • Jira REST API (if your stories are in Jira)

  • Natural Language Processing (NLP) tools

  • Excel with formulas/macros

  • Custom Python scripts with re and pandas


Final Tip

For consistent and accurate estimates, teams should use a standardized format for expressing estimates within user stories or as metadata (e.g., labels or custom fields).

Share this Page your favorite way: Click any app below to share.

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Categories We Write About