Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghostwrite for many more names #3313

Merged
merged 3 commits into from
Apr 30, 2022

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Apr 28, 2022

Closes #3311, which lists the tables that I worked off to write this function. We now guess strategies for 16,758,972 (8.43%) of 198,892,807 total arguments - excluding the staggeringly common (96,322,728) self argument which Hypothesis should never need to generate.

I actually feel pretty good about this: almost nine percent of all arguments is a pretty big win, and I think that the table below shows these are "reasonable guesses" that users will understand, even if they're not correct in all cases.

Table of all most-common arguments, with guessed strategy (if any)
Name Count Percentage Strategy
kwargs 4,664,756 2.345%
x 4,596,739 2.311%
args 4,563,483 2.294%
request 3,151,117 1.584%
name 2,926,485 1.471% text()
value 2,223,895 1.118%
data 2,050,786 1.031%
cls 2,029,481 1.020%
context 1,286,368 0.647%
y 1,278,266 0.643%
path 1,207,603 0.607%
n 1,006,548 0.506%
key 1,003,916 0.505%
a 929,057 0.467%
event 912,238 0.459%
filename 908,079 0.457%
s 895,788 0.450%
other 895,318 0.450%
text 741,960 0.373% text()
url 733,713 0.369%
obj 717,788 0.361%
message 678,857 0.341%
b 677,090 0.340%
node 675,795 0.340%
ctx 675,146 0.339%
id 663,252 0.333%
params 598,919 0.301%
model 578,324 0.291%
item 564,599 0.284%
config 563,671 0.283%
i 558,044 0.281%
t 549,195 0.276%
parent 543,882 0.273%
user 541,838 0.272%
index 539,693 0.271%
v 527,525 0.265%
p 520,962 0.262%
msg 513,047 0.258%
state 477,787 0.240%
X 446,851 0.225%
target 431,930 0.217%
f 431,350 0.217% functions()
k 424,984 0.214%
size 418,743 0.211% integers(min_value=0)
c 413,990 0.208%
client 408,645 0.205%
val 397,115 0.200%
title 350,064 0.176%
m 349,529 0.176%
d 348,631 0.175%
options 344,892 0.173%
response 344,852 0.173%
func 344,795 0.173% functions()
password 332,927 0.167% text()
username 329,775 0.166% text()
mode 325,912 0.164%
image 315,071 0.158%
r 310,998 0.156%
instance 305,727 0.154%
session 302,511 0.152%
df 297,263 0.149%
root 294,788 0.148%
start 294,355 0.148%
timeout 282,259 0.142%
method 280,268 0.141%
line 280,258 0.141%
e 277,550 0.140%
_ 276,692 0.139%
batch_size 275,802 0.139% integers(min_value=0)
input 270,071 0.136%
inputs 269,314 0.135%
img 268,473 0.135%
type 265,529 0.134%
app 264,066 0.133%
kw 257,981 0.130%
action 255,301 0.128%
port 254,866 0.128% integers(0, 65535)
file 253,914 0.128%
row 251,358 0.126%
verbose 250,846 0.126% booleans()
width 245,455 0.123% integers(min_value=0)
string 243,400 0.122% text()
num 240,966 0.121% integers() | floats()
color 239,292 0.120%
source 237,002 0.119%
result 236,537 0.119%
label 236,211 0.119% text()
host 233,390 0.117% domains()
user_id 230,365 0.116%
env 227,374 0.114%
values 226,652 0.114%
query 218,205 0.110%
parser 213,738 0.107%
z 210,613 0.106%
token 210,299 0.106%
level 208,098 0.105%
height 206,760 0.104%
w 204,716 0.103%
pos 204,611 0.103%
uid 203,809 0.102%
labels 201,099 0.101% lists(text())
arg 200,388 0.101%
l 200,024 0.101%

@Zac-HD Zac-HD requested review from rsokl and sobolevn April 28, 2022 06:49
@Zac-HD Zac-HD force-pushed the ghostwrite-more-arguments branch 2 times, most recently from e34b9db to bdd34a4 Compare April 30, 2022 00:25
Exception chaining is great, and "which error was flaky again?" is a perfect use case.
@Zac-HD Zac-HD merged commit 8e5140b into HypothesisWorks:master Apr 30, 2022
@Zac-HD Zac-HD deleted the ghostwrite-more-arguments branch April 30, 2022 04:55
@Zac-HD Zac-HD mentioned this pull request Mar 5, 2023
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ghostwriter: analysis of common argument names and type annotations
1 participant