I first have to let you know that I am NOT actually doing Test Driven development on live projects consistently.
I have created some tests for client work in the past before coding, but it has been quite rare.
I like the idea of Test Driven Development and would like to implement it in all my work, [THIS IS A LAME EXCUSE] but my skills aren’t really there yet and so it would take longer to code that way right now. [/THIS IS A LAME EXCUSE]
Even though I am using this lame excuse, I am taking steps to improve my TDD skills as you can see if you look at the TDD series in my blog in which I am trying to code using TDD in 25 minute chunks. Granted at least half of the 25 minute chunk is me typing in the blog what I am thinking as I do it and taking screenshots and copying code. I think it’s coming along nicely and is definitely helping me to learn the concepts.
I also watch a number of videos on YouTube having to do with TDD and Continuous Development like this one I watched today on TDD and UI.
I like the idea that with writing tests first:
- Thinking about what the successful operation of the code will look like before I write it.
- Having a codified set of requirements that the code must pass.
- Thinking about the customer’s requests and turning them into test code.
- Later on when I have done this for a larger code base, I will see when new code makes old tests break. The customer will not be the one notifying me of every bug.
- I will write code in a testable way that encourages me to write more clean and well-structured code.
- Increasing my confidence as I write new code that I will get immediate feedback of things that are going wrong.
In terms of writing TDD code in Access VBA specifically, I have not seen too many others doing this, however with software that contains testing frameworks like RubberDuckVBA, or AccUnit, and which are current and up to date for the latest versions of Access, I know there must be demand and people using these tools. So far I had only really found RubberDuckVBA as a current viable option, so I’ll have to check out AccUnit and see how it works.
I also know VBA contains very basic commands that were to be used for testing like Debug.Assert.
I hope this becomes more of a norm for programmers. It has been a paradigm shift for me that I am still working through. Let me know if this is interesting to you by commenting on the blog, or replying to the email if you received this article that way. Until next time!