CpSc 873
Verification and Validation
Name
____________________________________
There are 5 questions. Answer any 4 of them. Place a large x of the page containing the question you are not answering. Do NOT answer all 5. If you do I will only count the 4 worst answers.
This is an individual effort. You may use the textbook, class handouts, and your notes. Nothing else and no one else. No laptops, no sharing notes or handouts.
One where usedPucks is less than maxPucks and one where usedPucks is equal to or greater than maxPucks
Test cases that would violate the contract are not run
Plan define the level of coverage required
Select test cases to achieve that level
Construct define a JUnit test class
Define an instance of PuckSupply
Define test method for each test case
Execute use JUnit to run the tests
Check the results listed in the JUnit output window
For each class objects are created to execute the tests
The class is used to select test cases but an object is used to execute them
The test case runs the method and then asserts that the constraint is true. If the constraint evaluates to false the test fails
Anything that involves how the methods of the class are called from the classes with which it is integrated
Any classes that have an association, aggregation or composition relationship would be included in the tests
1. Define the test scenarios by selecting the rows from the orthogonal array
2. Select test data that will be used for all scenarios
The reason a specific test case is selected and what constitutes coverage changes
By comparing it to the use case model and determining hw each use case would flow through the architecture
They are less specific about numeric quantities
Automation of running and re-running test cases to free the tester to do other things while the tests are running
The architecture describes what classes are related, it gives what their relationships are and tests are designed to follow that relationship
In the “tested features” section the differences between products would be described. This section would be the superset of all features in the product line. Other sections would also reflect the differences in products
The dynamic flows only occur along paths defined in the structural diagram
Have a root for each asset; have a map of which requirements are tested by which tests;
The roles of developer and tester can reference each other; the task of doing a test can be made dependent on the development task that creates the item being tested; the workproduct for testing can reference the workproduct for development
Developer, manager, test data manager, inspector
Guided inspection of the interfaces between components is verification
Guided inspection of a complete architecture is validation
PuckSupply class
package brickles;
/*
* PuckSupply.java
*
*
*/
import javax.microedition.lcdui.Image;
import coreAssets.Point;
import coreAssets.Puck;
public class PuckSupply
{
// the allowed number of pucks in this version of the game
protected int
maxPucks;
// the number of pucks that have been deleted so far
protected int
usedPucks;
protected Image image;
// initializes to default values
public PuckSupply()
{
maxPucks
= 3;
usedPucks
= 0;
}
// maximum number of pucks
public PuckSupply(int maxNumber) {
maxPucks
= maxNumber;
usedPucks
= 0;
}
// access number of pucks remaining
public int numberLeft() {
if ((maxPucks
- usedPucks) >= 0) {
return maxPucks - usedPucks;
} else
return 0;
}
// method allows the game to request a new puck
// pre:true
// post: self.numberLeft()=self.numberLeft@pre-1 or OutOfPucksException
has
// been thrown
public Puck getPuck(Point
p) throws OutOfPucksException {
if (usedPucks
< maxPucks) {
usedPucks
= usedPucks + 1;
Puck puck = new Puck(p);
puck.startMoving();
return puck;
} else {
throw new OutOfPucksException();
}
}
}
Test Plan
— Introduction
— Test Items
— Tested Features
— Features Not Tested (per cycle)
— Testing Strategy and Approach
o Syntax
o Description of Functionality
o Arguments for tests
o Expected Output
o Specific Exclusions
o Dependencies
--- Test Case Success/Failure Criteria
— Pass/Fail Criteria for the Complete Test Cycle
— Entrance Criteria/Exit Criteria
— Test Suspension Criteria and Resumption Requirements
— Test Deliverables/Status Communications Vehicles
— Testing Tasks
— Hardware and Software Requirements
— Problem Determination and Correction Responsibilities
— Staffing and Training Needs/Assignments
— Test Schedules
— Risks and Contingencies
— Approvals