[go: up one dir, main page]

0% found this document useful (0 votes)
11 views34 pages

ST10 Unit Testing

The document is a lecture on Unit Testing presented by Quoc Nguyen, covering its definition, properties of good unit tests, and the Test-Driven Development (TDD) methodology. It includes examples, benefits of TDD, and insights into unit-testing frameworks. Additionally, it provides exercises and a Q&A section for further engagement.

Uploaded by

Kiet La
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views34 pages

ST10 Unit Testing

The document is a lecture on Unit Testing presented by Quoc Nguyen, covering its definition, properties of good unit tests, and the Test-Driven Development (TDD) methodology. It includes examples, benefits of TDD, and insights into unit-testing frameworks. Additionally, it provides exercises and a Q&A section for further engagement.

Uploaded by

Kiet La
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Software Testing

Unit Testing

Quoc Nguyen
Lecturer
Faculty of Information Technology
Van Lang University

© 2016, Hieu To
Lecture Learning Objectives

© 2019, Quoc Nguyen 2


What is Unit Testing

© 2019, Quoc Nguyen 3


How Most Developers Test Their Code

© 2019, Quoc Nguyen 4


How Most Developers Test Their Code

© 2019, Quoc Nguyen 5


Properties of a Good Unit Test

© 2019, Quoc Nguyen 6


Properties of a Good Unit Test

© 2019, Quoc Nguyen 7


Properties of a Good Unit Test

© 2019, Quoc Nguyen 8


What Is a Good Unit Test?

© 2019, Quoc Nguyen 9


A Simple Unit Test Example

© 2019, Quoc Nguyen 10


A Simple Unit Test Example

© 2019, Quoc Nguyen 11


A Simple Unit Test Example

© 2019, Quoc Nguyen 12


Test-Driven Development (TDD)

© 2019, Quoc Nguyen 13


How to write a unit test

© 2019, Quoc Nguyen 14


How to write a unit test

© 2019, Quoc Nguyen 15


Test-Driven Development (TDD)

© 2019, Quoc Nguyen 16


Test-Driven Development (TDD)

© 2019, Quoc Nguyen 17


Refactoring the code

© 2019, Quoc Nguyen 18


Benefits of Test-Driven Development

© 2019, Quoc Nguyen 19


Benefits of Test-Driven Development

© 2019, Quoc Nguyen 20


What Unit-testing Frameworks Offer

© 2019, Quoc Nguyen 21


What Unit-testing Frameworks Offer

© 2019, Quoc Nguyen 22


What Unit-testing Frameworks Offer

© 2019, Quoc Nguyen 23


What Unit-testing Frameworks Offer

© 2019, Quoc Nguyen 24


© 2019, Quoc Nguyen 25
The xUnit Frameworks

© 2019, Quoc Nguyen 26


Basic Rules for Naming Unit Tests

© 2019, Quoc Nguyen 27


Unit Test Report

© 2019, Quoc Nguyen 28


Suggestions

© 2019, Quoc Nguyen 29


Exercise – 1

© 2019, Quoc Nguyen 30


Exercise – 2

© 2019, Quoc Nguyen 31


Summary

© 2019, Quoc Nguyen 32


Summary

© 2019, Quoc Nguyen 33


Questions & Answers

© 2019, Quoc Nguyen 34

You might also like