Computer Science 203:

Software Engineering

Gregory M. Kapfhammer

Color Scheme

Key Concept

Corresponding Diagram

In-Class Discussion

In-Class Activity

Details in the Textbook

Python Testing with Pytest

Chapters 1 through 2

Preface

Test Strategy

Unit test

Integration test

System test

Where do you think that we will focus?

Unit testing

Why is this our focus?

Chapter 1: Getting Started

Test Cases

Setup steps

Call function under test

Perform assertions

What does it mean when a test fails?

What does it mean when a test passes?

Test oracles

Test assertions

Test Outcomes

Pass

Fail

Skip

XFAIL

XPASS

ERROR

What are XFAIL and XPASS?

X-Type Outcomes

XFAIL: Expected to fail, ran, and failed

XPASS: Expected to fail, ran, and passes

When would a test be expected to fail?

Brief overview of features

Command-line arguments

Run a single test

Run marked tests

Run entire test suite

Run modified test suite

Application to the software project

Chapter 2: Writing Tests

Python project structure

See Page 24 for more details

Using assertions

Test Outcomes

assert something

assert a == b

assert a < b

Naming test functions

Marking test functions

Skipping test functions

Running test subsets

Parameterized testing

Benefits of parameterized testing?

See page 43 for an example

Alternatives to parameterized testing?

Application to the software project