태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

C# 애플리케이션의 단위시험에 사용할 도구를 정하고자 한다. 단위시험 도구로는 'JUnit'이 가장 먼저 떠오르고, 이와 연상되는 'NUnit'이 있다.

JUnit을 .NET 프레임워크 기반으로 포팅한 결과물로 NUnit 이외에 MbUnit, csUnit 등이 있다. 이들 다수가 오픈소스인데, 그 중에서도  xUnit.NET 프로젝트가 돋보인다.

홈페이지에서 'Abount the Project' 문서를 보면서, xUnit.NET 개발 동기(Why did we build xUnit.net?)에 크게 공감한다. 무엇보다도, 개발 동기를 밝힌 문서에서 'Lessons Learned'를 눈여겨 봐 둘만 하다. (아래에 복사해둔다.)

Lessons Learned
  • Single Object Instance per Test Method. Much has been written about why this improves test isolation. In xUnit.net we create a new instance per test. For more information, see http://blogs.msdn.com/jamesnewkirk/archive/2004/12/04/275172.aspx and http://martinfowler.com/bliki/JunitNewInstance.html.
  • No [SetUp] or [TearDown]. I blogged recently about some of the problems related to SetUp/TearDown. xUnit.net does not have any built-in support for this capability. For more information, see http://jamesnewkirk.typepad.com/posts/2007/09/why-you-should-.html.
  • No [ExpectedException]. Rather that decorating a method with an attribute, we have returned to the old JUnit style of Assert.Throws for expected exceptions. This helps two major issues: 1. With [ExpectedException] it's possible to hide real errors when the wrong method call throws an exception, and 2. Allows your tests to continue to obey the Arrange-Act-Assert (or "3A") pattern, as coined by William Wake.
  • Aspect-Like Functionality. End users extended NUnit and MbUnit with cross-cutting concerns that could be attached to test methods (an example is automatically rolling back changes made to a database during the test). This made the tests simpler to write and allowed more consistent usage of the cross-cutting operations. xUnit.net makes it very simple to create such operations and attach them to test methods.
  • Reducing the Number of Custom Attributes. Sometimes, the excessive use of attributes can make you feel like you've diverged far from the underlying language. xUnit.net removed some attributes from the framework, instead relying on language features to provide similar functionality:
    • [TestFixture] was removed entirely; tests can be in any public class. Test methods can be static or instance, to better facilitate testing with F#.
    • [Ignore] is expressed using the Skip= parameter on [Test].
    • [SetUp] and [TearDown] are removed in favor of constructors and IDisposable.
    • [ExpectedException] was replaced with Assert.Throws (or Record.Exception, which provides better adherence to the 3A pattern).
    • [TestFixtureSetup] and [TestFixtureTearDown] are removed in favor of implementing reusable fixture data classes, which are attached to test classes by having them implement IUseFixture<T>.

그리고, 홈페이지에서, NUnit 등과 같은 다른 도구들과 기능을 비교, 정리해서 제공하고 있어 도구들의 기능 유사성을 구별하는 데 많은 도움이 되었다.

xUnit.NET은 다수의 실행 프로그램을 제공 (MSBuild, TestDriven.NET, ReSharper, console-based, GUI-based 등), Microsoft .NET Framework 3.5 버전을 지원하는 것이, 비교 자료에는 보이지 않지만, 가장 특징적이라고 생각한다.
이올린에 북마크하기(0) 이올린에 추천하기(0)
Posted by hwsj
사용자 삽입 이미지

Ruby on Rails 개발 환경으로 뿐만 아니라 Grails 개발 환경으로도 뛰어난 자바 개발 통합 환경을 제공하는 NetBeans IDE 6.5 Beta 버전을 출시했다.

예전에 NetBeans IDE를 Eclipse 를 대체하는 자바 개발 통합 환경으로, 그리고 Ruby on Rails 개발 환경으로 사용법Grails 개발 환경으로 사용법을 간단하게 소개한 바 있다.

나는 최근에 Grails 개발 환경으로서 NetBeans IDE 6.5 Milestone 1 버전을 설치해 사용하고 있었다. (나의 기억으로는, NetBeans IDE 6.5 Milestone 1 버전은 7 월 4 일에 제작되었다.) 안정된 6.1 버전을 마다하면서 6.5 Milestone 1 버전을 사용하는 얼리어댑터를 자처한 것은 Groovy & Grails 플러그인을 사용하기 위해서였다. 그 전에는 Nightly Build 버전을 사용하였다. 그래서, 나한테는 더 나은 선택이 되었다고 생각한다.

NetBeans IDE 6.5 Milestone 1 버전에서 Groovy & Grails 플러그인 1.3 버전이 설치되었지만, NetBeans IDE 6.5 Beta 버전에서 Groovy & Grails 플러그인 1.7 버전으로 업데이트 되었다.

NetBeans IDE 6.5 Beta 버전을 설치하는 방법은 너무 간단하다. 우선, 이전 버전(나의 경우에, NetBeans IDE 6.5 Milestone 1 버전)을 제거한다. 그 다음에, 기존의 NetBeans IDE 6.5 Beta 버전의 설치 파일을 다운로드 하고, 설치 파일을 실행하여 설치한다. (참고로, 정식 배포되고 있는 6.1 버전을 사용하는 경우라면, 6.1 버전을 반드시 제거하지 않아도 된다. 버전별로 다른 디렉토리에 설치되도록 지정할 수 있다.)

 NetBeans IDE 6.5 베타 버전 다운로드

이올린에 북마크하기(0) 이올린에 추천하기(0)
Posted by hwsj