PyCon 2014

Distribuye tu software en un sobre

Augie Fackler , Nathaniel Manista  · 

Presentación

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

right now it is my pleasure to welcome Augie Fackler and Nathaniel minista please give them a warm round of applause hi hi good afternoon thank you for coming this is my friend Auggie he is a contributor to mercurial and various Python libraries this is my

friend Nathaniel he's the tech lead of melange the Summer of Code web application that also runs google codon and has contributed to pilot how many of you test your software good good how many of you test your software from the perspective of a user so

if you're writing a web app you have test the driver browser okay now how many of you document your software in terms of stating what people can actually explicitly depend on about your behavior yes good now how many of you have had an angry mob come after

you because you made some change to your software it didn't change any of your guarantees in all of your tests kept passing but they were still angry because something had changed okay we've we've all been there and we've all had that problem

and we want to expand on these topics today to give you some better tools to have a better conversation when that situation comes up and what we're going to be talking about is behavioral envelopes for software now these aren't going to be like a physical

envelope matter metaphor it's not going to be like putting network packets in some larger envelope we are thinking in terms of flight envelopes for aircraft so this is the flight envelope of a f-104 a Starfighter airplane this particular envelope talks

about the behavior of the aircraft as it relates between its airspeed and its altitude and there's some extra information on here about g-forces that's kind of hard to understand but if you're above those curved lines and instill inside the white

space on the chart your plane flies and you're having a pretty good time if you're below those curved lines your plane isn't going fast enough to fly and if you're in the red base your plane is falling apart now I found this compelling because

it's a very simple metaphor right it takes all of a given you no space in along certain dimensions and it divides it into what is allowed and what's not allowed and I wanted to know can we do this for software can for software systems we find dimensions

along which some use of the software is allowed and some is disallowed you know whether it looks like this we don't quite know what the dimensions are yet but but can we talk about our software this way in terms of envelopes and so we think that we can

and in fact we have some examples the math package in python has the square root function and it actually has a very well-defined set of inputs right you can give it any number that's greater than or equal to 0 and anything less than 0 is invalid it will

give you a value error at another level of abstraction if you've bought a video game you know the web store or the box will have some descriptions of what the requirements for your system are right how much RAM you have to have a cpu speed you need things

like that one of my favorites runs and four gigs around but i have to like close my web browser because i only have four gigs because otherwise the performance is really terrible because i'm at the bottom end of acceptable performance there another example

is an HTTP server and there are a bunch of different ways we can look at HTTP vit servers they're a bunch of different things we can call HTTP servers so here's a python class right and and it's a Python object and it's an HTTP server and it

has an input and the input must be of type HTTP request and if we pass it a string that is unwarranted use of the system the system is not specified that way so if we look at this systems behavioral input there is in the space of all possible Python values

there's an allowance for objects of type HTTP requests and everything else is disallowed at another level of abstraction an HTTP server is a service you're talking to over the network so you connect to it you send it some sequence of bytes if that's

a valid input it works if it's forbidden input maybe you're just sending it random garbage it will tell you that you sent it an error that might look something like this right the plane in this case is every possible sequence of bytes and the red dots

are sort of a crude representation of things that are going to be invalid now sometimes when we talk about an HTTP server we're talking about something like this and even though it's a physical system it still supports a notion of disallowed input

right this is a disallowed input for this server right some Joker decided to hook a cat5 ethernet cable up to a wall socket and called it the ether killer so you can let the magic smoke out of your Ethernet card and it'll stop working but we can still

talk about the system's input in the same terms right from negative 1 to positive 1 volts is supported input and everything else is disallowed we've drawn it in two dimensions here but because there are eight wires in the ethernet cable it's actually

kind of an octo hypercube now we both have some amount of background in physics and one of the things we do in physics a lot is sort of look at a system from both sides and try and apply similar principles so we're going to go through the looking glass

and start talking about the outputs because we've sent been a lot of time thinking about inputs to a system so when we talk about the outputs of a system and output envelopes we're not talking about systems that have deterministic evaluations right

this is a system that always evaluates to the exact same value in fact that's what the utility of this expression is and here's another one if this didn't always produce exactly the same value it wouldn't be nearly as useful to us but here's

a system that doesn't produce exactly the same value every time but it doesn't produce any arbitrary value either right it's going to give you a value between 0 and 1 but the promise is actually that it will give you some random value that's

[ ... ]

Nota: se han omitido las otras 3.047 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.