5

I went looking on the Google for a simple JavaScript object or other bit of JS code that can deliver a list of strings that are interesting for testing. I thought there would be a billion hits, but I couldn't find one. If I'm just doing my search wrong, please give me the link(s) as an answer. If I don't get a good answer, I'll turn this question into a community wiki page and we can construct one together.

By 'interesting', I mean the list contains strings known to cause problems; things like the empty string, a string with unicode characters, a string with closing delimiters of various kinds - like quotes, close-braces, greater-than, etc. I understand that an exact and comprehensive list would depend on the specific code under test - I just want a general set of good ones to get started with.

2
  • Hey Bruce! I don't know of any either, and couldn't find any with a quick search. I wonder if there is just a list of interesting test strings agnostic of platform or language? Or maybe a fuzzing tool that generates all of the interesting strings plus some randomly generated ones using certain criteria?
    – Sam Woods
    Dec 2, 2011 at 19:52
  • I certainly would have guessed that all those things are out there, but a while spent fruitlessly searching Google and StackOverflow seems to say they are not.
    – Bruce
    Dec 2, 2011 at 22:11

2 Answers 2

2

Does it have to be a JavaScript object?

Do these help? http://www.allthingsquality.com/2010/04/some-strings-for-pasting.html http://www.allthingsquality.com/2010/04/general-input-tests-for-time-fields.html http://www.allthingsquality.com/2010/04/general-input-tests-for-listbox-fields.html http://www.allthingsquality.com/2010/04/general-input-tests-for-radiobutton.html http://www.allthingsquality.com/2010/04/general-input-tests-for-checkbox-fields.html http://www.allthingsquality.com/2010/04/general-input-tests-for-date-fields.html http://www.allthingsquality.com/2010/04/general-input-tests-for-strings.html http://www.allthingsquality.com/2010/04/general-input-tests-for-integer-field_19.html http://www.allthingsquality.com/2010/04/general-input-tests-for-integer-field.html

1
  • The tests-for-strings.html one looks pretty good, thanks. I asked for a JavaScript object because I was hoping for something pretty plug-and-play, to save myself some typing.
    – Bruce
    Dec 8, 2011 at 19:47
0

I've used this previously http://www.random.org/strings/?mode=advanced although its lacking the more frequently erroneous values, maybe we could build something similiar though ?

it does have the option of getting them back in plain text or formatted which is handy :)

2
  • Given enough volume, random is probably better than just guessing, but I'd still like to have some list of "known problematic" strings. The character set offered on that page also seems quite limited: no unicode, no punctuation.
    – Bruce
    Dec 2, 2011 at 22:17
  • I did say its lacking some of the potentially more problematic strings, though it really depends on how you are partitioning the input domain for testing. It would be easy enough to write something similar that added more characters, although if you just wanted a list then a user contributed dictionary would be better as people could contribute towards it.
    – Luke
    Dec 2, 2011 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.