CS345 - Software Engineering - Spring 2005-2006
Charlie Peck and Chris Hardie
Department of Computer Science - Earlham College
Lab Assignment #5 Automated Testing
This lab asks you to implement some automated tests that build on and verify your work in Lab #2 and Lab #4, and that will assist you as you proceed with your group project.
Part A: Write a test suite that tests and verifies the functionality of your completed code from Lab #2: Scraping and Mapping. In particular, the test suite should cover these areas:
- A unit test to test that the data scraping software runs successfully unattended
- A unit test to show that the data scraping software only accepts the arguments it is designed to accept, and fails gracefully when additional/invalid arguments are given.
- A functional test to show that the scraping software produces the correct kind of data in "verbose" mode
- A unit test to test that the data scraping software successfully downloads the current known correct number of theater records
- A unit test to test that the data scraping software has inserted the theatre records correctly into the data storage mechanism
- A functional test to show that the user map interface is available and running at all
- A functional test to show that the map interface has the proper Google "Map", "Satellite", and "Hybrid" buttons on it
- You should create at least 3 other tests that you think will be useful in verifying the scraper/mapping code.
Create a "smokebot" script that runs all of the tests you've created and generates a unified output, noting any failures.
Part B: Write a test suite that verifies the integrity of the data inserted in the database as a part of Lab #4. In particular, the tests should:
- Run the scraper script to make sure the data inserted is current
- Connect to the database and verify the number of records present
- Connect to the database and verify that the contents of the fields are the data you expect (e.g. that metric tonnes actually contains a number, that the country name looks like a country name, etc.)
For both parts:
- Use the Perl programming language for writing your test suites. You can use whatever shell/scripting language you want for the smokebot in Part A.
- When constructing the test output, consider ways to make it most useful to developers maintaining the code you've written for the long term: descriptive test names, logic order/grouping of test operations, etc.
Turn in:
- A pointer to the electronic versions of your test suites and smokebot
- A printout of your test output for both parts
- A write up of A) your current thinking on the usefulness and process of creating unit and functional tests, especially as contrasted with your earlier journal response about test coverage, and B) what opportunities you see for using automated testing in the group project, and/or any other software engineering projects you're involved with.
For extra credit: Get an instance of Selenium running and use it to write tests that verify the functionality of the Google map interface itself on your Lab #2 page (e.g. that the zoom controls actually make the map view change).