SAMPLE CHAPTER
489 CHAPTER 23 Debugging and testingUsing this technique and the Flash log file can get you reasonably far, but to take yourgame to a new level, you’l
490DebuggingWhen you launch your application using the Debug but-ton (see figure 23.2), all network traffic appears in theConsole view. This feature i
491 CHAPTER 23 Debugging and testing Breakpoints —Points at which you want the application to stop running so youcan pause and evaluate the situation.
492DebuggingNow that you can control execution, the feature that people generally use the Debug-ger for is watching variables.WATCHING VARIABLESWatchi
493 CHAPTER 23 Debugging and testing myVar = myText.text; } </mx:Script> <mx:TextInput id="myText
494Testingprofiling tools, you can identify memory leaks and unnecessary processing overheadand highlight areas that could use optimization.UNIT TESTI
495 CHAPTER 23 Debugging and testing Object count/object allocation —How many objects have been instantiated? What ifyou have many instances of the sa
496TestingCONTROLLING EXECUTIONOnce the Profiler is running, you’ll see your application listed in the Profile view.Select the application, and a bunc
497 CHAPTER 23 Debugging and testingThe Profiler is the only tool available for Flex that allows this kind of testing, and itdoes a great job. It give
498Testingnience when you’re working with a lot of test cases. Listing 23.7 shows an example ofa test-runner application.<?xml version="1.0&qu
Flex 3 in Action by Tariq Ahmedwith Jon Hirschiand Faisal AbidChapter 23 Copyright 2009 Manning Publications
499 CHAPTER 23 Debugging and testing ts.addTest( new myTest( "testMilesToKm" ) ); ts.addTest( new myTest( "
500TestingBut if things don’t go well, the items that failed appear on the right with a dump ofthe diagnostics to go with them (see figure 23.8). Clic
501 CHAPTER 23 Debugging and testingWith Fluint installed, let’s look at how to create the test runner.CREATING A TEST RUNNERThe test runner is a mini
502Testingpackage { import net.digitalprimates.fluint.tests.TestCase; public class testCase extends net.d
503 CHAPTER 23 Debugging and testingNow you’re ready to rock. Test cases are grouped into test suites, and the test runnerexecutes the test suites.EXE
504Testing Compile your application with the RIATest module embedded in it, or use itsloader feature to dynamically wrap the agent around your applica
505 CHAPTER 23 Debugging and testing23.2.8 IBM Rational Functional Tester (functional testing)Not many Flex developers are aware that Rational Functio
vbrief contentsPART 1APPLICATION BASICS ... 11 Introduction to Flex 32 Getting started 213 Work
BRIEF CONTENTSvi15 Working with XML 31616 Objects and classes 34017 Custom components 35518 Advanced reusability in Flex 380PART 3THE FINISHIN
484Debugging and testingThis chapter’s purpose is to give you a sampling of all the weaponry available bothout of the box and in the form of third-par
485 CHAPTER 23 Debugging and testing23.1 DebuggingYou can use debugging at multiple levels. We’ll review each approach, starting withthe easiest.23.1.
486DebuggingYou’ll want to set up your mm.cfg file to look like this:TraceOutputFileEnable=1ErrorReportingEnable=1MaxWarnings=500With logging now enab
487 CHAPTER 23 Debugging and testingshowing end copyhiding end copyshowing end copySomething is currently: show this pleaseThis is an effective mechan
488DebuggingBut for more complex objects like ArrayCollections, the ObjectUtil ActionScriptclass has a toString() function that takes a reference of a
Comentarios a estos manuales