Changes between Version 66 and Version 67 of DeveloperGuidelinesTesting


Ignore:
Timestamp:
01/24/09 12:59:40 (16 years ago)
Author:
Fran Boon
Comment:

Initial draft of the DeveloperGuidelines version (what we do) vs the broken-out BluePrint

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesTesting

    v66 v67  
    1 DeveloperGuidelines
    2 
    31= Testing =
    42"A bug is a test case you haven't written yet" [[BR]]
    53"Unit Tests allow merciless [http://diveintopython.org/refactoring/refactoring.html refactoring]"
    64
    7 Test-Driven Development is a programming styles which says that you 1st write your test cases (from the [BluePrints specs]) & then proceed to make them pass.[[BR]]
    8 Behaviour-Driven Development takes this further to focus on the Specification rather than the Verification using something like [http://www.codeplex.com/pyspec pyspec] or [http://pypi.python.org/pypi/PyFIT/0.8a2 PyFIT]to provide testable specs:
    9  * http://behaviour-driven.org/BDDProcess
    10  * http://fitnesse.org/FitNesse.AcceptanceTests
     5This page defines what our current approach versus our [wiki:BluePrintTesting BluePrint for future options]
    116
    12 There are a huge number of Testing Tools available to cover the various parts of the Testing process:
    13  * http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy
    14  * http://vallista.idyll.org/~grig/articles/
    15 A community available for assistance:
    16  * http://lists.idyll.org/listinfo/testing-in-python
    17 ----
    18 Testing that Developers should be doing:
    19 == Unit Tests (must do) ==
     7== Doc Tests ==
     8Agile documentation which can be run using Web2Py's Admin UI.
     9* e.g. http://127.0.0.1:8000/admin/default/test/sahana/default.py
     10We have a module which uses [http://code.google.com/p/wsgi-intercept wsgi_intercept] & [http://cherrypy.org CherryPy]'s [http://cherrypy.org/browser/trunk/cherrypy/test/webtest.py WebTest]: {{{modules/s3_test.py}}}
     11
     12== Unit Tests ==
    2013Building the Code Right
    21  * [http://www.python.org/doc/2.6/library/doctest.html DocTest] - inline with code: Agile Documentation
    22   * Web2Py supports running doctests on Controllers from the admin UI, e.g.: http://127.0.0.1:8000/admin/default/test/sahana/default.py
    23   * http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-2-doctest.html
    24   * !DocTests for HTML apps (good since in-process hence can capture errors): http://agiletesting.blogspot.com/2006/04/in-process-web-app-testing-with-twill.html
    25    * Uses wsgi_intercept: http://code.google.com/p/wsgi-intercept/
    26   * [http://pypi.python.org/pypi/dutest dutest] - !DocTest !UnitTest integration (includes HTML-aware output checkers such as [http://codespeak.net/lxml/api/lxml.doctestcompare-pysrc.html lxml.doctestcompare.LHTMLOutputChecker])
    27    * http://ojs.pythonpapers.org/index.php/tpp/article/viewArticle/56
    2814
    29  * [http://docs.python.org/library/unittest.html UnitTest] (formerly [http://pyunit.sourceforge.net PyUnit])
    30   * http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-1-unittest.html
    31   * http://diveintopython.org/unit_testing/index.html
    32   * [http://somethingaboutorange.com/mrl/projects/nose/ Nose] - a discovery-based unittest extension
    33   * [http://mechanicalcat.net/tech/webunit Webunit] - adds supports for HTTP GET/POST testing to unittest
    34   * [http://www.cherrypy.org/wiki/Testing#Usingthetesttoolswithyourownapplications WebTest] - !CherryPy's extensions to unittest
    35    * http://www.cherrypy.org/browser/trunk/cherrypy/test/webtest.py
     15[http://seleniumhq.org/projects/remote-control Selenium RC]
    3616
    3717== Continuous Integration ==
    38 Whenever a commit is made it should be checked to see that it doesn't break anything
    39  * [http://bitten.edgewall.org Bitten] - integrates with Trac
    40  * [http://cruisecontrol.sourceforge.net CruiseControl] - integrates with Trac: https://oss.werkbold.de/trac-cc/
    41  * [https://launchpad.net/pqm Patch Queue Manager] - integrates with Bzr (allows branch merging)
     18We use the Trac-integrated Bitten to monitor code quality.
    4219
    43 Alternate options which could be investigated:
    44  * http://buildbot.net/trac
    45  * http://confluence.public.thoughtworks.org/display/CC/CI+Feature+Matrix
     20== Functional Tests ==
     21We have integrated [http://seleniumhq.org/projects/core Selenium Core] into /static/selenium so that Functional Tests can be run.
     22Tests can be developed using [http://seleniumhq.org/projects/ide Selenium IDE], if desired.
     23If desired they can be maintained in a Python format using
    4624
    47 == Regression Testing ==
    48 Fired by dev after certain number of changes or whenever they like.
    49  * http://www.pycheesecake.org/
    50   * Case Study: http://pycheesecake.org/wiki/CleaningUpPyBlosxom
    51  * [http://www.logilab.org/857 PyLint]
    52  * http://docs.python.org/library/test.html
    53 
    54 == Documentation ==
    55 As well as writing !DocStrings in all functions, we can generate an overall API using:
    56  * http://epydoc.sourceforge.net
    57 If writing a separate manual then we can use:
    58  * http://docutils.sourceforge.net
    5925----
    60 Testing that Testers should be doing as part of [http://en.wikipedia.org/wiki/Acceptance_test Acceptance]:
    61 == Boundary Testing (should do) ==
    62 Building the Right Code
    63 
    64 Checks functionality of modules against [BluePrints specs]
    65 
    66 This sees the application as a black box & so the same tests could be run here against both the Python & PHP versions, for instance.
    67 
    68 Sahana is a Web-based application, so testing should be from browser perspective:
    69 
    70 Functional tests can be written using [http://seleniumhq.org Selenium]:
    71   * This is currently being integrated into !SahanaPy in 2 ways, both can start with developing the tests using Selenium IDE
    72    * Export as Python Selenium RC, then modify based on this discussion: http://groups.google.com/group/web2py/msg/d8c9fd6008029f6b
    73     * These Tests are stored in /tests
    74    * Save as HTML, convert to .py using [http://joker.linuxstuff.pl/documentation/make_selenium make_selenium.py], maintain in Python, then convert back to HTML to store in /static/selenium/tests
    75   * A lot of Selenium-related articles: http://vallista.idyll.org/~grig/articles/
    76 
    77 Alternate opions which could be investigated:
    78  * [http://wwwsearch.sourceforge.net/mechanize/ Mechanize] - library for programming website browsing
    79   * [http://twill.idyll.org/testing.html Twill] is built on Mechanize
    80   * [http://pypi.python.org/pypi/zope.testbrowser/3.6.0a1 zope.testbrowser] is built on Mechanize (& not Zope-specific)
    81  * MaxQ: http://agiletesting.blogspot.com/2005/02/web-app-testing-with-python-part-1.html
    82  * [http://blog.jeffhaynie.us/introducing-testmonkey.html TestMonkey] - not ready for primetime but worth keeping an eye on
    83  * [http://jakarta.apache.org/jmeter/ JMeter]
    84  * [http://www.badboy.com.au Badboy]
    85  * [http://pythonpaste.org/testing-applications.html Paste]
    86 
    87 == Integration Testing (good thing) ==
    88 We depend on various 3rd-party components so we need to ensure that as these components are upgraded this doesn't break any of our functionality:
    89  * Web2Py
    90   * !CherryPy
    91   * SimpleJSON
    92  * T2
    93  * !OpenLayers
    94  * jQuery
    95  * Ext
    96 
    97 == Usability Tests ==
    98  * [http://www.it.rit.edu/~jxs/development/Sahana/00_UI_Comments.html UI Guidelines] - comments on UI issues in Sahana2
    99 === Accessibility ===
    100  * Are we XHTML 1.0 compliant?
    101  * Are we usable without !JavaScript?
    102 
    103 == Performance Tests ==
    104 Whilst the Web2Py framework is fast, we should check that we're not doing anything stupid to slow it down:
    105  * http://groups.google.com/group/web2py/browse_thread/thread/cf5c5bd53bc42d49
    106 
    107 === Load Tests ===
    108 How many simultaneous users can the system support?
    109  * http://tsung.erlang-projects.org/
    110  * Siege
    111 
    112 === Stress Tests ===
    113 If extreme load is applied to the application, does it recover gracefully?
    114  * Tools above but using more extreme parameters parameters
    115 
    116 == Security Tests ==
    117 Whilst the Web2Py framework is secure by design, we should validate this:
    118  * http://mdp.cti.depaul.edu/examples/default/features
    119 Things developers can do to reduce risks:
    120  * http://www.sans.org/top25errors/#cat1
    121 ----
    122 Sahana 2 Links: http://wiki.sahana.lk/doku.php?id=dev:home#design_and_development_guides
    123 
    12426DeveloperGuidelines