Computerphile - 2017-01-18
The original version of text messaging had a flaw, but how can we investigate problems with software quickly and easily? Professor John Hughes shows us how a modern tool can automate the process of code checking. http://www.facebook.com/computerphile https://twitter.com/computer_phile This video was filmed and edited by Sean Riley. Computer Science at the University of Nottingham: http://bit.ly/nottscomputer Computerphile is a sister project to Brady Haran's Numberphile. More at http://www.bradyharan.com
I'm currently studying my final year of Computer Engineering at the Chalmers University of Technology in Sweden. I remember the first course I ever took was Functional Programming in Haskell with this awesome guy, John Hughes! Not only did he help invent the language Haskell but he is also the best teacher I've ever had and I got the pleasure learning and properly testing functional programming code with QuickCheck (demonstrated in the video) which he developed together with another guy!
I really enjoyed watching this clip as it brings back a lot of memories!
I wish him nothing but the best!
But, but, my null terminated character arrays... 😓
an Editor for Middle-Aged Computer Scientists indeed
This is great! Can we have more videos on functional programming and testing?
I would like one on unit testing. I've been programming for three years coming on four and the only time I've used it is in interviews :/.
Emacs on windows? Never seen that before.
It's the ubuntu core displaying on an X server on the windows machine. It's quite fancy really.
I ran Emacs in Windows 20 years ago. I expect today's builds are even better. But I don't like it anymore.
John, What about running docker containers? I love those things, I just discovered docker and I'm running a bunch of Linux containers with my environments inside my mac, then I pack the image and take the magic with me to any platform.
Windows Subsystem for Linux
This emacs? I feel so dirty, I have notepad scent all over me.
I almost screamed to the phone "they all end in zero!!!"
omg 7 bit shifting kills my soul.. it's also in other standards
Now, if only you could quickcheck complex interactions between thousands of servers....
Excellent video! Please do one on unums and why they're better than IEEE 754 floats.
QVear Have not heard of these, shall Google, thanks!
Better = many, many times slower?
can this be performed easily with Google Test and C++ ?
There's a QuickCheck++ inspired on QuickCheck written in Haskal.
QuickCheck has been ported to many languages, including C++
Fantastic !
10:11 I thought you were going to say 8 or 7 characters.
This is one of the best Computerphile videos I've seen in a while! Excellent demo and explanation. More of him and Professor Brailsford!
What I'm not understanding is this: Is this a different way of doing unit testing, or is it a different kind of testing altogether? Can I use this kind of testing in every scenario where I would normally write unit tests?
love computerphile
Very nice. I'd love to see more videos about testing, especially in the context of OO-languages
Brb testing all my code properly xD
Thanks, this was something I was just wondering today; what the heck is property based testing? Now I have an idea :)
Hey... I'm starting to think you knew there couldn't be a zero in the 8th character this whole time
I wanted to write something like this - glad to see it's real
That laptop looks very familiar (I have the same model :D )
That was a beautiful explanation. Thank you.
May i ask, what programming language or markup language and what software is he using?
Absolutely fantastic demonstration. More from this man is 100% welcome :D
Very interesting and entertaining video ! Thank you
I've admired quickcheck since I first learned of it. But I've always wondered, why not automatically include some obvious tests in the generated cases such as boundary values (for an unsigned integer, 0 and the maximum valid integer value)? I would also think that storing failed tests so that every future test run will always re-test those cases would be a good idea.
The things is that a tool like this will go beyond most developer's imagination. It helps to find those unique cases we all from time to time overlook -- especially in the daily crunch to meet deadlines.
That's what smallcheck does, but loses a lot of the benefit of being able to spam arbitrary tests.
As far as saving failed tests goes, that's actually possible if you run quickcheck verbosely, or with some options.
In either case, one can actually create their own quickcheck generator. In Haskell that's usually done via a newtype wrapper, and a new instance of arbitrary (type-dispatch is your friend here).
You can actually get the failed results from base quickcheck by setting an option with "quickcheckWith", iirc.
If run in terminal, it dumps to stdout. There are other options, which could allow you to directly save the results to a file within Haskell.
There are indeed terminal/shell libraries in Haskell, and a library which can consume IO printouts... "silently"? But that's off the top of my head.
As far as special values go, again, you can produce an arbitrary generator easier than you think, especially as shown above in the video.
one of the best explanations I have seen. perfect mix of theory and examples. thanks!
Friggin smart !
Very interesting video, but I don't really appreciate Professor Hughes constantly flipping me off.
Feels more like debugging tool instead of test tool
Mostly used as a test tool, written alongside implementation or as TDD.
Get more of the haskellers in front of the camera!
That was cool!
Great video. A great example of deducing a problem and how to logically think through it.
Is that Emacs? Respect
Great demo!
Great video!!
Next: unit-tests
you got really small eyebrows
SMS messages do have a length field, which specifies the number of characters that have been encoded. While it's true that the encoding alone can't distinguish the extra zero, the SMS structure as a whole is clear.
So there's no problem sending nulls in an SMS text message. (Except, if you need that stuff it's probably better to use binary encoding.)
For those who don't know these techniques were used even right at the beginning of coding decades ago.
The code looks so messy and unreadable? is it like some weird precompiled pubic version that's been scrambled to hide the errors from their company?
Erlang, eh? What does the professor think of Perl 6?
I love this guy
I think I'm missing something. How does it guarantee its "the simplest case"?
It doesn't. For example if there are multiple bugs, each one might have a "simplest case". But finding simplified if not the simplest case(s) to cause bugs helps a lot with pinpointing them down.
I'd still have appreciated if they had detailed how the found failing test cases were simplified.
ah gotcha; thanks
+Computerphile, where does the Erlang code come from this demo, and does Prof John have a sample for people to test/use?
He says at the beginning that the code came from a company in France that does SMS encoding/decoding. I couldn't find it on the internet anywhere, so it may be proprietary. But nothing stops you from typing it straight up from the video.
Wasn't that video showed already?
Very very useful video. Thanks.
What language/interface is this?
The language is Erlang, and he is using the emacs editor.
Would this work for Java code in Android Studio
Yes.
Let the пиндосрач begin :D - 2017-01-18
this guy has done a very good job with this demo!
kuneeya kanna - 2018-02-21
This was great, I've been looking for "test mobile app" for a while now, and I think this has helped. Have you ever come across - Reyndrew Software saccular - (search on google ) ? Ive heard some interesting things about it and my colleague got amazing results with it.
K.D.P. Ross - 2018-11-01
I had John as a professor; he's an amazing teacher :~}