MACROMEDIA FLEX 2-TESTING FLEX APPLICATIONS WITH MERCURY QUICKTEST PROFESSIONAL Manuale Utente Pagina 14

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 27
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 13
493 CHAPTER 23 Debugging and testing
myVar = myText.text;
}
</mx:Script>
<mx:TextInput id="myText"/>
<mx:Button click="setMyVar()" label="Set Variable"/>
</mx:Application>
2 Watch the
myVar
and
myText.text
variables.
3 Launch your application in Debug mode.
4 Type something in the text box, and click the button. The application will sus-
pend execution.
5 Switch to Flex Builder; you should see the variables listed.
6 Keep clicking the Step Into button,
and watch how the variables change
(see figure 23.4).
This process of using a Debugger will be a
new experience for those coming from
high-level languages like ColdFusion and
PHP, because the asynchronous nature of
Flex lends itself to the step debugging
needed in an event-driven environment.
Once you do it a few times, you’ll get used to it.
Similar to debugging is the process of testing. Whereas debugging is about fixing
problems, testing is about making sure problems don’t exist.
23.2 Testing
Its always a good idea as part of your Systems Development Life Cycle to do as much up-
front testing as possible before you go live with the application.
ASP, PHP, ColdFusion,
and other such languages will tell you the line of code and filename when a crash
occurs—this luxury doesn’t exist in the land of Flex because of its compiled nature.
After you’ve finished the debugging phase, testing is a good idea to make sure new
features work the way they’re supposed to and previous features continue to function.
Testing is also an opportunity to fine-tune the application.
23.2.1 Types of tests
Three main types of testing are available:
Profiling
Unit testing
Functional testing
Let’s define each, starting with profiling.
PROFILING
Profiling is a process whereby you’re not testing for proper behavior but rather are
looking to see how you can optimize the resource usage of your application. Using
Set breakpoint
here
Figure 23.4 Watched variables show their
values in the Expressions view.
Vedere la pagina 13
1 2 ... 9 10 11 12 13 14 15 16 17 18 19 ... 26 27

Commenti su questo manuale

Nessun commento