CSC 405, Week 7
Guest Lecture on Entrepreneurship
Project-Specific Testing Details
Relevant Testing Background
Evaluation of Week 7 Critical Tasks
- Weekly Lecture/Lab Overview
- Monday:
- Guest lecture/discussion on entrepreneurship
- Brief introduction to testing
- Lab time for project work
- Wednesday:
- Continued testing discussion
- Testing set up and critical task work in lab
- Friday:
- Project-specific testing details
- Check completion of Week 7 critical tasks
- Assign Week 8 critical tasks, including testing duties
- Lab time for project work
Types of testing we'll perform:
- Functional Model -- JUnit
testing through
model API
CSC405-W12-L7 Slide 2
- Functional View -- GWTTesting through view API
- Acceptance, Automated -- Selenium testing through HCI
- Acceptance, Manual -- human testing through HCI
Mapping Testing Terminology onto 405 and 406
- Consider testing activities from Week 3 Lecture Notes.
- What follows are notes on how they'll be accomplished in 405 & 406.
Unit Testing
- For model, use JUnit3.
- For view, use GWTTest.
- For DB layer, adapt SQLite testing framework.
- For critical methods, formalize with JML.
Module Testing
- For model and view, start with stubbed DB test fixtures.
- Output results with JUnit Assert methods.
- Also output to differencable log.
Integration Testing
- Replace stubbed DBs with actual DBs.
- Re-run module tests.
System Testing
- Run the top-most model/view tests with Junit Runner.
- Run automated UI tests with Selenium.
Acceptance Testing
- Use existing acceptance test procedure.
- Run for each department's Winter 2012 schedule.
Black Box Testing
- Write initial test cases, using JML specs for critical methods.
- Particular focus on end-user data validation preconditions.
White box
- Add more tests based algorithm details in code.
- Add more tests based coverage results.
CSC405-W12-L7 Slide 3
Testing Design
- JUnit3 API is well documented.
- So is GWTTest.
- And SQLite test framework as well.
Test Plan
- I strongly recommend a common, uniform structure for these.
- Unit test plans in testing method Javadoc comments.
- Module test plans in class Javadoc comments.
- Integration test plan as a text document.
Top-down Testing
- Algorithm with stubbed DBs.
- Selenium with or without underlying stubs.
Bottom-up Testing
- Algorithm without UI.
- Possibly some form of independent DB testing.
Test Case
- Defined specifically by JUnit and GWTTest
Testing Oracles
- For critical methods, a formal postcondition.
- For other aspects of test, human-produced validation methods.
Testing Stubs
- Used primarily for independent algorithm testing.
- Elsewhere as needed.
Test Driver
- Provided by JUnit, GWTTest, Selenium.
Regression Testing
- With JUnit Assert.
- Differencable logs for algorithm internals.
Test Coverage
CSC405-W12-L7 Slide 4
- Use Coberatura.
- It integrates well with Junit3.
Test Subsumption
- Unplug independent DB tests when algorithm is integrated.
- Much of Junit tests is effectively subsumed by Selenium-driven tests, but we'll
do both as part of the official regression suite.
Test Automation
- Via Eclipse.
- May also use ant builds and/or makefiles.
Mutation Testing
- Might be interesting to do a bit in 406.
Testing Harness
- Covered above, particularly under Test Drivers.
Testing Frameworks
- To summarize:
- JUnit for model API
- GWTest for view API
- Selenium for automated HCI.
- Human-performed for accepted HCI.
Resources
Design and testing best practices.
- Concrete structure in Fisher's 309 SOPs:
- Vol 1 -- Repository Structure
- Vol 2 -- Design & Imple'n Conventions
- Vol 3 -- Testing Conventions
CSC405-W12-L7 Slide 5
Design and testing best practices, cont'd
- Widely-used tools:
- CppUnit
- Gcov
- Linux Test Project, Lcov
Design and testing best practices, cont'd
- An exemplary "best testing practice site" --
SQLite Testing