Details
Description
With a large project where there can be 600 candidate steps, the ByLevenshteinDistance PrioritisingStrategy is very slow, can take 4 seconds to complete the step collection.
The ByPriorityField is much faster, but is not a practical solution for this size project, as it would be difficult to manage the priority on this number of steps.
So need a more efficient step collection strategy.
Activity
Mauro Talevi
made changes -
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 3.9.2 [ 20180 ] |
Mauro Talevi
made changes -
Summary | Step collection is not effecient | Provide more efficient step collection for large projects |
Mauro Talevi
made changes -
Fix Version/s | 3.9.2 [ 20180 ] | |
Fix Version/s | 3.9.3 [ 20321 ] |
Mauro Talevi
made changes -
Fix Version/s | 3.9.3 [ 20321 ] | |
Fix Version/s | 4.0 [ 18486 ] |
It was mentioned in http://jira.codehaus.org/browse/JBEHAVE-216 that
This is good solution and by no means a hack.
Ordering of candidates
Given the following candidate steps:
Remove the parameters, to be left with:
And the stepAsText is:
This step could match both candidates, so the ordering is important. If ordering longest candidates first, this will always try to match the most specific patterns first. This approach will be completely deterministic, and eliminate the need for prioritising steps manually.
Filtering of candidates
Given the stepAsText is:
Then since the stepAsText.length() is less than the length of candidate 2 (after removal of parameters), its impossible for the stepAsText to match that candidate.
If the stepAsText is:
Then since the stepAsText.length() is greater than the length of both candidates (after removal of parameters), its possible for the stepAsText to match either candidate.
So its possible to immediately eliminate candidates that are longer than the stepAsText.
Therefore, filtering based on stepAsText length can also be used to improve the efficiency of step collection.