Comments (4)
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.
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.
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)������������&/r33^%Bm)V�%z[N� ¢9ÝH��/·mL"
k�Q�Ca_kÛ�L�FK1#G�ö�K06 c¬�{[
����������(80 tests)����������7ö�Q�#ry1L
from gofuzz.
Great lib by the way. I'm doing all my testing with gofuzz
from gofuzz.
Related Issues (20)
- Improve quality of integer output HOT 2
- Idea: Fuzzing with only non-zero values?
- Add golint to automated tests
- comparison with go-fuzz HOT 1
- presence of an interface value always panics HOT 20
- issue building with go 1.11.3 and previous
- Is this repository still alive? HOT 1
- go mod checksum mismatch HOT 1
- Integrate with fuzzit?
- Add note to docs that private fields of structs cannot be fuzzed using this package HOT 2
- Generating blank strings even though nilChance is set to 0 HOT 2
- go-fuzz integration may give nil values despite NilChance(0) HOT 2
- New Release? HOT 2
- UnicodeRanges as shown in example cause `go vet` to fail
- Test failure on 32 bits arch
- NewFromGoFuzz doesn't work well with go-fuzz HOT 1
- Can we add support for unexported field? HOT 2
- Is / should gofuzz safe for concurrent use? HOT 2
- Tag a new release: 1.3.0
- Regarding newer versions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gofuzz.