Tip:
Highlight text to annotate it
X
FRED SAUER: I need a testing strategy of App Engine
applications, as the SDK doesn't implement all the
services exactly the way that the
production environment does.
Do you have any insight about how to test your applications,
taking into account some of those differences?
MANDY WAITE: Yes.
So I guess testing--
there's a lot of ways to do testing.
There's a lot of levels you can do testing.
You can do unit testing, functional testing,
integration testing.
Development testing is pretty important of App Engine.
You really probably don't want to deploy an untested version
or application, replace the current version that's working
really well with one that's not been tested particularly
extensively.
So, as always when testing in the development environment,
it's probably important to mock services that you can't
actually access directly.
FRED SAUER: Sure.
MANDY WAITE: So, in this case, if there are any shortfalls in
what the development server offers over what App Engine
offers itself, then you would probably want to mock that.
So that will be the same with accessing another API that you
don't want to access from development, you may just mock
that service up, so you can actually get reasonable
results from making calls to that service.
You can probably do the same with App Engine as well, any
App Engine services that are missing.
Beyond that, really, there's lots of
different options for testing.
Once you've deployed the application, you may-- as Fred
has already mentioned, you may deploy it to a different app
version, and then you may use Traffic Splitting.
App Engine has this feature called Traffic Splitting that
allows you to incrementally direct traffic towards new
versions of your app.
So you can actually test the thing in isolation to a
degree, only pushing a small amount of traffic to it
initially, and then slowly migrating all of the traffic
over as you get more confident in the application's
performance.
And, again, also that other kinds of testing, load testing
and suchlike, you don't really want to do load testing on a
production application.
You would probably need to build a different version of
your application before that and do your testing on that
particular version of your application.
You're also likely to need data as well, so you need to
probably have a representative set of sample data, you can
deploy your application.
If you have an empty datastore it's not really going to give
you the exact same kind of results that your production
application would do, so you probably want to define a set
of data that you can actually populate into your application
initially to do the testing mode.
FRED SAUER: Yep, those are very good points.
One thing that bites people a lot of times when they're
testing in a different application ID, or even on
their production application before they launch, is people
will not use representative workloads.
So instead of creating say 1,000 unique accounts, which
is sometimes tricky to do, they'll say, OK we'll take 10
accounts, and we'll have each one log in 100 times all
running concurrently.
And those access patterns actually change the way the
data is utilized, and you don't get very representative
results there.
So you already talked about making sure that you have some
good sample data there.
Making sure you have good representative requests and
users logging in.
It's kind of just as important.
In any case, as much as you can take the production
environment that you expect and replicate it, the closer
you get, the closer your results are
going to match, obviously.
MANDY WAITE: So you can use tools [INAUDIBLE], like
Selenium and JMeter, those kind of
things for load testing.
The same kind of tools you would use for any kind of web
application to generate tests.
And they generate representative workloads,
believe me.
FRED SAUER: They do.
Just watch out that you're not testing from one machine that
just doesn't have a big enough network connection.
MANDY WAITE: [INAUDIBLE]
Don't talk to me about client side.
Because if your client can't handle the load, then you're
never going to actually load up the server the way you
think you are.
So you need to make sure you can actually generate the load
correctly, you're not [INAUDIBLE] over a lack of
client resources as well when you're testing.
FRED SAUER: I guess you can always get a few instances on
Compute Engine.
There's some capacity there.
Nice big pipe of data.