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.

 


 

 

  1. The initial level of testing is referred to as unit testing.
    1. Using the PuckSupply class given at the end of the exam, define the tests needed to provide all paths level of coverage of the getPuck method.

 

One where usedPucks is less than maxPucks and one where usedPucks is equal to or greater than maxPucks

 

    1. Describe how unit testing changes if we move from a defensive design approach to a contract design approach.

 

Test cases that would violate the contract are not run

 

    1. Using the three step test process describe the tasks that would be listed in the test plan for PuckSupply. You may want to refer to the test plan outline at the end of the exam.

 

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

 

    1. How does the split between classes and objects affect the testing process?

 

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


 

  1. In modern software development, integration testing is an iterative process that begins when small pieces are being integrated and works up to subsystems being joined.
    1. How is a constraint that is a post-condition used to create a test case?

 

The test case runs the method and then asserts that the constraint is true. If the constraint evaluates to false the test fails

 

    1. List types of defects that can NOT be found during unit test but that can be found during integration.

 

Anything that involves how the methods of the class are called from the classes with which it is integrated

 

    1. In a model-driven development context, once the tester selects a specific class for integration testing how are the other classes that are to be included in that test selected?

 

Any classes that have an association, aggregation or composition relationship would be included in the tests

 

    1. What are the two steps to test case selection in integration testing if orthogonal arrays are being used?

 

1.      Define the test scenarios by selecting the rows from the orthogonal array

2.      Select test data that will be used for all scenarios


 

  1. System testing is largely intended to explore whether the produced product meets the original goals for the system.
    1. How is this type of testing different from unit testing and integration testing? That does not mean define each one.

 

The reason a specific test case is selected and what constitutes coverage changes

 

    1. System testing actually begins before basic units are integrated. It begins with tests of the architecture and design models. How can we determine if the architecture description is complete?

 

By comparing it to the use case model and determining hw each use case would flow through the architecture

 

    1. How do the guided inspection test cases differ from the test cases used for system testing of the completed software product?

 

They are less specific about numeric quantities

 

    1. How does a framework such as TPTP contribute to reducing the effort required for system testing?

 

Automation of running and re-running test cases to free the tester to do other things while the tests are running


 

  1. An important aspect of testing is to plan the tests before selecting test cases.
    1. How is the architecture of the products used to assist in the design of the test software?

 

The architecture describes what classes are related, it gives what their relationships are and tests are designed to follow that relationship

 

    1. How would the test plan for a single system differ from the test plan for a product line of systems? You may want to refer to the outline of a test plan at the end of the exam.

 

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

 

    1. List two test cases you wrote for the Velocity class. Use the complete test case format to describe the test cases. Explain why it is important to run both of the cases you selected.

 

 

 

    1. Guided Inspection relies on structural information from a class diagram and dynamic information from state and sequence diagrams. What does “consistent” mean in this context?

 

The dynamic flows only occur along paths defined in the structural diagram


 

  1. The verification and validation practice in a company encompasses many disciplines such as testing but also includes configuration management and process definition.
    1. Explain how the configuration management system should be used to keep traceability and reuse between a software component and its related test assets.

 

Have a root for each asset; have a map of which requirements are tested by which tests;

 

    1. Using the concepts from the SPEM how can code and test processes be defined to parallel each other?

 

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

 

    1. Besides a tester role, what other roles would be defined in a testing process definition?

 

Developer, manager, test data manager, inspector

 

    1. How does Guided Inspection contribute to verification?  To validation?

 

 

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