Wild Web Wanderer
Stage: development
Current plan is available as {3}
Requirements
Business requirements
Web application development requires versatile testing. Frequently, usual testing using predefined tests is not enough: users are much more creative than any requirements analysis may imagine and can trigger completely unexpected scenarious.
Thus, we need a tool that would allow random or semirandom web application traversal, logging each action. It should be done in two modes:
- follow only links and
- follow links and fill out forms.
Such tool should be able
- to run from automated testing suite (e.g. at CI),
- to log each action in the executable test form,
- to limit traversed links/forms to the predefined site (regexp?) and
- to limit its execution by time or by the number of visited pages.
General architecture
Plain script.
Users
Single user.
Data
- Web page
- Link
- Form
- Starting URL
- Allowed URL regexps
- Error regexps
- Logscript - script that logged all actions performed by RWT
- Random seed
- Input generators
Functions, screens, performance
No screens.
Performance is usually limited by web application.
test link traversal
Event flow:
- System starts up and reads its configuration from configuration files in such order:
- system-wide configuration file ('/etc/rwt/config.py')
- user configuration file ('$HOME/.rwt/config.py')
- project configuration file ( '$cwd/rwt-config.py')
- command line options
- If a random seed is specified, System initializes pseudo random numbers generator from it. Otherwise, it initializes from system time.
- System sets starting web page as the current one.
- System performs the following procedure for the current web page:
- download the page content
- if the output contains a text, satisfying any error regexp, notify the user and stop the execution
- get all links from the page
- limit the links set to those satisfying allowed url regexps
- select random link and set it as the current one
- log the action as an executable python code
- repead the step
- System continues the previous cycle until the earlies happen: the time limit would be reached or the number of links tranversed would be exceeded.
Tests:
- System-wide configuration file doesn't exist
- System-wide configuration file is not a valid python script
- User configuration file doesn't exist
- User configuration file is not a valid python script
- Project configuration file doesn't exist
- Project configuration file is not a valid python script
- Command line option is broken (define CLI syntax!)
- Random seed is not a number
- A page is unavailable (returns anything bug 2* or 3* HTTP code)
- No error regexps.
- Invalid error regexp (e.g. not a regexp at all)
- No links on the page (define behaviour! e.g. return to the previous page and select another link)
- Time limit is not a number
- Tranversed links limit is not a number.
- Success test of a simple static local website.
Tickets: #1
test link traversal and form posts
Event flow:
- System starts up and reads its configuration from configuration files in such order:
- system-wide configuration file ('/etc/rwt/config.py')
- user configuration file ('$HOME/.rwt/config.py')
- project configuration file ( '$cwd/rwt-config.py')
- command line options
- If a random seed is specified, System initializes pseudo random numbers generator from it. Otherwise, it initializes from system time.
- System sets starting web page as the current one.
- System performs the following procedure for the current web page:
- if current page is a link, download the page content; otherwise (a form) - download an HTTP POST result
- if the output contains a text, satisfying any error regexp, notify the user and stop the execution
- get all links and all forms from the page
- limit the links and form actions set to those satisfying allowed url regexps
- select random link or form and set it as the current one
- if the current page is a form post, generate the random input to it using configured generators
- log the action as an executable python code
- repead the step
- System continues the previous cycle until the earlies happen: the time limit would be reached or the number of links tranversed would be exceeded.
Tests:
- System-wide configuration file doesn't exist
- System-wide configuration file is not a valid python script
- User configuration file doesn't exist
- User configuration file is not a valid python script
- Project configuration file doesn't exist
- Project configuration file is not a valid python script
- Command line option is broken (define CLI syntax!)
- Random seed is not a number
- A page (through a link) is unavailable (returns anything bug 2* or 3* HTTP code)
- A page (through an HTTP POST) is unavailable
- No error regexps.
- Invalid error regexp (e.g. not a regexp at all)
- No links and no forms on the page (define behaviour! e.g. return to the previous page and select another link)
- No links on the page.
- No forms on the page.
- Generator for a form field is not available.
- Generator for a form field throws an exception.
- Time limit is not a number
- Tranversed links limit is not a number.
- Success test of a simple local website.
- Success test of text generator
- Success test of radiobutton generator
- Success test of select generator
- Success test of checkbox generator
- Success test of textarea generator
- Success test of date generator
Tickets: #2
Environment
Other hardware and software integration
- colo.kds.com.ua VE
- ALT Linux Sisyphus 4.0
Development language and style
- Python 2.4.x
- PEP 8
- 100% test coverage with nose
- nose unit tests
- pylint score 8 or better
- all generated html should be valid xhtml and valid css
Licensing and license compatability
GPL v2 or later
Risk profile
Below the identified project risks are enumerated.
- Real development velocity too low comparing to initially estimated
- Non-development delays
- Software defects in the developed Product
- Software defects in 3rd party products
Things in development
None yet
Future development
None yet
Work progress
2007.08.01
Revived from dead friday project
-- akhavr
