Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
A Gentle Introduction to Unit Testing with MXUnit
Search
Brian Klaas
April 27, 2010
Technology
0
58
A Gentle Introduction to Unit Testing with MXUnit
Presented to the Johns Hopkins Adobe User Group, April, 2010.
Brian Klaas
April 27, 2010
Tweet
Share
More Decks by Brian Klaas
See All by Brian Klaas
Start Using Amazon Web Services in Your ColdFusion Apps
brianklaas
0
48
Unleash Your Inner Spielberg When Flipping the Classroom
brianklaas
0
54
Promises, Promises: Unlocking the Power of jQuery's Deferreds
brianklaas
0
38
Making Your ColdFusion Apps Highly Available
brianklaas
0
160
Unleash Your Inner Spielberg When Creating Online Lectures: The Director's Cut
brianklaas
0
54
Making High-Performance Caching Easy with ColdFusion
brianklaas
1
68
Resources for Developers to Learn about Software Development
brianklaas
1
41
From Shakespeare to Spielberg: Using Techniques from Film and the Stage to Make Lectures More Engaging and Impactful
brianklaas
0
50
Unleash Your Inner Spielberg when Creating Online Lectures
brianklaas
0
63
Other Decks in Technology
See All in Technology
アクセス制御にまつわる改善 / Improving access control
itkq
0
540
ServiceNow Knowledge 24の歩き方 EYストラテジー・アンド・コンサルティング
manarobot
0
200
Google Cloud の AI を支える裏側のインフラを垣間見る!
maroon1st
0
350
開発生産性大幅アップ!Postman VS Code拡張機能
nagix
2
380
GraphQL 成熟度モデルの紹介と、プロダクトに当てはめた事例 / GraphQL maturity model
mh4gf
7
1.3k
Python と Snowflake はズッ友だょ!~ Snowflake の Python 関連機能をふりかえる ~
__allllllllez__
1
120
Janus
bkuhlmann
1
490
KubeCon EU 2024 Recap “Kubernetes Policy Time Machine: Where to Next?”
ryysud
0
220
DevOpsメトリクスとアウトカムの接続にトライ!開発プロセスを通して計測できるメトリクスの活用方法
ham0215
2
240
20分で完全に理解するGrafanaダッシュボード
hamadakoji
3
630
LangSmith入門―トレース/評価/プロンプト管理などを担うLLMアプリ開発プラットフォーム
os1ma
3
160
Hands-on Gemini, the Google DeepMind LLM
meteatamel
1
110
Featured
See All Featured
Building an army of robots
kneath
300
41k
Music & Morning Musume
bryan
41
5.6k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
Code Reviewing Like a Champion
maltzj
514
39k
Making the Leap to Tech Lead
cromwellryan
124
8.5k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Automating Front-end Workflow
addyosmani
1356
200k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
241
1.2M
Testing 201, or: Great Expectations
jmmastey
28
6.4k
Ruby is Unlike a Banana
tanoku
96
10k
Transcript
( ) Unit Testing with MXUnit
( ) (A really gentle introduction)
) (
) (
) ( Prove to me that it works
( ) Unit vs. Integration Testing ⊛ Small units vs.
sequences ⊛ MXUnit vs. Selenium
) (
( ) ⊛ Write test code that fails ⊛ Make
the test work ⊛ Refactor/refine
( ) MXUnit http://www.mxunit.org/
( ) MXUnit Test Runner for Eclipse
( ) The Basics ⊛ Write a test shell ⊛
Write the code to make it work ⊛ Verify that it works ⊛ Repeat
( ) The Reality ⊛ Write the code ⊛ Write
the test ⊛ Make sure it works ⊛ This is not TDD!
( ) Assertions ⊛ assertEquals(expected,result) ⊛ assertNotSame(expected,result) ⊛ assertSame(expected,result) ⊛
assertFalse(someVariable or function result) ⊛ assertTrue(someVariable or function result) ⊛ assertXPath(String xpath, any data, [String text], [String message]) ⊛ assertIsTypeOf(component obj, String type) ⊛ assertIsXMLDoc(any xml) ⊛ assertIsArray(any obj1) ⊛ assertIsDefined(any obj1)
( ) Example ⊛ You’ve written a function. Now test
it.
( ) How to Test ⊛ Test one thing per
test ⊛ Write tests for every possible scenario ⊛ Test for success and failure
( ) How to Test ⊛ Test in isolation ⊛
setup()/teardown() ⊛ Mocking dependencies ⊛ injectMethod ⊛ injectProperty
( ) How to Test Databases ⊛ <cftransaction action=”rollback” />
( ) Debugging ⊛ <cfdump>/<cfoutput> ⊛ request.debug( ) method in
tests ⊛ “Open test case results in browser”
( ) Great Tutorial on TDD with MXUnit http://www.adobe.com/devnet/coldfusion/ articles/testdriven_coldfusion_pt1.html