494Testing
profiling tools, you can identify memory leaks and unnecessary processing overhead
and highlight areas that could use optimization.
UNIT TESTING
Unit testing is a way to automate programmatically testing your components, functions,
and classes. It’s considered a back-end type of testing, because it makes sure other
pieces that utilize these back-end pieces receive the proper results and behavior from
a programmatic perspective.
FUNCTIONAL TESTING
Functional testing covers the other end of the QA process by focusing on the front-end
experience. Functional testing simulates a user running the application and verifies
that the behavior and information are accurate. This could be done manually, but
that would be prone to human error as well as a potentially huge time investment.
Functional testing works by recording actual use of your application and tracking
what was entered and how the application behaved. Each one of these recordings rep-
resents a test case for which you’ve documented the expected results.
It goes beyond checking whether the results shown are right; it also makes sure that
various business rules are enforced, that things validate properly, and that the overall
experience is the intended result. In addition to automating the testing of new fea-
tures, you can also use functional testing to verify that existing functionality continues
to work properly.
23.2.2 Flex Profiler
New to Flex 3, profiling adds the ability to see where resource bottlenecks (process-
ing and memory utilization) in your application occur so you can isolate and
address the issues.
The Profiler works by periodically sampling what’s going on in your application.
Kind of like time-lapse photography, it takes a snapshot of what things look like at
given intervals. In doing so, it’s able to determine how many objects currently exist,
how much memory they’re using, how many functions are being called, and how
much time those functions are consuming.
Here’s what you should look for:
■
Function call frequency —How often are you calling functions? Are you making
unnecessary calls? See if you can minimize how often heavy-duty functions are
called or if they be broken into smaller pieces, only a portion of which are
called frequently.
■
Duration of functions —How long are functions taking to run? Hand in hand with
the previous item, you can investigate particular functions to determine the
average amount of time a particular function takes to run.
■
Who’s calling whom —Observing this call stack and observing the chain of func-
tions calling functions may reveal interesting information.
Kommentare zu diesen Handbüchern