음...

요즘 회사에서 진행 중인 프로젝트를 XP를 도입하여 진행 중이다.

 

그래서 페어 프로그래밍이라던가 TDD를 하게 되는데, TDD를 하던 중 문제가 발생했다.

ADO.Net 프로그래밍이나 Socket을 사용하는 부분에서 그 Class들에 대한 Mock을 만들지 못하는 문제이다.

 

이러한 문제를 해결할 수 있는 방법을 아시는 분은 연락 주심 매우 고맙겠습니다. ^^''

관련 내용을 찾아다니던 중 나와 같은 문제로 고민하는 사람의 Post를 발견해서 밑에 올립니다.

 

--------

.NET Needs Better Interfaces
In this post, Frans Bouma continues his list of things he wants added to the VS.NET IDE and the .NET API.

My biggest complaint about the .NET API is that I don't think MS used interfaces enough. (And they seal classes that they shouldn't, but Frans already convered that one.) If you have tried to do TDD with Maverick.NET, for example, you very quicly run into a problem with HttpContext and the other HTTP Pipeline classes. Because there are no interfaces to be found, you can't mock them at all.

A similar problem exists in ADO.NET. Once again you can't do TDD very well with it. The root cause is that you can't really write code that is independent of your data provider. It is very close, but when you really get in there you will find that you can't create a DataAdapter without knowing whether you're doing SQL or OLEDB. (Justin wrote Abstract ADO.NET to deal with this, but he shouldn't have had to.)

Another example: Sockets. I was trading email with someone last week and he was asking me how to create a mock Socket. In Java, Socket is an interface, so MockSocket has something to derive from. In .NET, Socket is a class. It is very difficult to mock without creating your own ISocket interface and then creating a lightweight wrapper that aggregates the .NET Socket class. Very annoying.

posted on Wednesday, June 25, 2003 2:49 PM

 

출처 : http://www.peterprovost.org/archive/2003/06/25/576.aspx

+ Recent posts