Object-Oriented Programming II: Program Testing at University of Maryland, College Park - , Study notes of Computer Science

This document from the university of maryland, college park's department of computer science provides an overview of program testing in object-oriented programming ii (cmsc 132). It covers types of testing, levels of testing, and testing terminology. Topics include test cases, test suites, test harnesses, test drivers, stubs, and testers. The document emphasizes the importance of testing and discusses clear box testing, black box testing, unit testing, integration testing, system testing, and acceptance testing.

Typology: Study notes

Pre 2010

Uploaded on 02/13/2009

koofers-user-hi6
koofers-user-hi6 🇺🇸

9 documents

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSC 132:
Object-Oriented Programming II
Program Testing
Department of Computer Science
University of Maryland, College Park
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Object-Oriented Programming II: Program Testing at University of Maryland, College Park - and more Study notes Computer Science in PDF only on Docsity!

CMSC 132:

Object-Oriented Programming II

Program Testing

Department of Computer Science

University of Maryland, College Park

Overview

Testing

Types of testing Levels of testing

Program Testing

Empirical testing

Test software with selected test cases More scalable than verification Not guaranteed to detect all errors

Testing – Terminology

Test case

Individual test

Test suite

Collection of test cases

Test harness

Program that executes a series of test cases

Test framework

Software that facilitates writing & running tests Example – JUnit

Testing – Terminology

Tester (Quality Assurance)

Person devising and / or performing tests More effective if 2nd person writes tests

Walkthrough

Programmer explains code to 2

nd

person

Types of Testing

Clear box testing

Allowed to examine code Attempt to improve thoroughness of tests

Black box testing

No knowledge of code Treat program as “

black box

Test behavior in response to inputs

Unit Test

Test individual units extensively

Classes Methods

Central part of Extreme Programming (XP)

Extensive unit testing during development

Pair programming (1 coder, 1 tester)

Design unit tests along with specification

Approach

Test each method of class Test every possible

flow path

through method

Flow Path

Unique execution sequence through program Example

S1 while (B1) {

if (B2)

S

else

S

Flows

S1 S1, S2S1, S3S1, S2, S2S1, S2, S3S1, S3, S2S1, S3, S3…

Unit Test – Test Coverage

Automated test coverage

Performed by submit server For code, reports # tests executing code

For set of tests selected (from link)

E.g., all public tests, individual test

For conditionals, reports X/Y where

X = # tests executing True Y = # tests executing False

Color

Green = executed by some test case Pink = not executed

Unit Test – Test Coverage Example

System Test

Test entire software

Include all components of software In context in which software will be used

Ensure all pieces of software interact correctly

Acceptance Test

Test full functionality of software

Ensure program meets all requirements

Approach

Place software in user environment Test software with

Real-world data Real users Typical operating conditions Test cases selected by users

Regression Test

Ensure functionality is not lost / changed

As software is modified / extended

Approach

Save suite of tests and expected results Rerun test suite periodically after software changes Report any loss of functionality

Typically run overnight

Software is more stable when developers leavework

Developing Test Cases

Quality of testing depends on test cases Tips on developing test cases

Develop test data during analysis & design phases Attempt to exercise alternate program paths Check boundary conditions

st

and last iterations of loop

st

and last values added to data structure

Pay close attention to problem specification UML use cases

test cases