Unit Test
                    and
Test Driven Development
    2010.09.18 Sapporo Java Community

                          @shuji_w6e
@shuji_w6e
http://d.hatena.ne.jp/shuji_w6e/
http://code.google.com/p/etupirka/
http://code.google.com/p/pirka/
http://code.google.com/p/senic3/
public
Test Driven Development
Test Driven Development




              wikipedia
TDD
                                                       1.
                                                       2.



                                                             3.
5.


                                                       4.


     http://reddevnews.com/articles/2007/11/01/testdriven-development-tdd.aspx
xUnit
JUnit


JUnit 4 + hamcrest
@Test, @Before, @After
assertThat
Matcher
Quick JUnit


Eclipse plug-in
Ctrl + 9

http://quick-junit.sourceforge.jp/updates/
current/
Eclipse              -1

Java - Code Style - Organized import
  Number of static import 99 > 1
Java - JUnit - “Add -ea”
Java - Editor - Content Assist - Favorites
  org.hamcrest.CoreMatchers
  org.junit.Assert
  org.junit.matchers.JUnitMatchers
Eclipse             -2

  Java - Editor - Template
Name: at

assertThat(${actual},
          is(${expected}));
${assert:importStatic
  ('org.junit.Assert.*')}
${matchers:importStatic
  ('org.hamcrest.CoreMatchers.*')}
Hello, Unit Test!
ls

     -l -a

Unit test