Monday, October 10, 2016

Lone Star Ruby Conf: Zed Shaw Keynote Q&A

Odin we have questions that might be good
got some time ago questions anything mongrel
hutu gonna happen yeah and up
oh yeah okay so um
whenever you're right any kinda branching statement if case
plans loops anything like that there's always you're trying to cover all the
possible
inputs to that branch right see other if statement than
FL l7l said else if if you don't have an
else that's just there in case that else runs then it will fall through
and you might have missed something so any change up your test the changed the
code later
your its kinda go through and you have to actually go and find out where the
blow-up
really simple fixes just put a raise right in the else
when you go changer test you start adding you conditions it blows up
every if statement that you have to go threatens Derek a statement everything
like that
so if you just in any kinda branching logic you always have an else that blows
up
your code numbers dramatically that she pry the best advice I give people that
write good stable solid code
ugly and I always thought that when we just need to have there's like if
there's case
and then there's something like if only these right case
only the anything else is an air that's all
get damp test was this to
kind of concept that's come out I think from Jay fields and not much other
people
and its it came about because setup was getting too complicated
say you're reading gigantic test unit estimates because you love testing
and I call that belts and suspenders programming so your pants might fall
down
she gotta have some belts and gotta have suspenders right
you never know you passed my the belt my break any the suspenders you keep your
pants up
rent see a test living daylights out it will then get the giant tests that have
all these conditions you have to have all these different
like variables thing in so naked Co dry moving into this one set up all that you
really complicated set-ups
so we have a bug me and go back in Texas at a as a solution
is rather than go in bombay maybe breaker tests up more major redesign our
models maybe change things around so that
you know we have separate set up methods that are just call before the test that
need them
under also other strategies to fix a setup that large
the reaction was r8 to take that setup code and then every test is recreated
well that works great when you're reading the test the first time cut and
paste code at seen guys do it
when you change something the point unit test is not really improve the quality
of your system
was to keep the quality you have at a certain level as you change things
but your test a really difficult to change because they're not dry
then that defeats purpose you're investing so much effort to keep this
test suite at the mothers not even bother
that's the damp testing that's come around yep
them
min
him
yep
right and then and then when you teams the class that's under test
the whole suite blows up yet to change 50 60 70 matters
multiple places that variables mentioned it's not the solution
is not the solution did you did you see my solution
was don't make it a boolean argument right so what happens if someone says
Wow setup blows we need an testicle way and same with the damn tests
right break yes
and that people s I do this got their advice from Jay fields
so yeah I
yes im are
get are
so are as assessed it is six programming language it's like a
yep are it's a it's a program alleged
it rocks like if you want to learn a weirdo functional programming language
is really cool
are it's like magic give a data frame a time series
the table you go plot because did you want this
holy crap to supply wanted its weird Mandy and
anything else had a plot in arm and also the thing about learning
are is that the language is very simple as just a simple functional programming
language
but in order to use it right you have to learn deep statistics
so if you learn our then after about a year you know all the statistics behind
so at to be your butt I'm not that good at math
so so
outta that I have an auto test or in this case something like out a test
that runs and at logs a every compiler
and this is a C++ programs every compile error every memory error every test
error every lawyer said the program logs in error
that it had and I just calculate up the counts another 1 I'm doing is all those
things are really the errors those things are indicators and I tried to do
is try to keep those down
and so on estimating well I have worked on a server in a while but there is like
three bugs in ever know to bugs in every thousand lines of code
something like that there's wifi doesn't mind the codes is like a few bugs
Anna batton I and that's all you do but it's kinda complicated the point is the
tango in just
I'm read books on OMN statistical quality control
are some stuff from the car capability maturity models is good what's humphries
anything like that and L tape kinda the same stuff
be careful those books though cuz those books are written for guys running like
missile control systems for the Air Force
so they have you riding on hard to not really loves paper
and and people populate the cards screw that just right and
thing for a test before and after action on other tests and then
it lodges that and you're done and is really good cuz
I'm people actually tracked their stance as they cope you know me defect you have
any check code and you know any rate the bill
but how do you actually while you code as programmers keep track of your
defects
has won the right code your injecting defects
all the research says that when you do design you not checking defects
and we do testing in and checking the facts as we read code is also kinda the
achilles heels a
unit testing that's code the unit testing can have
defects like being damn so the key is a GV
you can't release its too hard to say do this do that do this there's just one
thing about
and else statement but you can for yourself analyzer quality
just build up some numbers it doesn't take anything your programmer she should
be able to click that numbers
brain and then eventually start analyzing and try to find causes for
what make sure quality go up or go down
when I was working on it you I found out that if I worked on it arm with I am on
or for more than three hours my call my quality went up
as a fan if I did a major refactoring its bite
and so then I knew I was done with refractory when the one backup
to do something simple as that would prime prove everything for a lot of
people
but it's hard it's very in all accountant
style keep checking every little bean so I only do it in spurts like when I have
inspiration is it now
when I learn a new programming language i sat down with the new partners I'm
serious about it I'll start trying to track the defect that way
any other questions
all right thank you very much
on-site one mark
one more question all hate
oh yea air so I got a project that saving the internet with a project
is on my temp to get retire see so the check it out
it's a probably not safe for work
assess her home but it's basically an encrypted did
it's actually just an encrypted messaging system I put chat up because
people don't get messaging systems but to get checked
and a system has built-in encryption built-in fully identification built-in
reputation and built-in Center pace uses said the centre pays is basically force
me to break some weak crypto
with that I give the keys applying that
Center pays to all the people on the network and a call hate
so you hate someone you pay a little bit that Center pays
and then they pay that much from then on
and as a yes now at that don't work because and on one guy seem to think
that there is
another of jerks out there on the internet to bring the entire internet
down with hate
so if that changes then it I death people can be
response was paid at least the server could defend itself because they're
Center page is built into the basin its currently up there's a c:\program
very small takes only seven eggs around has all crypto everything in it and
has it's over and see and then there's AJ Ruby
client I'm working on actually have it up over here people are interested
and that just looks like a little chat client and Mark really hard to make it
nice
and mitterrand's jammer for people to do their stuff
everything's mesmerized like a totally blew this
I do it up yeah kinda shot out
to heart yep
up Crawley I believe
so there's two gigantic books on our that one is literally
just massive I was there is a book on every language for that and any other
book
i think is by him to call the statistical computing that one would be
the intro you just get those two books he has been next two years learning
everything about statistics
and it's basically that one's an intro to every aspect of computational
statistics you can get
so just analyzing stuff arm and it's a really really good skill to have
because what you spend all day is fumbling around with logs and analysis
and quality in all sorts of crap and you don't know how to analyze it in
me a comment about to Liza Arkona paragraph now
so it's pricey at my job more than anything also programming language it's
fun
I'm okay now I'm actually
Becky %ah well
mom