1 / 24

BETTER SpecFlow tests

BETTER SpecFlow tests. Tim Brown SENIOR DEV AT MEDISOFT Codebuckets.com. What are SPECFLOW TESTS. Tests written in natural language. Implemented in C#. Transformed into Unit tests. Run as Unit Tests. We Want to Avoid this. TIP 1: ONLY RUN THE most important. Run on command line.

coralie
Download Presentation

BETTER SpecFlow tests

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BETTER SpecFlow tests Tim Brown SENIOR DEV AT MEDISOFT Codebuckets.com

  2. What are SPECFLOW TESTS Tests written in natural language

  3. Implemented in C#

  4. Transformed into Unit tests

  5. Run as Unit Tests

  6. We Want to Avoid this

  7. TIP 1: ONLY RUN THE most important

  8. Run on command line Run with ALM tool of choice

  9. TIP 2: STRESS TEST • 200 tests and each one fails 1% of the time - full pass 13% • Big set but 20 of these are flaky and fail 10% - at least one of these will fail 88% of the time. • FULLY PASSING TEST SUITE ONCE A FORTNIGHT

  10. Scenario NUnit Test

  11. Stress Test

  12. TIP 3: Use FUZZY STRING MATCHING The C# step is

  13. Using a fuzzy match library e.g. DuoVia.FuzzyStrings  https://www.nuget.org/packages/DuoVia.FuzzyStrings/ Not going to fail for minor text changes

  14. Tip 4: Improve Logging

  15. Tip 5: Write fewer specflow tests

  16. 7 HABITS OF EFFECTIVE SPECFLOW WRITERS • TIP 1: Only run the most important tests • TIP 2: Stress test • TIP 3: Use fuzzy string matching • TIP 4: Improve logging • TIP 5: Write fewer specflow tests • TIP 6: Get them working in all languages • TIP 7: Get someone else to specify the tests

  17. Online • CodeBuckets.com • http://codebuckets.com/2016/12/01/5-ways-to-write-more-robust-specflow-tests/

More Related