DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Culture and Methodologies
  3. Agile
  4. CounterStrings in Action

CounterStrings in Action

Check out CounterStrings in action!

Alan Richardson user avatar by
Alan Richardson
·
Feb. 27, 19 · Tutorial
Like (1)
Save
Tweet
Share
3.69K Views

Join the DZone community and get the full member experience.

Join For Free

CounterStrings are an underused, testing technique. This is primarily because there are not a lot of tools that implement it. In this blog post, I'll explain how you can use them from within your browser and, as a bonus, using them to find a bug in GitHub.

CounterStrings

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...

counterstrings demo on github

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.

Software development agile

Published at DZone with permission of Alan Richardson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Spring Cloud: How To Deal With Microservice Configuration (Part 1)
  • Type Variance in Java and Kotlin
  • How to Develop a Portrait Retouching Function
  • What Should You Know About Graph Database’s Scalability?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: