Testing
“If it’s not tested, it doesn’t work”
Testing If its not tested, it doesnt work Why Unit Testing? If it - - PowerPoint PPT Presentation
CS420/520 Object-oriented Programming Testing If its not tested, it doesnt work Why Unit Testing? If it is not tested, it does not work Tests represent an executable specification of what the methods ought to do
“If it’s not tested, it doesn’t work”
shelves.
2
3
° Changing code required more courage than I have!
4
5
(years)
written
6
around bugs before QA tests?
QA finds them?
testing process
useful and reusable test suite
7
8
9
C# C++ Curl Delphi Eiffel Eiffel Flash Forte 4GL Gemstone/S Haskell HTML Jade LISP Objective-C Oracle Palm Perl Php PowerBuilder Python Ruby Scheme Smalltalk Visual Basic XML XSLT
10
test methods
11
unit tests
(such as editing config files) to run it.
12
are worth writing, and they can be written in a unit test harness.
them from true unit tests so that we can keep a set of tests that we can run fast whenever we make our changes.
13
acceptance tests.
14
statement, makes assertions about the emitted code
the file system …
15
,
Test Driven Development, A Practical Guide by David Astels
16
class String append: substring:to: at:putChar: charAt: TestCase subclass TestString testAppendChar testAppendString testSubstring testSubstringBoundaries testPutChar
17
want to happen
| string | string := ‘go’. string append: ‘ banana!’. self assert: string = ‘go banana!’.
Browser
18
19
class you are testing
specification
21
when the test passes, your confidence in the property increases
22
Have a property in mind when you write a test
testNewSetIsEmpty
testSetsDontContainDuplicates
23
24
25
friends.
interject
pass
forgotten about it
the code to do
less
Simple Smalltalk Testing: With Patterns
Kent Beck, First Class Software, Inc. KentBeck@compuserve.com
http://www.xprogramming.com/testfram.htm
29