'TDD'에 해당되는 글 2건

  1. 2010.03.16 JUnit 4 - annotation 설명
  2. 2009.05.12 [링크]Eclipse 에서 JUnit 사용하기

JUnit 4 - annotation 설명

ITWeb/개발일반 2010. 3. 16. 17:00
@Test annotation
Test Case 를 만들어 줍니다. (선언)
 

@Test

public void blahMethod() {
    String result = "blah";

    assertEquals("blah", result);

}


@Before & @After annotation

각각 setup 과 tearDown method 를 위한 annotation

@Before

public void blahBeforeTest() {
    blah = new Blah();

}

@After

public void blahAfterTest() {
    blah = null;

}


@BeforeClass & @AfterClass
@BeforeClass : test case 수행 이전에 한번 실행, @AfterClass : test case 수행 후 한번 실행

@BeforeClass

public void blahBeforeTest() {
}

@AfterClass

public void blahAfterTest() {

}


@Ignore
Test Case 수행을 무시


@기타
@Ignore("무시이유작성")
@Test(timeout = 1000) : 시정한 시간이 경과 하면 test fail. (miiseconds)


사용하면 편한 mock 객체
- easymock
- mockito
:

[링크]Eclipse 에서 JUnit 사용하기

ITWeb/개발일반 2009. 5. 12. 16:00
구글링 해보면 많이도 나와 있지요.
그래서 따로 정리는 하지 않고 잘 정리된 사이트 몇개 링크 걸어 봅니다. :)

- Junit
http://www.javajigi.net/pages/viewpage.action?pageId=278
http://younghoe.info/255
http://decoder.tistory.com/3


JUnit 과 함께 알아야 할 내용 중 TDD(Test Driven Development) 이라는게 있죠.
요즘 회사에서 개발 생산성이랑 Quality Practice 관련해서 다양한 요구사항이 나오고 있내요.

암튼 재밌다는거... ㅎㅎ

- TDD
http://wikidocs.net/mybook/read/index?pageid=3
http://wiki.javajigi.net/display/OSS/TDD
http://xper.org/LineReaderTdd/
: