Date post: | 17-May-2015 |
Category: |
Technology |
Upload: | kang-min-liu |
View: | 3,062 times |
Download: | 0 times |
Continuous Testing
http://groups.csail.mit.edu/pag/continuoustesting/
Eclipse PluginFor Java
JUnit
Foo.javaFooTest.java
Foo.javaFooTest.java
Changed
Foo.javaFooTest.java
Changed
auto run
HEY
We Perl
Test::Continuoushttp://search.cpan.org/dist/Test-Continuous
DEMO
perl -MTest::Continuous -e runtests'
murmur: There should be a better way...
---------------------------------------------/Users/gugod/dev/Acme-Greeting/t/01.english.t (Wstat: 65280 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 255 Parse errors: Bad plan. You planned 4 tests but ran 5.Files=1, Tests=5, 0 wallclock secs ( 0.00 usr 0.01 sys + 0.05 cusr 0.01 csys = 0.07 CPU)Result: FAIL[MSG]: /Users/gugod/Acme-Greeting/t/01.english.t was changed./Users/gugod/dev/Acme-Greeting/t/01.english......ok
---------------------------------------------Result: PASS[MSG]: /Users/gugod/dev/Acme-Greeting/t/01.english.t was changed./Users/gugod/dev/Acme-Greeting/t/01.english......ok
---------------------------------------------
What It Does...
1. Scan modified files
2. Find all tests requiring a re-run.
3. Run those tests
4. Report PASS / FAIL
5. GOTO 1
How it’s done
1. Scan modified files. File::Modified
2. Find all tests requiring a re-run. Module::ExtractUse
3. Run those tests. App::Prove
4. Report PASS / FAIL. Log::Dispatch
5. GOTO 1. while(1)
CPANFTWCPAN For The Win
Good For...
Test Driven Development
Test DrivenRefactoring
<CODE>
What It Does (1st day)
1. Wait until any file is modified
2. Run all tests
3. Report PASS / FAIL
4. GOTO 1
Run ALL tests
Wasting Time
Write less test
bad software
hate software
Run as few testsas possible
Module::ExtractUse
Only run .t if that’s modified
dependency of .t
Cow.pm
Moose.pm moose.t
cow.t
OX.pm fight.t
Cow.pm
Moose.pm moose.t
cow.t
OX.pm fight.t
Cow.pm
Moose.pm moose.t
cow.t
OX.pm fight.t
Cow.pm
Moose.pm moose.t
cow.t
OX.pm fight.t
Cow.pm
Moose.pm moose.t
cow.t
OX.pm fight.t
Log::Dispatch based notification
Should be easy extend
Log::Dispatch::Screen
---------------------------------------------/Users/gugod/dev/Acme-Greeting/t/01.english.t (Wstat: 65280 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 255 Parse errors: Bad plan. You planned 4 tests but ran 5.Files=1, Tests=5, 0 wallclock secs ( 0.00 usr 0.01 sys + 0.05 cusr 0.01 csys = 0.07 CPU)Result: FAIL[MSG]: /Users/gugod/Acme-Greeting/t/01.english.t was changed./Users/gugod/dev/Acme-Greeting/t/01.english......ok
---------------------------------------------Result: PASS[MSG]: /Users/gugod/dev/Acme-Greeting/t/01.english.t was changed./Users/gugod/dev/Acme-Greeting/t/01.english......ok
---------------------------------------------
/me Mac
Good developing platform
and macbook air is so shiny
Log::Disptach::MacGrowlauto-used if installed
Log::Disptach::MacGrowlauto-used if installed
Not good enough...
.pm → .t.c → .t
.conf → .t.yaml → .t
Only check .pmdependency
Shallow Dependency
Animal.pm
Cow.pm
Moose.pm
moose.tcow.t
Animal.pm
Cow.pm
Moose.pm
moose.tcow.t
isa
Animal.pm
Cow.pm
Moose.pm
moose.tcow.t
isa
isa
Animal.pm
Cow.pm
Moose.pm
moose.tcow.t
isa
isa
tested by
Animal.pm
Cow.pm
Moose.pm
moose.tcow.t
isa
isa
tested by
tested by
Animal.pm
Cow.pm
Moose.pm
moose.tcow.t
isa
isa
tested by
tested by
Animal.pm
Cow.pm
Moose.pm
moose.tcow.t
isa
isa
tested by
tested by
animal.t
tested by
Should clearly notified what’s failed
No High-Def cute looking iconICON DESIGNER WANTED
Future
• Better Dependency Detection
• Convention based (For Catalyst / Jifty / Others)
• Configuration based
• Support other Universal Reminder on other platform. (Twitter!)
END
Happy Testing