I'm currently developing a TDD idmb html scraper which ill extract certain fields from the imdb webpage. Eg. Title, Synopsis,Cast etc in C++.
I'm just wondering if i have done the TDD right , i have 2 classes the Parser Class & MatchPattern class.
The parser class has like a loadfile function that loads the file into a string and then starts calling the various matchpatttern functions like MatchPattern::extractTitle(string filecontents) and stores them in Parsers' private variables.
the matchpattern is essentially a utility class with static functions. I have no problem testing the matchpattern class. But as for parser class? how should i have designed it for TDD. Am i doing it right or is there something wrong?
You don't design it for TDD, you design it using TDD... By writing the test first your design will automatically be testable. Think "How do I want to use this and how can I test it in a simple way". That's where to start.