FIT4004 Lecture Notes - Lecture 8: Unit Testing, List Of Unit Testing Frameworks

16 views1 pages
Week 8 - Unit testing
Why unit test?
Easiest to find problems in isolation. By testing the smallest chunks of code at a
time, it’s easier to find out what’s causing the problem
How to do unit tests?
Refer to course notes [Unit testing] under week 8
What makes a good unit/test suite?
A way of determining how good your test suite is, is to use coverage tools (Refer
to course notes [Unit testing] under week 8)
Stubs were empty methods (or functions) that did nothing but return appropriate
dummy data.
Fakes are more comprehensive but limited prototype implementations for testing that
can do things like check arguments and apply simple logic to determine an appropriate
test data.
Shims were intermediate code inserted to check arguments before handing off to the
real external code that did the work.
Drivers were used to drive units for testing purposes; their job is now done by the test
methods you write for PyUnit.
Mocks are dummy objects that allow you to mimic external dependencies and to check
how they've been accessed.
Unlock document

This preview shows half of the first page of the document.
Unlock all 1 pages and 3 million more documents.

Already have an account? Log in

Document Summary

By testing the smallest chunks of code at a time, it"s easier to find out what"s causing the problem. Refer to course notes [unit testing] under week 8. A way of determining how good your test suite is, is to use coverage tools ( refer to course notes [unit testing] under week 8) Stubs were empty methods (or functions) that did nothing but return appropriate dummy data. Fakes are more comprehensive but limited prototype implementations for testing that can do things like check arguments and apply simple logic to determine an appropriate test data. Were intermediate code inserted to check arguments before handing off to the. Shims real external code that did the work. Were used to drive units for testing purposes; their job is now done by the test.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents