Stand by...

Archive for the ‘TDD’ Category

How to open file in testable way?

One of the most common problems in Test-Driven Development are parts of code which need to make some calls to your system environment. In general you is such situation you are forced to use some global functions which are really hard to test or mock. So lets look on some code and lets try to make it more testable.

How to test main()?

When you are doing Test-Driven Development you try to test what ever you wrote. Better you write tests before you write any line of code. But finally when you have your brand new functions and classes (all 100% covered by tests) you have to integrate it in some working software. In the very end (or begining) you have to write main(int, char**) function. How do you test it using Unit Tests?