CounterStrings in Action
Check out CounterStrings in action!
Join the DZone community and get the full member experience.
Join For FreeCounterStrings
If you want to learn more about CounterStrings, then check out the following resources:
- CounterString algorithms
- James Bach’s original writing and work on CounterStrings at satisfice.com
- I wrote a Chrome Extension here
- And, I implemented it in my Test Tools Hub
A CounterString is a string like this *3*5*7*9*12*15*
where the *
represents the position in the string of the number immediately proceeding it. This is a 15-character CounterString.
Using CounterStrings
James Bach’s PerlClip is a simple executable that you run and it copies a CounterString into your clipboard for copy and pasting into a field.
For my Chrome Extension, you right click on a field in a web page and it inserts the CounterString into the field and outputs it to the dev tools console for later copy and pasting.
CounterStrings are useful because if you paste it into a field and it is truncated, you can work out the length. And if you are trying to binary chop to find a length of a validation string, then CounterStrings can prove useful.
GitHub
When I was creating a demo video for CounterString extension, I tried it on GitHub.
- I created a 100-character CounterString
- Added it to the GitHub search field
- Performed the search
- And, GitHub said it would only search for 128 characters
But I only entered 100 characters...
I then used the CounterString functionality to generate other CounterStrings, which helped me discover that when GitHub says “128 characters,” it actually means “95 characters.”
This is a really good example of the type of bugs that CounterStrings can help you find and how you can use them to help you create different string lengths and identify the real validation length to support you when raising defects.
Video
This article was syndicated from blog.eviltester.com. Author Alan Richardson is an Agile Software Development and Testing Consultant he has written 4+ books including Dear Evil Tester, Automating and Testing a REST API, Java For Testers. He has created 6+ online training courses covering Technical Web Testing, Selenium WebDriver and other topics. He is a prolific content creator on his blog, Youtube and Patreon.
Published at DZone with permission of Alan Richardson, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments