|
crazypenguin posted:quickcheck doesn't help with the DI part of it, but you can still quickcheck IO/stateful stuff like mad, it just takes a bit more work. You have to build a simple little state machine simulator, and randomly generate a list of actions to perform, and then verify the simulator and the real thing give the same results at every step. Possibly also checking invariants on the real thing at each step. It's pretty awesome actually. Yeah, I'm aware of that presentation and saw it a few times. The demo was with DETS, a disk version of some in-memory database that ships with Erlang. It's pretty subpar quality and routinely corrupts files for me, and still can't store more than 2GB of data. It's a dinosaur that needs to go. I do a decent amount of quickcheck testing whenever I'm able to figure out some system property or can use an alternative implementation as a model somewhere else. The other extremely difficult stuff with quickcheck is to have the proper generator distribution for what you require. If for example what you figure out you error out on is that you implemented UCS-16 instead of UTF-16, you won't find out about it until you generate a valid surrogate pair that UCS won't support but UTF will ask you to. Unless you generate that proper sequence, your test case might be verifying the wrong thing. An example I gave when I used to give some Quickcheck training for Erlang Solutions Ltd. was to test a serializing/deserializing function that be similar to one of the early formats of socket.io's scheme. Basically, I'd give you one string in, and I'd ask you to check that the parser for deserialization worked as well as the encoder. The starting trick was simple: The implementation I gave was the identity function so encoding = decoding, and when people inevitably wrote the property 'X = decode(encode(X))', it would always pass despite being useless. Once people had found that bug, they had to come with alternative implementations. The particularly tricky one was that I had encoded a bug in there in which the parser didn't support escaping escape sequences (i.e. "\"" is a valid string, but "\\\"" was undefined behaviour that would generally fail the entire sequence). When people would serialize data or generate random strings according to the string type, and given this was Unicode, there was roughly 2N/110,000 chances of seeing either " or \ in the string, and the chances of seeing both together were extremely minimal (that's not entirely true because quickcheck grows its random set from smaller to bigger values, and " and \ are lower in the unicode standard than most characters, so the probability was likely higher). That's where I tend to have problems with a lot of quickcheck tests. It's easy to put up a bad general series of test cases up. It's really really hard to set things up so you have a valid set of tests that will generate relevant risky input on your behalf. It's even harder to test things right when you want to generate a specific result of a state machine or precise process: "generate valid JSON" or "generate valid HTTP requests" is often as hard as generating a proper parser in the first place. At best your property-based test is likely to check that your generator and your parser are broken in the same way for such cases, unless you decide to depend on a third party to work. They're really really nifty tests, but I find them far more useful for data structures and specifically well-defined algorithm with known properties than anything else.
|
# ? Jan 19, 2015 19:21 |
|
|
# ? May 24, 2024 11:50 |
|
kalstrams posted:is dvorak/colemak something to look into or not I changed to Dvorak well before I was doing paid development work, or just needing to be productive in general. I mean, It didn't take too long to speed up, but it's a pretty drastic change and it will hurt your productivity badly while you're making it. I like the layout, but yeah, big outlay. All that said, I'm a wierdo who is using Dvorak, a trackball, vim, and terminal for everything.
|
# ? Jan 19, 2015 20:50 |
|
Maluco Marinero posted:I changed to Dvorak well before I was doing paid development work, or just needing to be productive in general. I mean, It didn't take too long to speed up, but it's a pretty drastic change and it will hurt your productivity badly while you're making it. I like the layout, but yeah, big outlay. if young: gauged ears? if old: long grey hair?
|
# ? Jan 19, 2015 20:59 |
|
gonadic io posted:if young: gauged ears? if old: long grey hair? What are gauged ears?
|
# ? Jan 19, 2015 21:01 |
|
Maluco Marinero posted:What are gauged ears? old man spotted
|
# ? Jan 19, 2015 21:05 |
|
I may be due for my mid life crisis but I'm not even 30.
|
# ? Jan 19, 2015 21:09 |
|
"gauged" lmao
|
# ? Jan 19, 2015 21:21 |
|
the command line... so quirky
|
# ? Jan 19, 2015 21:22 |
|
Maluco Marinero posted:All that said, I'm a wierdo who is using Dvorak, a trackball, vim, and terminal for everything. in yospos that is not even close to weird
|
# ? Jan 19, 2015 23:45 |
|
eschaton posted:I'm actually on that list (not forum) and it has not just CVS but RCS/SCCS adherents and ClearCase (or was it PVCS?) advocates rcs, i get. people like simple but cvs? no. nobody defends cvs. ever.
|
# ? Jan 19, 2015 23:46 |
|
Stringent posted:i wonder if there's some other forum where some dude 10 years older than rotor is vociferously defending cvs eschaton is making it up, nobody defends cvs svn doesn't add very much. it's just cvs done right. and it came with a tool to migrate your cvs poo poo. it's cvs without the bugs and the pain and the misery
|
# ? Jan 19, 2015 23:46 |
|
eschaton posted:I'm actually on that list (not forum) and it has not just CVS but RCS/SCCS adherents and ClearCase (or was it PVCS?) advocates just do pair programming and share computers instead
|
# ? Jan 19, 2015 23:57 |
|
rrrrrrrrrrrt posted:inheritance is bad. just use mixins i need giant posters that say "premature optimization is bad" and "composition is ok!"
|
# ? Jan 20, 2015 02:11 |
|
Notorious b.s.d. posted:eschaton is making it up, nobody defends cvs i refuse to believe that any software that has ever been used by more than three people doesn't currently have partisans arguing its supremacy, on the internet, right now
|
# ? Jan 20, 2015 02:32 |
|
Stringent posted:i wonder if there's some other forum where some dude 10 years older than rotor is vociferously defending cvs I'm sure my former co worker is posting somewhere
|
# ? Jan 20, 2015 03:05 |
|
rename thread to "perverted ways to use outdated source control"
|
# ? Jan 20, 2015 06:03 |
|
Bloody posted:three is the first odd prime number, so that's nifty. I still count 1 as prime. If it was good enough for Hardy, it's good enough for you animals.
|
# ? Jan 20, 2015 06:36 |
|
rotor posted:I still count 1 as prime. If it was good enough for Hardy, it's good enough for you animals. good enough for olliver hardy
|
# ? Jan 20, 2015 06:42 |
|
fritz posted:good enough for olliver hardy look at this pleb who doesn't know Hardy or his works
|
# ? Jan 20, 2015 06:44 |
|
rotor posted:look at this pleb who doesn't know Hardy or his works he should have apologized for his apology
|
# ? Jan 20, 2015 07:00 |
|
rotor wants everyone to know his hardy works
|
# ? Jan 20, 2015 07:11 |
|
Flat Daddy posted:rotor wants everyone to know his hardy works in what weird country is that slang and what is it slang for
|
# ? Jan 20, 2015 07:25 |
|
only hardy rotor knows about is hardee's
|
# ? Jan 20, 2015 08:21 |
rotor posted:in what weird country is that slang and what is it slang for cell phones by europe e: actually i think im thinking of a handy
|
|
# ? Jan 20, 2015 09:22 |
|
rotor posted:I still count 1 as prime. If it was good enough for Hardy, it's good enough for you animals. If 1 is prime, then pretty much every time you say "for all primes" you now need to say "for all primes except for 1".
|
# ? Jan 20, 2015 10:03 |
|
gonadic io posted:If 1 is prime, then pretty much every time you say "for all primes" you now need to say "for all primes except for 1". which 1?
|
# ? Jan 20, 2015 11:07 |
|
PokeJoe posted:cell phones by europe european is a language? thats new
|
# ? Jan 20, 2015 12:18 |
|
C terrible programmer s: implementing a ruby dsl
|
# ? Jan 20, 2015 14:06 |
|
gonadic io posted:If 1 is prime, then pretty much every time you say "for all primes" you now need to say "for all primes except for 1". this
|
# ? Jan 20, 2015 14:31 |
|
MALE SHOEGAZE posted:C terrible programmer s: implementing a ruby dsl but enough about the color of your lipstick
|
# ? Jan 20, 2015 14:51 |
|
MononcQc posted:Then number kinds like 'primes' (by the usual definition), 'squares' and 'Fibonacci' kind of don't belong in the exercise anymore in the first place you don't know how to have fun I just wanted someone to suggest initializing the largest variable to -inf or something.
|
# ? Jan 20, 2015 15:11 |
|
code:
quote:Will work for all 32-bit integers, let me know when you need 64-bit capability
|
# ? Jan 20, 2015 15:20 |
|
idk what this thread is for but i write puppet modules and bad python so i assume i belong here
|
# ? Jan 20, 2015 15:26 |
|
Symbolic Butt posted:you don't know how to have fun Put in an assertion that the values need to be positive then walk away for the day
|
# ? Jan 20, 2015 16:24 |
|
code:
|
# ? Jan 20, 2015 18:23 |
|
never posted itt but I don't "get" javascript I still do everything server side. why should I use a dumb and bad client side scripting language where I have to write a mile long line of code to write some freaking html
|
# ? Jan 20, 2015 19:45 |
|
Ludwig van Halen posted:never posted itt but I don't "get" javascript you get to offload all the processing work to the clients, and gently caress up their computers instead of your nice servers
|
# ? Jan 20, 2015 19:50 |
|
Ludwig van Halen posted:dumb and bad client side scripting language hold up a minute there buddy
|
# ? Jan 20, 2015 19:55 |
|
true story, I work for a newspaper and I Adblock our paywalls because javascript lol
|
# ? Jan 20, 2015 20:01 |
|
|
# ? May 24, 2024 11:50 |
|
Ludwig van Halen posted:never posted itt but I don't "get" javascript not that I disagree with the idea that all webpages should be static, server generated html but yeah it sounds like you don't get JS at all. like, do you think pages should have no scripting at all ever?
|
# ? Jan 20, 2015 20:01 |