> informatique > prog > testing > code-checking-automation-computerphile

Code Checking Automation - Computerphile

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

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 :~}

KnownNever - 2017-01-18

Honestly my favorite part is his reaction to it failing the tests lol

Woody Woodlstein - 2018-11-02

KnownNever lol. Same.

Fonzie Huang - 2019-01-09

4:00

Mikael Larsson - 2017-07-06

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!

Quasi84 - 2017-01-18

But, but, my null terminated character arrays... 😓

novel - 2017-01-18

an Editor for Middle-Aged Computer Scientists indeed

Andreas Larsen - 2017-01-18

This is great! Can we have more videos on functional programming and testing?

MH - 2017-01-19

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 :/.

Garbaz - 2017-01-18

Emacs on windows? Never seen that before.

nitowa1 - 2017-01-31

It's the ubuntu core displaying on an X server on the windows machine. It's quite fancy really.

Miner 2049er - 2017-04-25

I ran Emacs in Windows 20 years ago. I expect today's builds are even better. But I don't like it anymore.

Angelo Julioth - 2017-09-30

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.

Herp Derpington - 2018-07-07

Windows Subsystem for Linux

rochr4 - 2018-11-16

This emacs? I feel so dirty, I have notepad scent all over me.

Red_ Guy - 2018-12-01

I almost screamed to the phone "they all end in zero!!!"

oyze - 2017-01-18

omg 7 bit shifting kills my soul.. it's also in other standards

amante pensanta - 2017-01-20

Now, if only you could quickcheck complex interactions between thousands of servers....

Jagielski Gaming - 2017-01-18

Excellent video! Please do one on unums and why they're better than IEEE 754 floats.

TheMasonX - 2017-01-22

QVear Have not heard of these, shall Google, thanks!

hellterminator - 2017-01-30

Better = many, many times slower?

wickedcat - 2017-01-18

can this be performed easily with Google Test and C++ ?

Raymond Doetjes - 2017-01-18

There's a QuickCheck++ inspired on QuickCheck written in Haskal.

Håken Lid - 2017-01-18

QuickCheck has been ported to many languages, including C++

wickedcat - 2017-01-18

Fantastic !

Bert Visscher - 2017-01-21

10:11 I thought you were going to say 8 or 7 characters.

Blake Helms - 2017-01-21

This is one of the best Computerphile videos I've seen in a while! Excellent demo and explanation. More of him and Professor Brailsford!

MrHappy - 2017-03-05

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?

Billy Kotsos - 2017-01-18

love computerphile

Yous0147 - 2017-01-19

Very nice. I'd love to see more videos about testing, especially in the context of OO-languages

MrGoatflakes - 2017-01-18

Brb testing all my code properly xD

Mace Ojala - 2017-01-18

Thanks, this was something I was just wondering today; what the heck is property based testing? Now I have an idea :)

HamQM - 2017-01-20

Hey... I'm starting to think you knew there couldn't be a zero in the 8th character this whole time

James Cleary - 2017-01-21

I wanted to write something like this - glad to see it's real

ravewulf - 2017-01-19

That laptop looks very familiar (I have the same model :D )

Harry Ayres - 2018-07-27

That was a beautiful explanation. Thank you.

Asura - 2018-09-11

May i ask, what programming language or markup language and what software is he using?

Blake Scherschel - 2017-07-13

Absolutely fantastic demonstration. More from this man is 100% welcome :D

Gaël Bernard - 2017-01-18

Very interesting and entertaining video ! Thank you

Dustin Rodriguez - 2017-01-18

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.

Raymond Doetjes - 2017-01-18

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.

Foagik - 2017-01-18

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).

Foagik - 2017-01-23

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.

vNIC - 2017-01-21

one of the best explanations I have seen. perfect mix of theory and examples. thanks!

Woody Woodlstein - 2018-11-02

Friggin smart !

Noel Goetowski - 2017-01-18

Very interesting video, but I don't really appreciate Professor Hughes constantly flipping me off.

sunshineo23 - 2017-01-19

Feels more like debugging tool instead of test tool

Daniel Beecham - 2017-01-21

Mostly used as a test tool, written alongside implementation or as TDD.

Up4lIFe - 2018-06-29

Get more of the haskellers in front of the camera!

NoriMori - 2017-02-22

That was cool!

lotius - 2017-01-19

Great video. A great example of deducing a problem and how to logically think through it.

MrGoatflakes - 2017-01-18

Is that Emacs? Respect

Николай Зелински - 2017-07-04

Great demo!

sidenotes - 2017-01-18

Great video!!

PixelPhobiac - 2017-01-18

Next: unit-tests

noone mate - 2017-01-18

you got really small eyebrows

Tim Williams - 2017-02-05

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.)

Dan Kelly - 2017-07-21

For those who don't know these techniques were used even right at the beginning of coding decades ago.

EpsteinsPlasticSurgeon - 2017-05-13

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?

YouHolli - 2017-01-18

Erlang, eh? What does the professor think of Perl 6?

jmw150 - 2018-11-10

I love this guy

Gabe Tower - 2017-01-19

I think I'm missing something. How does it guarantee its "the simplest case"?

Gjum - 2017-01-19

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.

Gabe Tower - 2017-01-20

ah gotcha; thanks

Alex Craven - 2017-02-03

+Computerphile, where does the Erlang code come from this demo, and does Prof John have a sample for people to test/use?

Drew Lemmy - 2017-02-14

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.

Pedro Furlanetto - 2017-01-19

Wasn't that video showed already?

Vagelis Prokopiou - 2018-08-07

Very very useful video. Thanks.

William Wylie-Modro - 2017-02-01

What language/interface is this?

Drew Lemmy - 2017-02-14

The language is Erlang, and he is using the emacs editor.

Everything Tech Review - 2017-01-23

Would this work for Java code in Android Studio

Drew Lemmy - 2017-02-14

Yes.