Marc Stober
Software Engineer, Partners HealthCare
Presentation to NEMUG, November 13, 2012
TO DO TDD WITH %UnitTest
First thing you do is write a test that fails.
It's not a way of testing: It's a way of (thinking about) development.
Small steps, incremental cycle
Continuous, automated regression testing.
Pros |
Cons |
|
|
|
|
|
|
| "Anyone who continues to think that TDD slows you down is living in the stone age...it's like sterile procedure for surgeons." -- "Uncle" Bob Martin* | |
|
|
|
|
Don't break the build!
Code Coverage: is 100% enough, or too much?
DRY doesnt apply so much. Beck: "every test should tell a story"
Usually don't move to Production
Gamification?
* Arrange (set up)
* Act (run)
* Assert
Test suite/case (class)
Test (method)
Adds Run method (no import/export!)
Wildcard
Summary
Color!
IsEmpty(string) should return true for empty string, spaces, $c(0).
IsEmptyDOB(id) should return true if pt identified by id has empty DOB. (time permitting)
Extensions [Download]:
Testing.TestCase
Testing.Manager
Slides and code:
http://www.marcstober.com/blog/2012/11/13/nemug-presentation-on-test-driven-development/
Contact:
http://www.martinfowler.com/bliki/Xunit.html
http://xprogramming.com/software/ (list of xUnit frameworks)
http://blog.jphpsf.com/2012/09/30/OMG-test-driven-development-actually-works/
http://www.drdobbs.com/testing/unit-testing-is-there-really-any-debate/240007176#
/
#