Changes for page Testing
Last modified by Pascal Robert on 2012/01/03 10:53
From version 30.1
edited by Pascal Robert
on 2010/09/19 10:26
on 2010/09/19 10:26
Change comment:
add link to new thrash testing page
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. probert1 +XWiki.kiddyr - Content
-
... ... @@ -1,34 +1,29 @@ 1 -* [[||anchor="Approaches to Testing"]] 2 -* [[||anchor="Tools"]] 3 -* [[||anchor="Document Review"]] 1 +I have checked in changes to the ant build files. The result of these is: 4 4 5 - ==ApproachestoTesting==3 +1) If you do a build as you used to do a build, there should be no change. 6 6 7 -There are differentkindsoftestsand differentapproaches totesting.No onetechnology or approach will work foreveryone. These are some of the relevant technologies and issues in testing WebObjects and WOnder applications and frameworks.5 +2) There are two targets at the top-level: 8 8 9 - "Framework testing" istesting that isoriented to testing the WebObjectsframeworks or the WOnder frameworks themselves. "Application testing" is testing ofan application or applicationsthatare built using WebObjects or WOnder frameworks. There isobviously some overlaphere. If one has an application,butwithWonder, oneis obviously using and therefore implicitly testing both the WebObjects andWOnder frameworks."Framework testing" is explicitly testing just theframeworkfunctionality in asgeneral a way as possible. There are tests which seem to straddle these two. But one can look at the intent. For example,two of theapplicationsin Project WOnderare the "AjaxExample" and"BugTracker." The AjaxExampleapplication isjust a list of pages showingthingsthat can be done. Nobody would construct an app like this for real work. Onthe other hand, the BugTracker app was created to be used by realpeople for tracking real bugs. It alsodemonstrates and provides a test for advanced features in WebObjects and WOnder.An application likeAjaxExample can be easily changed sothat it iseasyto test. BugTracker cannot be so easily changed. On the other hand, BugTracker is more like a real-world application and so we care about it a bit more than a demonstration project.It may end up being less convenient to test BugTracker, but it may be more important to test it.7 + test-all - does a clean and then build of frameworks,applications, and examples with Dinclude.tests=true. 10 10 11 - There may also be a distinctionbetween API tests, functional tests andperforance tests. In functional testing, one looks at some interface to an applicationand tests it to see if it does what it does. For example, if one launchestheBugTracker app and clickshings and checks what they do, that is functional testing. If one looks at the API of a class, such as the er.extensions.foundation.ERXThreadStorageclass,and determines what methodscan be called on it and callsthem, thatis API testing. One can usually do API testing from a command-line interface andjunitis probablythetool of choice for this. Functionaltesting is not so simple. Onecan manually exercisean app, which may be called the "clicks and eyeballs" approach. This works well, butdoes not scale. It becomesdull,people miss things, and we do not haverobots to do it for us. One can use a test runner to interact with a running WebObjects/WOnder application. Performance testing often looks like functional testing, but the focus is different. It is not on seeing if things work, but how fast they work. In performance testing, one may have to use measurement tools which are not resistant to errors. In other words, performance testing may only work when everything else has been tested. One can do performance and functional testing at the same time, but perhaps one should not.9 + test-run - calls a junit test on selected projects 12 12 13 - ==Tools==11 +3) If the "test-all" target is invoked, then, in addition to any test sources being built in the other projects, the Wonder/Tests/ERXTest project is built. Is anyone involved in that project? If not, no harm, no foul. 14 14 15 - Herearesomerelevantools.Itmaybeusefultosearch fortheirnamesinswiki.13 +4) I added a little stub of a test to ERExtensions. It does nothing right now. 16 16 17 -* Junit and TestNG - for testing of [[user applications>>WO:Testing-JUnit and TestNG]] and for [[WOnder framework testing>>Project WOnder Frameworks JUnit Testing]] 18 -* [[Selenium]] - for both user and WOnder framework testing 19 -* [[WOUnitTest]] - for functional testing (Is WOUnitTest current and being maintained? rrk) 20 -* [[JMeter]] - for performance testing 21 -* [[Thrash Testing]] - for testing threaded operations in EOF 15 +5) I added a top-level target for "build" in Wonder/build.xml, just because it should be there. 22 22 23 - Questions still to beansweredinclude the different approaches one musttake to different kindsofapplications. Forxample,testing a "regular" WOnder app may bedifferentthan testing a "DirectToWeb"app, which is also different than testing a Java Client or a "WebServices" application. Differentapplication typesmake somethingseasier andsome things harder.One may need different approaches or different tools. Also, one may be deploying an app as a regularjava application, or as a servlet in a J2EEcontainer (e.g. Tomcat) or the application may be managed in some other way. How an application is deployed may change how it needs to be tested.17 +Various things are needed to enable testing in a project: 24 24 25 - ==DocumentReview==19 +1) There must be a "Tests" directory in the top level of the project. So chill has spoken and thus it shall be done. Put junit test java sources under that. 26 26 27 -There are manydocumentsrelevantto testingthatshould be evaluatedforveracity,usefulnessandrelevance:21 +2) There must be a parameter which defines the main test class. This could be a TestSuite, which would then invoke all the tests in the project. For example, the "ERChronic.all" target in the Build/build/build.xml file now includes the line: 28 28 29 -* [[Testing-JUnit and TestNG>>WO:Testing-JUnit and TestNG]] 30 -* [[Web Services-Testing Services with Terminal>>WO:Web Services-Testing Services with Terminal]] 31 -* [[Web Applications-Development-Testing and JUnit>>WO:Development-Testing and JUnit]] 32 -* [[Testing-Load Testing WO Apps with JMeter>>WO:Testing-Load Testing WO Apps with JMeter]] 33 -* [[Testing-WOUnitTest>>WO:Testing-WOUnitTest]] 34 -* [[Web Applications-Development-Testing and JUnit>>WO:Development-Testing and JUnit]] 23 + <param name="test.className" value="er.chronic.ChronicTestSuite" /> 24 + 25 +If there is no Tests directory in a project or if there are no sources in the Tests directory, then a build for testing does nothing more than a normal build. 26 + 27 +If there is no test.className property set in a project's target, then a build for testing does nothing more than a normal build. 28 + 29 +If there is no test.className property or there are no test classes in the jar files in the build root, then no tests from that project will be run. An example of a "test-run" appears below.