Testing in ASP.NET
When I first started programming, testing seemed like a fairy tale to me. I could not even code, let alone testing.
But now, after coding in professional experiences, I started to realize the importance of testing.
But the problem is, it is so hard to make test on current functions or classes because right now it’s hard to control the scenarios especially when the scenarios include external db..
And that’s why you need TDD.. (Test driven development.. ) That turns the paradigm of programming totally different…
so how I first implemented this program was, I made a Method class, which had all the methods to handle the db or handle the scenarios, and called it from the cs file which is the backend file of the view of the implementation.
There was no reason for implementing the program this way, just did it because the previous guy did it this way.
I had no opinion about this, but as I thought of it as TDD, it would be very inefficient to make every tests for each methods.
So I made the application again from the start, just leaving the ui itself from the previous version.
Instead, I made classes for each scenarios, for example, I made a class for input, and made a status integer inside to indicate the status to check for errors in the constructor.
And I would make tests regarding the status of the classes.
Overall, it’s good to do tdd, but it’s really hard when db is included.