开发者

How to apply TDD/BDD methodology for creating Excel files from C# using data from an Oracle database

开发者 https://www.devze.com 2023-04-11 02:00 出处:网络
I am starting a new project where I have to create and manipulate multiple Excel files based on some data in an Oracle databse.I want to learn and apply TDD/BDD methodologies in this project to improv

I am starting a new project where I have to create and manipulate multiple Excel files based on some data in an Oracle databse. I want to learn and apply TDD/BDD methodologies in this project to improve my programming habits and the project itself.

However, I am not sure what I should do oe where I should start? I am looking for some guidance or roadmap to ensure that I am actaully applying the concepts properly.

What do I need t开发者_高级运维o check? If am unable to install some DI or Mock tools do I have any chnace of properly creating a TDD/BDD approach?

The reason I say might be unable to install software, is because not all software is allowed at the company.

So far I have installed nUnit. I am not sure if I need other tools or code framework/libraries.

Thanks.


IMO, if you are a beginner and want to learn TDD and BDD, this might not be the best project to get started with.

TDD and BDD works really well when dealing with objects. The further you are from objects, the more complex it becomes, because you are dealing with external dependencies which are painful to test against. Both a DB and and Excel file would be good examples of that. Whereas it is fairly straightforward to instantiate a test object, set it to a known state and verify its state after some operations, the same thing is complex with, say, a DB: you need to either use a real DB, set up its state, and write extra code to verify its state (which is more of an integration test approach), or use Mocks, which may not be the easiest technique to start with.

My advice to get started would be to focus on parts of your application which deal strictly with objects. In that context, NUnit and a Mocking framework like Moq are largely sufficient.


I would look at the mspec libraries through NuGet.

0

精彩评论

暂无评论...
验证码 换一张
取 消