Coder Social home page Coder Social logo

Improve quality of string output about gofuzz HOT 4 OPEN

google avatar google commented on September 27, 2024
Improve quality of string output

from gofuzz.

Comments (4)

lavalamp avatar lavalamp commented on September 27, 2024

I think making the chance of getting an empty string configurable is desirable.

The character distribution is tricky; ideally we'd want to test characters of all UTF-8 encoding forms; that's why it is how it is. I agree spaces would be desirable.

As far as duplicates-- right now there's just a small chance (5% IIRC) of it outputting a blank string. That's on purpose, since presumably there's a lot of different places to store these strings, and we eventually want to try a blank in all of them.

from gofuzz.

Fresheyeball avatar Fresheyeball commented on September 27, 2024

I agree the distribution is tricky, all UTF-8 is desirable. I just think it can be done much better, perhaps interleaving different sources for randomness. Using a wikipedia article as a source, as well as other texts in addition to pure UTF8 could be useful. I've outputted strings from QuickCheck and generally had more desirable results. Perhaps something in there can lead the way.

As for blank strings and dealing with duplicates. I think ideally each instance of fuzz should maintain internal state to prevent duplicates. This way the odds of encountering an empty sting can be 100% or 0% while ensuring that it does not appear more than once (running the same input more than once is a wasted test).

Just brainstorming, I think it would be desirable to configure the presence of empty stings (I generally like them), but also the guaranteed presence of special strings like \n. I'd sleep better knowing that those are always present in the input of tests.

More variance on string length as well would be appreciated.

from gofuzz.

Fresheyeball avatar Fresheyeball commented on September 27, 2024

I ran a sample from QuickCheck if you are interested:

����������(50 tests)����������}�{O"(�
����������(51 tests)����������OLÍ�F�fÅpù�KÏG'e}j
v^ ésÈ.Rfp(Ì��ð��P�L@�dRj
����������(52 tests)����������L�bdXC�(rüLgY�;9A�aPáb%o×�
����������(53 tests)������������a
����������(54 tests)����������4åÕ�[7jT��ç|¶od
[y  �"�~2�ý�"1w��ÄA
����������(55 tests)����������PE¢�Øf[�_���
����������(56 tests)����������a��<s\#6��4\.·/H.Pbw�u0
����������(57 tests)����������ñºKi�F94¿�\��1$­
����������(58 tests)�����������93�\ Ææ�=R×�ò!g�Öt��Ï
����������(59 tests)����������]-'5�Q@kúH�M�%óRz=MM/�¹¾ì�qv��<Þ��$:ñ-�îR�7NUL=/
����������(60 tests)����������>%f~A~�%8IE�å�~!2#�LJiðhî÷�¢B¯Æ�q��RZfb��=3c~4óuÄ>¹3�
����������(61 tests)����������O�GÀX�
����������(62 tests)����������7_��wu pÙNçÁ;@R
����������(63 tests)����������So¿D1;YÕC8�N�ggu�Llpz!�é=�g%þ�
����������(64 tests)����������+
����������(65 tests)����������­f+ôO�%¼�_7Æ×w!
����������(66 tests)����������Â�¶a
l�à
����������(67 tests)����������LAÞxbj�L�*^GcG#_oV�~¯I�"�1y¢��DÆ3
�Z2£2b��`Wp7JX{�µ
����������(68 tests)����������^Ñ95���ü
C��ûß���ñ+�½¡¬)�::qüó�Ü'$ 3IÎ]0nRÎDO
����������(69 tests)����������i'�LAÓ¡s§kÔ)p�þ�zIÁwvT�X
����������(70 tests)�����������
����������(71 tests)����������~��s% ã�(�m7&,_f�g÷
0f7"MNX3JFýÇS/���':'�%��òåG[�¾��
����������(72 tests)�����������mà�£Ø#3�Ú6á :Ùk�Zzj\$��B
P�·T,�F
����������(73 tests)����������R��¥�?ww�Z�ã
����������(74 tests)����������4âWÊd¯)îEB�ß�Z�6Ú�]1ß��<Oy�¨Ã�1.�-�åp�Á\¾·Ub3�g��¨
����������(75 tests)�����������iS8
�'<£u^
�IKA�&¹Q(N³�5�A×û÷A4Wj/Fz6
����������(76 tests)�����������S��â"AtÀ�s6���Zj���Ò!1�ùæû�&BK=#b«Úû[DìØ!
����������(77 tests)����������  C¯Y·��üè�;�ä�
����������(78 tests)����������Äa>{P��h.3$¤�ñbrgr.y�
gk9�9�\H�ÑQ�%r�(&,ò
G�ngä7fó
����������(79 tests)������������&/r33^%Bm)V�%z[N� ¢9ÝH��/·mL"
k�Q�Ca_kÛ�L�FK1#G�ö�K06 c¬�{[
����������(80 tests)����������7ö�Q�#ry1L

from gofuzz.

Fresheyeball avatar Fresheyeball commented on September 27, 2024

Great lib by the way. I'm doing all my testing with gofuzz

from gofuzz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.