TDD solution architecture best practice

315 views Asked by At

How will be the solution architecture of TDD project. I mean how should I design a test project?

I have to write a test project for an already existing developed MVC project. I will enhance some of the new feature. This will be the first time for this project to develop new feature using TDD approach. Is there any convention that I should follow?

Should I create a separate test application, then write some test class, methods. Then implement the actual functionality in the same test project or in the original project where new feature will be implemented.

Another thing I need to know, is there any specific convention for naming classes,methods, variable? I will use MS test and for mocking MOQ.

1

There are 1 answers

2
Fabio On
  • Create new Test solution with one Test project (suggested name for test project <OriginalProject>.Tests - thanks to @ReneA)
  • Add your original project as Existing project to the test solution
  • Add reference of original project to the test project
  • Create same folder/namespace structure as in original project. This will help navigating in both projects - thanks to @ReneA
  • Create new Test class
  • Add new test method where you will call a method from original project and assert results

Do not waste time with naming in the beginning. Start writing tests, run them. After few tests you will be able to find out by yourself what naming conventions is more suitable for your project.