开发者

Unit testing at a higher level

I have a legacy code base in php, and we have a few applications in python (new codebase). I am attempting to migrate the legacy pieces to the new codebase/language. Currently I can only think of the use of regression testing (meaning someone manually visiting the links the legacy code once handled) to validate and verify the code was migrated successfully. However I am a huge fan of unit testing, and want to know if it is possible to apply unit testing at a higher level. So my tests would sit above the php/python level and be unaware of the specifics of the level below it. An example would be if the php once handle开发者_如何转开发d a GET request. I code the unit test above the application level to verify the responses to the GET request. I then swap out the php code with python code, and have the test break until I can make it succeed. I suppose what I am trying to do is define an interface at a higher level than application level, and use that interface to unit test. Is this possible/heard of? or am I barking up the wrong tree?


What you describe are perfectly valid and good tests, albeit not unit tests - rather, integration / functional / acceptance tests. Still, such tests can be run using a conventional unit testing framework. However, there are tools specialized for this too.

I haven't got much experience in web testing, but have a look at HttpUnit or FitNesse.


Not to forget about JWebUnit

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜