[Appsunit-develop] [cvscommit] web/htdocs/testguide AppsUnit Test Guide.html, 1.2, 1.3
Status: Beta
Brought to you by:
jancumps
From: Jan C. <jan...@us...> - 2006-09-18 23:01:26
|
Update of /cvsroot/appsunit/web/htdocs/testguide In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv28865/testguide Modified Files: AppsUnit Test Guide.html Log Message: Added copyright notices. Reviewed http://www.oracle.com/html/3party.html Index: AppsUnit Test Guide.html =================================================================== RCS file: /cvsroot/appsunit/web/htdocs/testguide/AppsUnit Test Guide.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AppsUnit Test Guide.html 18 Sep 2006 22:03:39 -0000 1.2 --- AppsUnit Test Guide.html 18 Sep 2006 23:00:53 -0000 1.3 *************** *** 3,10 **** <head> - <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> - <title>AppsUnit Test Guide</title> </head> --- 3,12 ---- <head> + + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> + + <title>AppsUnit Test Guide</title> </head> *************** *** 12,81 **** <body> <h1 class="western">AppsUnit</h1> <table class="" style="text-align: left; width: 712px; height: 132px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td> <div>This project is just starting (08-SEP-2006).</div> <div>The aim is to create a toolkit that will support unit testing Oracle Apps bespoke code.</div> <div>There's no need to install anything on the Apps instances.</div> <div><br> Please refer to the <a href="http://sourceforge.net/projects/appsunit">project home on SourceForge.net</a> for more info.</div> </td> </tr> </tbody> </table> ! <p style="margin-bottom: 0cm;">Oracle e-business suite ! test toolkit</p> <h1 class="western">Test Guide</h1> <h2 class="western">Foreword</h2> <p>Although automation of functional test for ERP software is ! becomming common practice, unit testing and test driven development is less popular.<br> This project wants to promote unit testing, and test driven development, in the ERP community. We will do this by</p> <ul> <li> <p>showing that it can be done,</p> </li> <li> <p>providing usefull tools to facilitate testing.</p> </li> </ul> ! <p>This document describes how you can test your code,</p> <h2 class="western">Testing views</h2> <p>When creating database views, the most common failures are missing or duplicate records, and wrong data values.</p> <p>A wrong record count is mostly caused by incorrect joins. If you --- 14,118 ---- <body> + <h1 class="western">AppsUnit</h1> + <table class="" style="text-align: left; width: 712px; height: 132px;" border="1" cellpadding="2" cellspacing="2"> + <tbody> + <tr> + <td> + <div>This project is just starting (08-SEP-2006).</div> + + <div>The aim is to create a toolkit that will support unit testing Oracle Apps bespoke code.</div> + + <div>There's no need to install anything on the Apps instances.</div> + + <div><br> + Please refer to the <a href="http://sourceforge.net/projects/appsunit">project home on SourceForge.net</a> for more info.</div> + </td> + </tr> + + </tbody> </table> ! ! <p style="margin-bottom: 0cm;">Oracle ® e-business suite bespoke test toolkit</p> ! <h1 class="western">Test Guide</h1> + <h2 class="western">Foreword</h2> + <p>Although automation of functional test for ERP software is ! becoming common practice, unit testing and test driven development is less popular.<br> + This project wants to promote unit testing, and test driven development, in the ERP community. We will do this by</p> + <ul> + <li> + <p>showing that it can be done,</p> + </li> + <li> + <p>providing usefull tools to facilitate testing.</p> + </li> + </ul> ! ! <p>This document describes how you can test your code.</p> ! <p>This is an open source project, independent from Oracle Corporation.</p> ! <p>"Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates."</p> ! <h2 class="western">Testing views</h2> + <p>When creating database views, the most common failures are missing or duplicate records, and wrong data values.</p> + <p>A wrong record count is mostly caused by incorrect joins. If you *************** *** 85,91 **** --- 122,130 ---- you'll get a lot of wrong records.</p> + <p>You can avoid these mismatches by asserting that your view contains the correct number of records.<br> + Most of the time there is one table in the view that is the driving table. It's the core table *************** *** 93,96 **** --- 132,136 ---- count of your view.</p> + <p>When creating a view for order lines with additional item and customer info, the driver could be oe_order_lines_all. It's the *************** *** 100,159 **** --- 140,225 ---- oe_order_headers_all.</p> + <table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%"> + <col width="256*"> <thead> <tr> + <td valign="top" width="100%"> + <p><u>How to test for missing or extra records in a view?</u></p> + + <p>Find the table that is the core of your view (the driving table).<br> + Assert that the record count of the driving table matches the record count of your view.</p> + + <p><font face="Courier New, monospace">simpleCompare( “select count(*) from oe_order_lines_all”,<br> + “select count(*) from xx_order_lines_view”);</font></p> + </td> + </tr> + </thead> </table> + <p><br> + <br> + </p> + <p>You can create this test at the very begin of your view design phase. Then start by creating your basic view:</p> + <p><font face="Courier New, monospace">create view xx_order_lines_view as <br> + select<br> + line_id <br> + from<br> + oe_order_lines_all<br> + with read only;</font></p> + <p>The tests will pass. You can now safely add extra fields and tables to the view. Run the tests again. If you forget an outer join, or create a cardinal join, your tests will fail.</p> + <p>Validating the correctness of a field value in your view is straightforward. You write a quey that asserts wether your view returns the value you expect.</p> + <p>If you want to validate the value for the customer, you could locate an example order line in your application and write down the *************** *** 161,205 **** --- 227,292 ---- your view returns this customer.</p> + <p><font face="Courier New, monospace">select count(*) from xx_order_lines_view where<br> + line_id = 25845<br> + and customer_name = 'SOURCEFORGE';</font></p> + <table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%"> + <col width="256*"> <thead> <tr> + <td valign="top" width="100%"> + <p><u>How to test for correct field values in a view?</u></p> + + <p>Locate an example that has a known value for the field.<br> + Assert that the view returns this expected value.</p> + + <p><font face="Courier New, monospace">simpleCompare( “select 1 from dual”,<br> + “select count(*) from xx_order_lines_view where line_id = 23548<br> + and item_description = 'Feature Request'”);</font></p> + </td> + </tr> + </thead> </table> + <p><br> + <br> + </p> + <p>Add regression tests during the lifecycle of your view. Whenever *************** *** 207,210 **** --- 294,298 ---- against your view, create a test that fails for the given error.</p> + <p style="font-style: normal;">If the error report says that your view *************** *** 212,223 **** --- 300,315 ---- that it's closed, you can create a regression test:</p> + <p style="font-style: normal;"><font face="Courier New, monospace">select count(*) from xx_order_lines_view where<br> + line_id = 12487 <br> + and closed_status = 'Y';</font></p> + <p>The test will pass when your bug is resolved. And because you add *************** *** 225,278 **** --- 317,396 ---- showing up again.</p> + <table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%"> + <col width="256*"> <thead> <tr> + <td valign="top" width="100%"> + <p><u>How to avoid regression?</u></p> + + <p>Create a regression test for each bug or error reported for your view.<br> + Add the test to your test suite.</p> + + <p><font face="Courier New, monospace">simpleCompare( “select 0 from dual”,<br> + “select count(*) from xx_order_lines_view where line_id = 48574<br> + and payment_date < order_date”);</font></p> + </td> + </tr> + </thead> </table> + <p><br> + <br> + </p> + <h2 class="western">Testing functions</h2> + <p>To be written</p> + <h2 class="western">Testing concurrent requests</h2> + <p>To be written</p> + <br> + Sister project: <a href="http://junitpdfreport.sourceforge.net" target="_blank">JUnit PDF Report</a> <br> + <br> + <br> + <a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=176804&type=1" alt="SourceForge.net Logo" border="0" height="31" width="88"></a> </body> |